Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
8aa17b1
feat(adk): runner-managed session
shentongmartin May 13, 2026
5388e10
feat(serialization): add HumanReadableSerializer with improved perfor…
shentongmartin Jan 22, 2026
60dcb33
fix(adk): harden managed session persistence
shentongmartin May 20, 2026
9d3b9ee
fix(adk): close session review gaps
shentongmartin May 20, 2026
3d5b6ad
fix(adk): avoid go121 slices package
shentongmartin May 20, 2026
32a1a5d
fix(adk): satisfy ci lint checks
shentongmartin May 20, 2026
4a39bae
fix(serialization): preserve human readable edge cases
shentongmartin May 20, 2026
13b2b3f
fix(adk): defer interrupt checkpoint until session events are durable
shentongmartin May 20, 2026
b075caa
fix(adk): preserve resumability of pre-envelope agent_tool checkpoints
shentongmartin May 20, 2026
4942054
refactor(adk): unify LoadEvents cursor naming into single After field
shentongmartin May 21, 2026
2f9797c
refactor(adk): rename LoadEventsOptions to LoadEventsRequest
shentongmartin May 21, 2026
83bc84e
docs(adk): fix middleware lifecycle comments and remove unused GobSer…
shentongmartin May 21, 2026
79b0a30
feat(adk): add retry-with-backoff to session event persister and conf…
shentongmartin May 21, 2026
8da356c
feat(adk): utilize persisted TurnEndState.ToolInfos for prompt cache …
shentongmartin May 22, 2026
93628b8
feat(adk): add timestamps to agent and session events
shentongmartin May 22, 2026
84fca31
fix(adk): deduplicate system message in defaultGenModelInput for sess…
shentongmartin May 22, 2026
61d4719
refactor(serialization): consolidate HumanReadableSerializer tests in…
shentongmartin May 22, 2026
9b5b4b5
refactor(adk): simplify SessionStore to append-only event log
shentongmartin May 22, 2026
278b850
feat(adk): use SessionEvent EventID as SessionStore cursor
shentongmartin May 23, 2026
410fe12
feat(adk): share EventID between AgentEvent and SessionEvent
shentongmartin May 23, 2026
53bbedb
feat(adk): add session timeline observation events
shentongmartin May 24, 2026
e05042e
feat(adk): add managed interrupt resume mode
shentongmartin May 24, 2026
7ed2515
refactor(adk): consolidate session event lane
shentongmartin May 24, 2026
f49960e
fix(adk): preserve checkpoint before fresh turn
shentongmartin May 24, 2026
f85d5c1
feat(middlewares): add permission middleware
shentongmartin May 24, 2026
fe15adc
feat(middlewares): refine permission resume resolution
shentongmartin May 24, 2026
109f220
fix(adk): harden permission middleware
shentongmartin May 24, 2026
5076e12
feat(adk): add file session store
shentongmartin May 24, 2026
c0b4860
fix(adk): resolve session loop lint failures
shentongmartin May 25, 2026
88bbc32
refactor(adk): auto-abandon pending checkpoint on fresh Run
shentongmartin May 25, 2026
0f1e8b9
refactor(adk): make SessionStore format-agnostic via SessionEventPayload
shentongmartin May 25, 2026
2387930
fix(adk): revert FileStore to raw line format for HumanReadableSerial…
shentongmartin May 25, 2026
28a8611
refactor(adk): remove RunID and recover inFlightTurnID on Resume
shentongmartin May 25, 2026
5b29da3
refactor(adk): cleanup session timeline event structs
shentongmartin May 25, 2026
cd72975
fix(adk): add omitempty to MessagesReplaced json tag
shentongmartin May 25, 2026
b90520b
refactor(adk): rename SessionPersistenceConfig to SessionConfig
shentongmartin May 25, 2026
86992f8
feat(adk): replace tool observation events with tool span events
shentongmartin May 26, 2026
99f7d01
feat(adk): persistence-aware tool spans across interrupt/resume
shentongmartin May 26, 2026
bd256aa
feat(adk): add kind-aware session store payloads and load filters
shentongmartin May 26, 2026
f96905c
feat(adk): persist agent interrupt as SessionEventAgentInterrupt
shentongmartin May 26, 2026
dadb61a
test(adk): cover session log terminal paths
shentongmartin May 26, 2026
653b85c
docs(adk): clarify session event cursor semantics
shentongmartin May 26, 2026
d12ef1b
feat(adk): add sync session persistence mode
shentongmartin May 26, 2026
fba8348
refactor(adk): simplify AgentInterruptEvent to flat context slice
shentongmartin May 26, 2026
17dc6e9
feat(adk): backfill SessionEvent on live message events
shentongmartin May 26, 2026
4650a8c
fix(adk): emit user input timeline events
shentongmartin May 27, 2026
d8be7ec
fix(adk): guard concurrent store.events access in sync-mode tests
shentongmartin May 27, 2026
84204af
feat(adk): add extensible session timeline events
shentongmartin May 27, 2026
2d31662
refactor(adk): rename session config field
shentongmartin May 28, 2026
016b405
fix(adk): avoid turn end requirement after fatal errors
shentongmartin May 28, 2026
cd010b8
fix(adk): set streaming meta for agentic tool chunks
shentongmartin May 28, 2026
20f4d76
fix(adk): harden session reduction persistence
shentongmartin May 28, 2026
984675d
fix(adk): close managed interrupt resume race
shentongmartin May 28, 2026
9479038
fix(compose): enrich checkpoint set errors
shentongmartin May 29, 2026
4b71d48
fix(adk): handle managed resume and synthetic rerun inputs
shentongmartin May 29, 2026
b5b8ada
feat(adk): add session rollback
shentongmartin May 29, 2026
d683470
fix(middlewares): clean permission interrupt payload
shentongmartin May 29, 2026
1701b74
refactor(adk): use typed session service
shentongmartin May 31, 2026
6bd020c
fix(middlewares): update permission session test
shentongmartin May 31, 2026
c176d7e
fix(adk): handle typed-nil CheckpointStore and add configurable Event…
shentongmartin Jun 1, 2026
36480c5
feat(adk): pass context to EventIDGenerator for request-scoped ID gen…
shentongmartin Jun 1, 2026
791bcf3
feat(adk): add opt-in model call timeout with per-phase budgets
shentongmartin Jun 1, 2026
b8283c9
feat(deep): propagate ModelTimeoutConfig to deep agent and general su…
shentongmartin Jun 1, 2026
cdba1e9
refactor(adk): move session ownership to session events
shentongmartin Jun 2, 2026
306303e
feat(adk): export prompt language wrappers
shentongmartin Jun 2, 2026
65ce068
fix(deep): propagate model retry config to task tool
shentongmartin Jun 2, 2026
60826fc
feat(middlewares): normalize patch tool call history
shentongmartin Jun 2, 2026
77db87b
chore: ignore external working trees
shentongmartin Jun 2, 2026
24e8af3
feat(adk/filesystem): support rich execute configuration
shentongmartin Jun 3, 2026
09e0f03
feat(adk): add fenced session service
shentongmartin Jun 8, 2026
3deeb27
refactor(adk): simplify session fencing ownership
shentongmartin Jun 8, 2026
c36166d
feat(adk): support session event id generator
shentongmartin Jun 9, 2026
226572e
feat(adk): add resume wait timeout
shentongmartin Jun 10, 2026
ca83a47
fix(adk): keep memory store go1.18 compatible
shentongmartin Jun 10, 2026
9ac6d53
fix(adk): stabilize session message ids
shentongmartin Jun 10, 2026
c319887
test(serialization): avoid duplicate gob registration
shentongmartin Jun 10, 2026
415321c
test(serialization): use concrete gob benchmark payloads
shentongmartin Jun 10, 2026
41c2803
test(adk): cover session adapter edge cases
shentongmartin Jun 10, 2026
3b76836
test(adk): cover file session store edges
shentongmartin Jun 10, 2026
1801c96
refactor(adk): simplify session persistence flow
shentongmartin Jun 10, 2026
5f7f9d3
fix(adk): preserve loaded session tail
shentongmartin Jun 10, 2026
a347e37
test(adk): stabilize cancel resume timeout test
shentongmartin Jun 11, 2026
07a9c70
test(adk): request cancel before resume safepoint
shentongmartin Jun 11, 2026
274fbaa
test(adk): stabilize resume stream cancel test
shentongmartin Jun 11, 2026
ac67d73
test(adk): cover model timeout edge paths
shentongmartin Jun 11, 2026
cae4f13
test(adk): stabilize turn loop cancel mock
shentongmartin Jun 11, 2026
9a5e528
feat(adk): record permission resume decisions (#1070)
shentongmartin Jun 12, 2026
a5b7e30
refactor(adk): drop AgentInterruptCause classification (#1072)
shentongmartin Jun 12, 2026
aab6f7e
fix(adk): allow business interrupt resume through permission gate (#1…
shentongmartin Jun 12, 2026
0022ba4
feat(adk): auto memory middleware (#987)
N3kox Jun 15, 2026
743224a
feat(adk): automemory rebuild memory instruction & emit session event…
N3kox Jun 15, 2026
cf72e91
fix(adk): auto memory TypedSendEvent wrong kind (#1082)
N3kox Jun 15, 2026
79eef75
fix(adk): persist BeforeAgent session events (#1083)
shentongmartin Jun 16, 2026
972c4cc
refactor(adk): simplify session service ownership (#1079)
shentongmartin Jun 17, 2026
4d4687d
fix(adk): drop errored streams from session persistence (#1088)
shentongmartin Jun 17, 2026
4bb0286
refactor: simplify load session (#1086)
YellowDusk04 Jun 18, 2026
543656c
feat(adk): auto memory support multi memory store (#1087)
N3kox Jun 18, 2026
28cc930
chore(adk): memory glob prompt (#1089)
N3kox Jun 18, 2026
a72d9ea
refactor(adk): extract model timeout middleware (#1095)
shentongmartin Jun 22, 2026
1afd7b3
fix(adk): persist leading system messages (#1096)
shentongmartin Jun 22, 2026
177033b
feat(adk): extract memory instruction customize (#1097)
N3kox Jun 22, 2026
78ad9db
refactor(adk): remove turn end session event (#1098)
shentongmartin Jun 22, 2026
b7906d3
fix(adk): deduplicate deep agent system prompts (#1101)
shentongmartin Jun 23, 2026
7d6ad71
fix(adk): delete consumed resume checkpoint (#1102)
shentongmartin Jun 23, 2026
8b29a7f
fix(adk): snapshot leading system sync state (#1103)
shentongmartin Jun 24, 2026
8958ee9
feat(adk): persist incomplete stream prefixes (#1105)
shentongmartin Jun 24, 2026
dbfe9a9
refactor(adk): introduce SessionEventVariant and simplify session eve…
shentongmartin Jun 25, 2026
33648fd
feat(adk): rollback memory stores to single memory dir (#1109)
N3kox Jun 25, 2026
a77de0d
fix(adk): dedupe empty model context snapshots (#1115)
shentongmartin Jun 26, 2026
26bc5ca
feat(adk): background-task manager with subagent/filesystem/deep wiri…
hi-pender Jun 29, 2026
4c6ee74
refactor(adk): remove session TurnID and stop persisting runtime gene…
shentongmartin Jun 30, 2026
16fa7d7
fix(summarization): prefer UserInputMultiContent for user text conten…
mrh997 Jun 29, 2026
147eab1
chore: ensure that tool calls match tool results and correct comments…
YellowDusk04 Jun 30, 2026
4dc69f1
fix(adk): harden session reduction persistence
shentongmartin May 28, 2026
04c8ef6
feat(adk): dream improvements
N3kox Jun 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,7 @@ CLAUDE.md

# Internal dev setup (not for public repo)
/scripts/dev_setup_internal.sh

# External working trees
/examples/
/ext/
132 changes: 132 additions & 0 deletions V0.9_COMPATIBILITY_NOTE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
<!--
Copyright 2026 CloudWeGo Authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# V0.9 agentic-runtime Compatibility Note

本文列出现有用户从 V0.8.x 升级到 V0.9 `agentic-runtime` 时需要关注的 API 和语义变化。未列出的新增能力通常不影响既有 `*schema.Message` 路径。

## API 显式变更

### ChatModelAgentMiddleware 新增 AfterAgent

`ChatModelAgentMiddleware` 新增 `AfterAgent` 方法。手写实现该接口的类型需要补充该方法,否则会编译失败。

推荐做法:

- 如果 middleware 不需要特殊收尾逻辑,嵌入 `*adk.BaseChatModelAgentMiddleware`。
- 如果 middleware 需要在 Agent 成功结束后清理状态、记录事件或补充统计,实现 `AfterAgent(ctx, state)`。

影响范围:

- 仅影响显式实现 `ChatModelAgentMiddleware` 的用户代码。
- 通过 `BaseChatModelAgentMiddleware` 组合扩展的代码可保持兼容。

### summarization.SummarizeMessages 被移除

`summarization.SummarizeMessages` 和 `summarization.SummarizeOutput` 不再导出。

迁移方式:

- 构造 summarization middleware 时继续使用 `summarization.New` 或 `summarization.NewTyped`。
- 需要主动触发同步 summarization 时,使用 `TypedMiddleware.Summarize`。

该调整将 summarization 的配置、状态读取和执行逻辑收敛到 middleware 内部,避免独立函数与运行时状态语义分叉。

## 需要关注语义变化的能力

### Summarization Finalize 后处理语义变化

V0.8.x 中,summarization middleware 会先执行默认 summary 后处理,再调用用户配置的 `Finalize`。因此自定义 `Finalize` 收到的 `summary` 已经包含 `PreserveUserMessages` 替换、`TranscriptFilePath` 注入和 summary preamble。

V0.9 中,如果设置了 `Config.Finalize`,middleware 会直接把模型生成的 raw summary 传给 `Finalize`,不再自动执行默认后处理。受影响的配置包括:

- `PreserveUserMessages`
- `TranscriptFilePath`

迁移方式:

- 如果希望保留默认后处理,不要设置 `Finalize`,让 middleware 使用默认 finalization 路径。
- 如果必须自定义 `Finalize`,但仍希望保留默认后处理,先通过 `DefaultFinalizer` 构造默认 finalizer,再在自定义逻辑中显式组合。
- `DefaultFinalizer` 不会自动读取外层 `Config.PreserveUserMessages` 和 `Config.TranscriptFilePath`;需要通过 `DefaultFinalizerConfig` 显式传入。
- 使用 `NewFinalizer().PreserveSkills(...).Build()` 的代码需要特别检查:该 finalizer 只负责 preserve skills,不会自动补上 `PreserveUserMessages` 和 `TranscriptFilePath`。

### 工具列表修改路径调整

`ModelContext.Tools` 不再是推荐的工具列表修改入口。

升级建议:

- 在 `BeforeModelRewriteState` 中修改 `state.ToolInfos`。
- 如需模型原生 deferred tool search,修改 `state.DeferredToolInfos`。
- 不建议在 `WrapModel` 中修改工具列表;该修改只影响当前模型调用,后续 middleware、后续 turn 或 checkpoint/resume 不会继承这次修改。

### Model Retry 决策语义增强

`ModelRetryConfig` 新增 `ShouldRetry`。当 `ShouldRetry` 非空时,`IsRetryAble` 会被忽略。

需要注意:

- 旧的 `IsRetryAble` 仍可用于错误维度的简单重试。
- 使用 `ShouldRetry` 后,应显式处理成功输出但业务不接受的场景。
- Interrupt 和 `ErrStreamCanceled` 不作为普通 retry error 处理。

### Cancel 错误语义

V0.9 引入主动取消语义后,应用需要区分主动取消、普通错误和业务 interrupt。

升级建议:

- 上层应区分 `CancelError`、普通 error 和业务 interrupt。
- 如果应用主动接入 `WithCancel`,不要把 `CancelError` 当作普通业务失败处理。

### AgenticMessage 迁移需要理解新的消息结构

`TypedChatModelAgent[*schema.AgenticMessage]` 是面向模型原生 Agentic 协议的新路径。迁移到该路径不只是把泛型参数从 `*schema.Message` 改成 `*schema.AgenticMessage`,还需要按 `AgenticMessage` 的 content block 结构处理消息内容。

需要注意:

- AgenticMessage 路径使用 `AgenticModel` 与 `AgenticToolsNode` 处理工具调用。
- 工具调用和工具结果通过 `AgenticMessage` content block 表达,尤其需要正确处理 tool call / tool result content block。
- Agent transfer 能力不适用于 AgenticMessage 路径。
- 既有应用如果不需要模型原生 Agentic 协议,建议继续使用默认 `*schema.Message` 路径;只有在明确要接入 `AgenticModel` 协议时再迁移。

### 模型适配器需要识别新增 option

V0.9 引入 `AgenticModel` 后,模型适配器需要更严格地处理 call-time options。`AgenticModel` 是 `BaseModel[*schema.AgenticMessage]` 的别名,不再提供类似 `ToolCallingChatModel.WithTools` 的增强接口;工具绑定统一通过 `model.WithTools` 作为 `model.Option` 传入。

需要注意:

- 所有支持 AgenticMessage 的模型适配器都应读取 `Options.Tools`,并将其映射到 provider 的 tool calling 协议。
- `AgenticModel` 不应要求用户先调用某个 `WithTools` 方法得到“带工具的模型实例”;ADK 会在每次模型调用时通过 `model.WithTools` 传递当前工具列表。
- 如果适配器只从自身 config 读取工具,而忽略 `model.WithTools`,在 ChatModelAgent / AgenticToolsNode 路径下会出现模型看不到工具或工具列表不随运行态变化的问题。

V0.9 还在 `model.Options` 中新增:

- `DeferredTools`
- `ToolSearchTool`
- `AgenticToolChoice`

现有模型适配器忽略这些 option 通常不会导致编译失败,但会导致 deferred tool search、模型原生 tool search 或 agentic tool choice 不生效。适配器维护者应按目标 provider 的协议补齐转换逻辑。

### ToolInfo 序列化形态变化

`ToolInfo` 增加显式 JSON/Gob 编解码,以保留 `ParamsOneOf`。

影响:

- `ToolInfo` 进入了 `ChatModelAgentState.ToolInfos` / `DeferredToolInfos`,因此可能随 Agent state 一起进入 checkpoint。
- 显式 JSON/Gob 编解码用于保证 `ParamsOneOf` 在 checkpoint、deep copy 和恢复过程中不会丢失。
- 如果外部系统直接依赖旧版 `ToolInfo` JSON 形态,需要重新确认序列化兼容性。
90 changes: 90 additions & 0 deletions V0.9_RELEASE_FINDINGS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<!--
Copyright 2026 CloudWeGo Authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# v0.9 Release Findings

## Comparison Scope

- Compared `alpha/09` against `main` using `main...alpha/09`.
- `main` is the merge base of `alpha/09`.
- Branch heads observed during analysis:
- `main`: `5e1305506c4fa89ef5d786035a947258e29a7593`
- `alpha/09`: `c39433511896d6a12e379a7958c6e5d489560b5a`
- Second validation pass confirmed `main == origin/main`, `alpha/09 == origin/alpha/09`, and `main` is the merge base.
- Diff size: `136 files changed`, `49,967 insertions`, `2,790 deletions`.
- Changed surface is concentrated in `adk`, `schema`, `components/model`, `components/prompt`, `compose`, and callback helpers.

## Primary Features

| Area | v0.9 feature | Direct diff validation |
| --- | --- | --- |
| Agentic message model | Adds `schema.AgenticMessage`, content-block based message schema, provider extensions, streaming metadata, MCP/server/function tool blocks, and concat support. | `A schema/agentic_message.go`; concat registration in `schema/message.go`. |
| Generic model abstraction | Introduces `model.BaseModel[M]`; keeps `BaseChatModel` as `BaseModel[*schema.Message]`; adds `AgenticModel`. | `M components/model/interface.go`. |
| Typed ADK | Adds typed agents, typed events, typed runner, typed `ChatModelAgent`, and typed message variants while preserving default `*schema.Message` aliases. | `M adk/interface.go`, `M adk/chatmodel.go`, `M adk/runner.go`. |
| Agentic ChatModelAgent path | `TypedChatModelAgent[*schema.AgenticMessage]` supports a single-shot agentic model path where tool calling is handled inside the model/message protocol. | `M adk/chatmodel.go`; `TypedChatModelAgent` and agentic ReAct path are added in the diff. |
| Cancellation | Adds `WithCancel`, `CancelMode`, safe-point cancellation, recursive cancellation, timeout escalation, `CancelHandle`, and `CancelError` with resumable interrupt contexts. | `A adk/cancel.go`; cancel integration hunks in `adk/chatmodel.go`, `adk/flow.go`, and `adk/wrappers.go`. |
| TurnLoop | Adds a push-based `TurnLoop` runtime with `Push`, non-blocking `Stop`, idle-stop, checkpoint/resume integration, and preempt handling. | `A adk/turn_loop.go`, `A adk/turn_buffer.go`. |
| Model retry | Upgrades retry from error-only retryability to `ShouldRetry(ctx, RetryContext) -> RetryDecision`, allowing output inspection, input rewrite, option rewrite, backoff override, and reject reason. | `M adk/retry_chatmodel.go`. |
| Model failover | Adds ChatModel failover with `ModelFailoverConfig`, `FailoverContext`, last-success model preference, and callback-aware proxying. | `A adk/failover_chatmodel.go`; config wiring in `adk/chatmodel.go`. |
| Tool search | Adds dynamic tool search middleware with both client-side search and model-native deferred tool search via `DeferredToolInfos`, `WithDeferredTools`, and `WithToolSearchTool`. | `M adk/middlewares/dynamictool/toolsearch/toolsearch.go`, `M components/model/option.go`. |
| Middleware modernization | Generifies summarization, reduction, skill, filesystem, plan-task, patch-tool-calls and adds `AfterAgent`; state now carries `ToolInfos` and `DeferredToolInfos` as the recommended mutable model-call surface. | Diff hunks in `adk/handler.go`, `adk/middlewares/*`, and `adk/prebuilt/deep/deep.go`. |
| Summarization API | Adds `TypedMiddleware.Summarize` and typed finalizer/customized-action paths; removes the old standalone `SummarizeMessages` / `SummarizeOutput` API in favor of middleware-owned summarization. | `M adk/middlewares/summarization/summarization.go`, `M customized_action.go`, `M finalizer_builder.go`. |
| Compose/tooling | Adds `AgenticToolsNode` and tool name/argument aliases for `ToolsNode`. | `A compose/agentic_tools_node.go`, `M compose/tool_node.go`. |
| Prompt/callback support | Adds agentic prompt templates and callback types for agentic prompt/model/tools/agent components. | `A components/prompt/agentic_chat_template.go`, `A components/*/agentic_callback_extra.go`, `M utils/callbacks/template.go`. |
| Filesystem | Adds enhanced multimodal read support and PDF page validation. | `M adk/filesystem/backend.go`, `M adk/middlewares/filesystem/filesystem.go`. |
| Agents.md | Adds `agentsmd` middleware for automatically loading and injecting `AGENTS.md`-style instructions. | `A adk/middlewares/agentsmd/agentsmd.go`, `A loader.go`. |

## Compatibility Notes

| Impact | Note |
| --- | --- |
| Source break for custom middleware implementers | `ChatModelAgentMiddleware` now includes `AfterAgent`. Any user-defined type that manually implements the interface must add this method or embed `BaseChatModelAgentMiddleware`. |
| Middleware tool mutation semantics | `ModelContext.Tools` is now deprecated as a mutation surface; tool list changes should happen through `state.ToolInfos` / `state.DeferredToolInfos` in `BeforeModelRewriteState`. Mutating tools in `WrapModel` only affects one model call and is explicitly discouraged. |
| Summarization standalone API removal | `summarization.SummarizeMessages` and `summarization.SummarizeOutput` are no longer exported. Use `New` / `NewTyped` to construct middleware, or call `TypedMiddleware.Summarize` when direct summarization is needed. |
| Retry behavior change | If `ShouldRetry` is set, `IsRetryAble` is ignored. In streaming mode, the full stream is consumed before the retry decision is made, although events are still emitted in real time. |
| Retry cancellation semantics | Retry now treats interrupts and `ErrStreamCanceled` as non-retryable and uses context-aware backoff rather than unconditional sleep. Users relying on retrying interrupt/cancel errors should adjust policy. |
| Cancellation error semantics | During active cancel, business interrupts are absorbed into `CancelError`; the checkpoint preserves interrupt contexts and business interrupt can re-fire on resume. Consumers should handle `CancelError` separately from ordinary business interrupts. |
| TurnLoop stop semantics | `TurnLoop.Stop` is non-blocking; use `Wait` for terminal state. Cancel-related stop options degrade to "finish current turn then exit" if the running agent does not support `WithCancel`. `UntilIdleFor` silently drops cancel options in the same call. |
| Agentic path limitations | `TypedChatModelAgent[*schema.AgenticMessage]` is not feature-equivalent to `*schema.Message`: it uses a single-shot path, does not support agent transfer, and cancel monitoring/retry on model streams are not yet wired. |
| Model adapters must honor new options | Native tool search requires model implementations to read `Options.DeferredTools`, `Options.ToolSearchTool`, and `Options.AgenticToolChoice`. Existing adapters that ignore unknown common options will compile but will not support the new behavior. |
| Serialization shape change | `ToolInfo` now has explicit JSON/Gob encoding that preserves `ParamsOneOf`. This fixes checkpoint/deep-copy loss, but external systems depending on the previous raw JSON shape should re-check serialized payloads. |
| Filesystem page validation | Multimodal read validates PDF `pages` and rejects ranges over 20 pages per request. Users passing arbitrary page ranges should handle validation errors. |
| Transfer/workflow/supervisor positioning | Agent transfer, workflow agents, and supervisor are not removed, but many APIs now carry `NOT RECOMMENDED` guidance in favor of `ChatModelAgent` + `AgentTool` or `DeepAgent`. This is a semantic/product-direction compatibility note, not a signature break. |

## Likely Non-Breaking Alias Changes

- `BaseChatModel` becomes an alias of `BaseModel[*schema.Message]`; existing implementations with `Generate(ctx, []*schema.Message, ...)` and `Stream(ctx, []*schema.Message, ...)` should still satisfy it.
- `Agent`, `AgentInput`, `AgentEvent`, `AgentOutput`, `ChatModelAgent`, `ChatModelAgentConfig`, `ChatModelAgentState`, `ModelContext`, and several middleware config types are preserved as `*schema.Message` aliases over typed forms.
- `ToolOutputPart`, `ToolResult`, and related tool-result types moved from `schema/message.go` to `schema/tool.go`, but remain in package `schema`, so import paths and qualified names are unchanged.

## Validation Results

Completed checks:

- Direct branch-ref validation:
- Verified `main == origin/main`, `alpha/09 == origin/alpha/09`, and the merge base is `main`.
- Rechecked each retained feature row with `git diff main...alpha/09` file status or hunks.
- Removed raw AST API-diff counts from the release findings because the script over-reported generic alias refactors as removals.
- Representative downstream compatibility compile check:
- `GOWORK=off go test .` passed in a temporary external module using `replace github.com/cloudwego/eino => ..`.
- Verified that existing `BaseChatModel` implementations still compile against the `BaseModel[*schema.Message]` alias.
- Verified that `ChatModelAgentConfig`, `summarization.Config`, `reduction.Config`, `skill.Config`, `ToolResult`, and new model options are usable from downstream code.
- Verified that embedding `*adk.BaseChatModelAgentMiddleware` remains the safe compatibility path for middleware implementations.
- Negative compile check for old custom middleware:
- `GOWORK=off go test -tags=oldmiddleware .` fails as expected with: `oldStyleMiddleware does not implement adk.TypedChatModelAgentMiddleware[*schema.Message] (missing method AfterAgent)`.
- This confirms the `AfterAgent` source compatibility note for users who manually implement `ChatModelAgentMiddleware` without embedding the base middleware.
- Targeted package tests:
- `go test ./adk ./adk/middlewares/summarization ./adk/middlewares/reduction ./adk/middlewares/skill ./adk/middlewares/dynamictool/toolsearch ./components/model ./components/prompt ./compose ./schema` passed.
Loading
Loading