feat(provider): exact signed-thinking capture, persistence and replay (incl. Bedrock)
メンテナーはふだん 1 日以内に返信
@aheritier がすでに取り組んでいます。
2026年10月19日 から。
評価
この issue はまだ評価されていません。
説明
Goal
Capture, persist and replay signed thinking exactly, on all three transports. If the stored state can't be trusted, refuse to continue instead of replaying a rebuilt version.
Why
- Bedrock flattens reasoning into text + signature fields (adapter.go) and rebuilds the blocks later. It treats a signature without text as redacted content (convert.go), but a signed thinking block can legitimately have empty text. Order between thinking, text and tool calls is also rebuilt rather than preserved.
thinkingBindingBehaviorpicksdrop_blockautomatically when the primary or any fallback checks thinking prefixes (thinking_binding.go). The preserved thinking docs makeerrorthe default and describedrop_blockas a stopgap that can cost extra output tokens. Switching the default is a deliberate client policy change.- The Anthropic client already stores raw response blocks in
ProviderStateand replays them when they still describe the message (response_content.go). Extend that mechanism; don't create a second one.
Scope
- Keep blocks in order with their index: thinking (including signed-empty), redacted thinking bytes, text, tool use IDs/inputs and tool results. No "last signature wins".
- Extend
ProviderStateadditively with a version and the serving model. Unknown versions, incomplete or interrupted streams are never replayed as if they were verified. - Bedrock: store and replay native reasoning blocks instead of rebuilding them from flattened fields.
- Keep the Haiku 5.5 exceptions from #4553 and only those: when thinking is off on Direct/Vertex, omit earlier reasoning from the outgoing request; on Converse, omit it with a warning. Stored history is never modified, and turning thinking back on does not silently re-insert omitted blocks.
- Make
thinking_prefix_mismatch: errorthe default for 5.x models whose server checks thinking prefixes (moved from #4652). Usingdrop_blockthen requires explicit config, keeps logging the dropped paths, and never triggers an automatic retry with thinking removed. Use the native binding control only on the Messages API, where it is documented; don't invent an equivalent for Converse. drop_block, when explicitly configured, never deletes the stored original.
Acceptance criteria
- Round-trip tests per transport: stream →
ProviderState→ SQLite and JSON → new runtime → continue an unchanged tool conversation; the replayed request matches the original blocks byte for byte. - Signed-empty thinking, redacted thinking and interleaved thinking/text/tool calls survive the round trip.
- Edited or trimmed history, an imported session and an unknown state version lead to a clear refusal or a documented fallback, never to a silently rebuilt replay.
- Default
erroron prefix-checking 5.x models, explicitdrop_blockwith diagnostics, legacy models unchanged. A session usingnum_history_itemstrimming either replays exactly or fails with a clear refusal, never a raw 400. - Older binaries reading the new state: the limitation is documented (no promise of transparent downgrade).
-
task build,task test,task lint, andgo test -raceon the touched packages pass.
Parent: #4583 · Depends on #4651
- 主要言語
- Go
- スター
- 4.6k
- フォーク
- 522
- 平均マージ
- 8時間 20分
- マージ済み PR(30日)
- 219
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
docker/docker-agent のほかの issue
-
pkg/hooks tests fail with a misleading assertion when jq is not installed対応中かも @dwin-gharibi が 57 日前に担当しました。 オープンarea/testing
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
docker/docker-agent#4052 ·
メンテナーはふだん 1 日以内に返信
-
`remove_directory` and `create_directory` hide work they already did when a later path fails対応中かも @dwin-gharibi が 75 日前に担当しました。 オープンarea/tools
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
docker/docker-agent#3933 ·
メンテナーはふだん 1 日以内に返信
-
`edit_file` silently edits the first match when `oldText` occurs more than once対応中かも @dwin-gharibi が 75 日前に担当しました。 オープンarea/tools
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
docker/docker-agent#3929 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
test(runtime): Claude 5.x lifecycle — compaction, reload, switches, shared clients対応中かも @aheritier が今日担当しました。 オープンarea/providers area/providers/anthropic area/runtime area/sessions area/testing
docker/docker-agent#4654 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
feat(anthropic): Claude 5.x safety defaults (prefix error, temporary fallback block, Mythos 5 on Converse)対応中かも @aheritier が今日担当しました。 オープンarea/config area/providers area/providers/anthropic area/providers/bedrock
docker/docker-agent#4652 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
docker/docker-agent の issue をすべて見る
似ている issue
-
feat
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
ory/hydra-maester#312 · リアクション 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100