feat(provider): exact signed-thinking capture, persistence and replay (incl. Bedrock)
Maintainer thường phản hồi trong vòng 1 ngày
@aheritier đang làm issue này rồi.
Từ ngày 19/10/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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
- Ngôn ngữ chính
- Go
- Star
- 4.6k
- Fork
- 522
- Merge trung bình
- 8 giờ 43 phút
- Pull request đã merge (30 ngày)
- 239
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của docker/docker-agent
-
Error when trying to run sandbox example?Có thể đã có người làm @dgageot đã nhận 1 ngày trước. Đang mởarea/cli
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
docker/docker-agent#4672 · 1 bình luận · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
pkg/hooks tests fail with a misleading assertion when jq is not installedCó thể đã có người làm @dwin-gharibi đã nhận 58 ngày trước. Đang mởarea/testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
docker/docker-agent#4052 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`remove_directory` and `create_directory` hide work they already did when a later path failsCó thể đã có người làm @dwin-gharibi đã nhận 77 ngày trước. Đang mởarea/tools
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
docker/docker-agent#3933 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`edit_file` silently edits the first match when `oldText` occurs more than onceCó thể đã có người làm @dwin-gharibi đã nhận 77 ngày trước. Đang mởarea/tools
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
docker/docker-agent#3929 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Flaky test] TestA2AServer_MultipleRequestsCó thể đã có người làm @aheritier đã nhận 1 ngày trước. Đang mởarea/a2a area/testing flaky-test
docker/docker-agent#4687 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của docker/docker-agent
Issue tương tự
-
native
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
prime-radiant-inc/evener#4839 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
521xueweihan/HelloGitHub#4073 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
goharbor/terraform-provider-harbor#655 · 1 bình luận ·
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
syncthing/syncthing#10935 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày