Skip to content

Commit 8c9feba

Browse files
Merge branch 'main' of https://github.com/microsoft/agent-framework into agent_framework_to_a2a
2 parents 556f1d3 + aa2ff67 commit 8c9feba

File tree

298 files changed

+25925
-3211
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

298 files changed

+25925
-3211
lines changed

.github/actions/python-setup/action.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ inputs:
88
os:
99
description: The operating system to set up
1010
required: true
11+
exclude-packages:
12+
description: Space-separated list of packages to exclude from uv sync
13+
required: false
14+
default: ''
1115

1216
runs:
1317
using: "composite"
@@ -19,6 +23,20 @@ runs:
1923
enable-cache: true
2024
cache-suffix: ${{ inputs.os }}-${{ inputs.python-version }}
2125
cache-dependency-glob: "**/uv.lock"
26+
- name: Exclude incompatible workspace packages
27+
if: ${{ inputs.exclude-packages != '' }}
28+
shell: bash
29+
run: |
30+
for pkg in ${{ inputs.exclude-packages }}; do
31+
for f in python/packages/*/pyproject.toml; do
32+
if grep -q "name = \"$pkg\"" "$f"; then
33+
pkg_dir=$(dirname "$f" | sed 's|python/||')
34+
echo "Excluding workspace package: $pkg ($pkg_dir)"
35+
sed -i.bak '/\[tool\.uv\.workspace\]/a\exclude = ["'"$pkg_dir"'"]' python/pyproject.toml
36+
sed -i.bak '/'"$pkg"' = { workspace = true }/d' python/pyproject.toml
37+
fi
38+
done
39+
done
2240
- name: Install the project
2341
shell: bash
2442
run: |

.github/workflows/dotnet-format.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,10 @@ jobs:
8686
run: docker pull mcr.microsoft.com/dotnet/sdk:${{ matrix.dotnet }}
8787

8888
# This step will run dotnet format on each of the unique csproj files and fail if any changes are made
89-
# exclude-diagnostics should be removed after fixes for IL2026 and IL3050 are out: https://github.com/dotnet/sdk/issues/51136
9089
- name: Run dotnet format
9190
if: steps.find-csproj.outputs.csproj_files != ''
9291
run: |
9392
for csproj in ${{ steps.find-csproj.outputs.csproj_files }}; do
9493
echo "Running dotnet format on $csproj"
95-
docker run --rm -v $(pwd):/app -w /app mcr.microsoft.com/dotnet/sdk:${{ matrix.dotnet }} /bin/sh -c "dotnet format $csproj --verify-no-changes --verbosity diagnostic --exclude-diagnostics IL2026 IL3050"
94+
docker run --rm -v $(pwd):/app -w /app mcr.microsoft.com/dotnet/sdk:${{ matrix.dotnet }} /bin/sh -c "dotnet format $csproj --verify-no-changes --verbosity diagnostic"
9695
done

.github/workflows/python-code-quality.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
python-version: ["3.10"]
21+
python-version: ["3.11"]
2222
runs-on: ubuntu-latest
2323
continue-on-error: true
2424
defaults:
@@ -55,7 +55,7 @@ jobs:
5555
strategy:
5656
fail-fast: false
5757
matrix:
58-
python-version: ["3.10"]
58+
python-version: ["3.11"]
5959
runs-on: ubuntu-latest
6060
continue-on-error: true
6161
defaults:
@@ -84,7 +84,7 @@ jobs:
8484
strategy:
8585
fail-fast: false
8686
matrix:
87-
python-version: ["3.10"]
87+
python-version: ["3.11"]
8888
runs-on: ubuntu-latest
8989
continue-on-error: true
9090
defaults:
@@ -117,7 +117,7 @@ jobs:
117117
strategy:
118118
fail-fast: false
119119
matrix:
120-
python-version: ["3.10"]
120+
python-version: ["3.11"]
121121
runs-on: ubuntu-latest
122122
continue-on-error: true
123123
defaults:

.github/workflows/python-integration-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ jobs:
170170
environment: integration
171171
timeout-minutes: 60
172172
env:
173-
UV_PYTHON: "3.10"
173+
UV_PYTHON: "3.11"
174174
OPENAI_CHAT_MODEL_ID: ${{ vars.OPENAI__CHATMODELID }}
175175
OPENAI_RESPONSES_MODEL_ID: ${{ vars.OPENAI__RESPONSESMODELID }}
176176
OPENAI_API_KEY: ${{ secrets.OPENAI__APIKEY }}

.github/workflows/python-lab-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ jobs:
6767
with:
6868
python-version: ${{ matrix.python-version }}
6969
os: ${{ runner.os }}
70+
exclude-packages: ${{ matrix.python-version == '3.10' && 'agent-framework-github-copilot' || '' }}
7071
env:
7172
# Configure a constant location for the uv cache
7273
UV_CACHE_DIR: /tmp/.uv-cache

.github/workflows/python-merge-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ jobs:
288288
runs-on: ubuntu-latest
289289
environment: integration
290290
env:
291-
UV_PYTHON: "3.10"
291+
UV_PYTHON: "3.11"
292292
OPENAI_CHAT_MODEL_ID: ${{ vars.OPENAI__CHATMODELID }}
293293
OPENAI_RESPONSES_MODEL_ID: ${{ vars.OPENAI__RESPONSESMODELID }}
294294
OPENAI_API_KEY: ${{ secrets.OPENAI__APIKEY }}

.github/workflows/python-test-coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
run:
2121
working-directory: python
2222
env:
23-
UV_PYTHON: "3.10"
23+
UV_PYTHON: "3.11"
2424
steps:
2525
- uses: actions/checkout@v6
2626
# Save the PR number to a file since the workflow_run event

.github/workflows/python-tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ jobs:
3434
with:
3535
python-version: ${{ matrix.python-version }}
3636
os: ${{ runner.os }}
37+
exclude-packages: ${{ matrix.python-version == '3.10' && 'agent-framework-github-copilot' || '' }}
3738
env:
3839
# Configure a constant location for the uv cache
3940
UV_CACHE_DIR: /tmp/.uv-cache
4041
# Unit tests
4142
- name: Run all tests
42-
run: uv run poe all-tests
43+
run: uv run poe all-tests ${{ matrix.python-version == '3.10' && '--ignore-glob=packages/github_copilot/**' || '' }}
4344
working-directory: ./python
4445

4546
# Surface failing tests

docs/decisions/0001-agent-run-response.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Approaches observed from the compared SDKs:
6464
| AutoGen | **Approach 1** Separates messages into Agent-Agent (maps to Primary) and Internal (maps to Secondary) and these are returned as separate properties on the agent response object. See [types of messages](https://microsoft.github.io/autogen/stable/user-guide/agentchat-user-guide/tutorial/messages.html#types-of-messages) and [Response](https://microsoft.github.io/autogen/stable/reference/python/autogen_agentchat.base.html#autogen_agentchat.base.Response) | **Approach 2** Returns a stream of internal events and the last item is a Response object. See [ChatAgent.on_messages_stream](https://microsoft.github.io/autogen/stable/reference/python/autogen_agentchat.base.html#autogen_agentchat.base.ChatAgent.on_messages_stream) |
6565
| OpenAI Agent SDK | **Approach 1** Separates new_items (Primary+Secondary) from final output (Primary) as separate properties on the [RunResult](https://github.com/openai/openai-agents-python/blob/main/src/agents/result.py#L39) | **Approach 1** Similar to non-streaming, has a way of streaming updates via a method on the response object which includes all data, and then a separate final output property on the response object which is populated only when the run is complete. See [RunResultStreaming](https://github.com/openai/openai-agents-python/blob/main/src/agents/result.py#L136) |
6666
| Google ADK | **Approach 2** [Emits events](https://google.github.io/adk-docs/runtime/#step-by-step-breakdown) with [FinalResponse](https://github.com/google/adk-java/blob/main/core/src/main/java/com/google/adk/events/Event.java#L232) true (Primary) / false (Secondary) and callers have to filter out those with false to get just the final response message | **Approach 2** Similar to non-streaming except [events](https://google.github.io/adk-docs/runtime/#streaming-vs-non-streaming-output-partialtrue) are emitted with [Partial](https://github.com/google/adk-java/blob/main/core/src/main/java/com/google/adk/events/Event.java#L133) true to indicate that they are streaming messages. A final non partial event is also emitted. |
67-
| AWS (Strands) | **Approach 3** Returns an [AgentResult](https://strandsagents.com/latest/documentation/docs/api-reference/python/agent/agent_result/) (Primary) with messages and a reason for the run's completion. | **Approach 2** [Streams events](https://strandsagents.com/latest/documentation/docs/api-reference/python/agent/agent/#strands.agent.agent.Agent.stream_async) (Primary+Secondary) including, response text, current_tool_use, even data from "callbacks" (strands plugins) |
67+
| AWS (Strands) | **Approach 3** Returns an [AgentResult](https://strandsagents.com/docs/api/python/strands.agent.agent_result/#agentresult) (Primary) with messages and a reason for the run's completion. | **Approach 2** [Streams events](https://strandsagents.com/docs/user-guide/concepts/streaming/) (Primary+Secondary) including, response text, current_tool_use, even data from "callbacks" (strands plugins) |
6868
| LangGraph | **Approach 2** A mixed list of all [messages](https://langchain-ai.github.io/langgraph/agents/run_agents/#output-format) | **Approach 2** A mixed list of all [messages](https://langchain-ai.github.io/langgraph/agents/run_agents/#output-format) |
6969
| Agno | **Combination of various approaches** Returns a [RunResponse](https://docs.agno.com/reference/agents/run-response) object with text content, messages (essentially chat history including inputs and instructions), reasoning and thinking text properties. Secondary events could potentially be extracted from messages. | **Approach 2** Returns [RunResponseEvent](https://docs.agno.com/reference/agents/run-response#runresponseevent-types-and-attributes) objects including tool call, memory update, etc, information, where the [RunResponseCompletedEvent](https://docs.agno.com/reference/agents/run-response#runresponsecompletedevent) has similar properties to RunResponse|
7070
| A2A | **Approach 3** Returns a [Task or Message](https://a2aproject.github.io/A2A/latest/specification/#71-messagesend) where the message is the final result (Primary) and task is a reference to a long running process. | **Approach 2** Returns a [stream](https://a2aproject.github.io/A2A/latest/specification/#72-messagestream) that contains task updates (Secondary) and a final message (Primary) |
@@ -496,7 +496,7 @@ We need to decide what AIContent types, each agent response type will be mapped
496496
|-|-|
497497
| AutoGen | **Approach 1** Supports [configuring an agent](https://microsoft.github.io/autogen/stable/user-guide/agentchat-user-guide/tutorial/agents.html#structured-output) at agent creation. |
498498
| Google ADK | **Approach 1** Both [input and output schemas can be specified for LLM Agents](https://google.github.io/adk-docs/agents/llm-agents/#structuring-data-input_schema-output_schema-output_key) at construction time. This option is specific to this agent type and other agent types do not necessarily support |
499-
| AWS (Strands) | **Approach 2** Supports a special invocation method called [structured_output](https://strandsagents.com/latest/documentation/docs/api-reference/python/agent/agent/#strands.agent.agent.Agent.structured_output) |
499+
| AWS (Strands) | **Approach 2** Supports a special invocation method called [structured_output](https://strandsagents.com/docs/user-guide/concepts/agents/structured-output/) |
500500
| LangGraph | **Approach 1** Supports [configuring an agent](https://langchain-ai.github.io/langgraph/agents/agents/?h=structured#6-configure-structured-output) at agent construction time, and a [structured response](https://langchain-ai.github.io/langgraph/agents/run_agents/#output-format) can be retrieved as a special property on the agent response |
501501
| Agno | **Approach 1** Supports [configuring an agent](https://docs.agno.com/input-output/structured-output/agent) at agent construction time |
502502
| A2A | **Informal Approach 2** Doesn't formally support schema negotiation, but [hints can be provided via metadata](https://a2a-protocol.org/latest/specification/#97-structured-data-exchange-requesting-and-providing-json) at invocation time |
@@ -508,7 +508,7 @@ We need to decide what AIContent types, each agent response type will be mapped
508508
|-|-|
509509
| AutoGen | Supports a [stop reason](https://microsoft.github.io/autogen/stable/reference/python/autogen_agentchat.base.html#autogen_agentchat.base.TaskResult.stop_reason) which is a freeform text string |
510510
| Google ADK | [No equivalent present](https://github.com/google/adk-python/blob/main/src/google/adk/events/event.py) |
511-
| AWS (Strands) | Exposes a [stop_reason](https://strandsagents.com/latest/documentation/docs/api-reference/python/types/event_loop/#strands.types.event_loop.StopReason) property on the [AgentResult](https://strandsagents.com/latest/documentation/docs/api-reference/python/agent/agent_result/) class with options that are tied closely to LLM operations. |
511+
| AWS (Strands) | Exposes a `stop_reason` property on the [AgentResult](https://strandsagents.com/docs/api/python/strands.agent.agent_result/#agentresult) class with options that are tied closely to LLM operations. |
512512
| LangGraph | No equivalent present, output contains only [messages](https://langchain-ai.github.io/langgraph/agents/run_agents/#output-format) |
513513
| Agno | [No equivalent present](https://docs.agno.com/reference/agents/run-response) |
514514
| A2A | No equivalent present, response only contains a [message](https://a2a-protocol.org/latest/specification/#64-message-object) or [task](https://a2a-protocol.org/latest/specification/#61-task-object). |

docs/decisions/0019-python-context-compaction-strategy.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,3 +1240,10 @@ class AttributionAwareStrategy(CompactionStrategy):
12401240

12411241
- [ADR-0016: Unifying Context Management with ContextPlugin](0016-python-context-middleware.md) — Parent ADR that established `ContextProvider`, `HistoryProvider`, and `AgentSession` architecture.
12421242
- [Context Compaction Limitations Analysis](https://gist.github.com/victordibia/ec3f3baf97345f7e47da025cf55b999f) — Detailed analysis of why current architecture cannot support in-run compaction, with attempted solutions and their failure modes. Option 4 in this ADR corresponds to "Option A: Middleware Access to Mutable Message Source" from that analysis; Options 1-3 correspond to "Option B: Tool Loop Hook", adapted here to a `BaseChatClient` hook instead of `FunctionInvocationConfiguration`.
1243+
1244+
### Implementation Rollout Note
1245+
1246+
Implementation is split into two phases:
1247+
1248+
1. **Phase 1 (PR 1):** runtime compaction foundation in `agent_framework/_compaction.py`, in-run integration, and extensive core tests, plus in-run compaction samples (`basics`, `advanced`, `custom`).
1249+
2. **Phase 2 (PR 2):** history/storage compaction (`upsert`-based full replacement), provider support, storage tests, and storage-focused sample (`storage`).

0 commit comments

Comments
 (0)