🌏 中文版
Release Info
| Item | Value |
|---|---|
| Framework | AG2 (formerly AutoGen) |
| Version | v1.3.2 |
| Previous version | v.1.3.1 |
| Release date | 2026-11-15 |
| Release Notes | v1.3.2 |
| GitHub | ag2ai/ag2 |
| Stars | 5.1k |
Why this release matters
Multi-provider agent frameworks tend to force every provider's usage fields into the same field names — prompt_tokens, completion_tokens, total_tokens. The problem is that providers don't agree on whether a cache hit counts as part of the prompt. OpenAI and Gemini fold cache reads and writes into prompt_tokens; Anthropic and Bedrock, until now, only reported the part that missed the cache. So the same field name meant a different number depending on which provider answered, and any cross-provider usage dashboard, TokenMonitor threshold, or delegation-tree usage rollup could be silently wrong — not crashing, just wrong. 1.3.2 pins the rule down at the provider-mapper layer: prompt_tokens always means the whole input, and cache reads/writes are a subset of it, never an addition on top. The other change worth flagging is how decision agents are used: before, one agent could only answer one classification question; now a flat schema lets it answer several in a single request, without resending — and rebilling — the same input for each one.
Numbers are from the release notes: the same call reported prompt_tokens=3 before, and prompt_tokens=8,630 after.
Key changes
- One rule for token usage across providers:
prompt_tokensalways means the full input, including cache reads and writes;cache_read_input_tokensandcache_creation_input_tokensare a subset of it, never an addition;total_tokens >= prompt_tokens + completion_tokens→ fixes the Anthropic/Bedrock undercount that left out cache hits, so usage numbers are now directly comparable across providers - Gemini Live thinking tokens fold into completion_tokens: matching how batch Gemini and xAI already count them, instead of being excluded from usage → workflows doing reasoning on Gemini Live finally get a complete usage number
- Several decision questions in one request:
response_schemacan now be a flat dataclass,TypedDict, or Pydantic model, with each field mapping to one decision question; bothOpenAIDecisionsConfigandTypeSafeConfigsupport it, and every question goes out in a single request → no more spinning up one agent per question ("is this spam, which team, how urgent") just to resend and rebill the same input three times; a schema the decision APIs can't answer — nested fields,Optional, a field without a question — is rejected locally before anything is sent - ACP 1.0: messages no longer get joined into one string — each chunk is now its own
ModelMessageevent, andreply.bodyis the agent's final message rather than everything it said; text/blob resources, resource links, and tool-result structure are no longer dropped; a session no longer needsasync withto close cleanly;cwdandadditional_directoriesare resolved to absolute paths as soon as a session starts - Python 3.15 support: CI and type-checking now cover 3.15, but PyYAML hasn't shipped 3.15 wheels yet, so
pip install ag2on 3.15 builds PyYAML from source and needs a C compiler
Breaking Changes
prompt_tokens,total_tokens, and the telemetry fieldgen_ai.usage.input_tokenswill go up on Anthropic and Bedrock (cache reads/writes are now counted in):- Affected: any project with a token budget or
TokenMonitorthreshold will hit it sooner than before; usage data stored by earlier versions is not rewritten
- Affected: any project with a token budget or
completion_tokensandtotal_tokenswill go up on Gemini Live thinking models (thinking tokens now included):- Affected: workflows on Gemini Live thinking models with a usage threshold set
- the
acpextra now requiresagent-client-protocol>=1.0.0,<2; 0.12.x is no longer supported:- Affected: any project pinning
agent-client-protocolitself — update that pin before upgrading AG2
- Affected: any project pinning
ag2.acp.AuthMethoddrops the env-var auth method the SDK removed;BridgeState.turn_textis replaced byturn_messages:- Affected: code that references either name directly
Migration Guide
Upgrading from v.1.3.1 to v1.3.2
pip install --upgrade ag2==1.3.2
# Before: one decision agent per question — three agents for three questions
is_spam_agent = Agent("is_spam", config=OpenAIDecisionsConfig(), response_schema=bool)
department_agent = Agent("department", config=OpenAIDecisionsConfig(), response_schema=Department)
urgency_agent = Agent("urgency", config=OpenAIDecisionsConfig(), response_schema=Urgency)
# the same ticket text gets sent, and billed, three times
# After: a flat schema answers all of them in one request
@dataclass
class TicketTriage:
is_spam: Annotated[bool, Question("Is this message spam?")]
department: Annotated[Department, Question("Which team should handle this ticket?")]
urgency: Annotated[Urgency, Question("How urgent is this ticket?")]
triage = Agent("triage", config=OpenAIDecisionsConfig(), response_schema=TicketTriage)
reply = await triage.ask("I was charged twice this month.")
Before upgrading, check whether your agent-client-protocol pin is already >=1.0.0,<2 — if not, update that pin first. If you have a token budget or TokenMonitor threshold set, re-check those numbers after upgrading, especially for anything running on Anthropic, Bedrock, or Gemini Live thinking models — the same threshold can now trigger earlier than it used to. Projects without ACP or custom token thresholds can upgrade directly.
Compared to other frameworks
deepset's Haystack also added OpenAI Decisions API-based router/classifier components this week (v3.5.0, Nov 10) — OpenAIDecisionsTextRouter, OpenAIDecisionsImageRouter, OpenAIDecisionsDocumentClassifier — but each component handles a single classification axis: which branch a piece of text or an image goes to. AG2's flat schema here is solving a different dimension — bundling several independent questions (is it spam, which department, how urgent) into one request — so the redundancy it removes is "does the same input need to be sent more than once," not which axis to classify on. As for the cross-provider token rule, most frameworks just pass each provider's SDK usage fields through as-is; few write down an explicit rule for whether prompt_tokens should include cache hits and enforce it at the provider-mapper layer. AG2 has filled that gap more carefully than most comparable frameworks.
Today's takeaway
I used to assume prompt_tokens was a standardized field in multi-provider frameworks — if the field name is unified, surely its meaning is too. Seeing the before/after in the release notes made it clear that isn't true: on the same call, Anthropic used to report prompt_tokens=3 while the model had actually read 8,630 tokens. That's not a bug — it's that the field never had a shared cross-provider definition in the first place. Which means any cross-provider usage dashboard built on "standardized" field names could have been silently off by an order of magnitude, with nobody noticing, because nothing about it ever threw an error.