ai-anthropic: 400 on signed thinking blocks after compaction rewrites history (missing block_binding drop_block)
Maintainer thường phản hồi trong vòng 1 ngày
@tombeckenham đang làm issue này rồi.
Từ ngày 31/10/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
What happens
With @tanstack/ai-anthropic 1.0.0, @tanstack/ai-harness 0.1.1 and withCompaction (summarizeOldest), the first model call after a compaction fails with a 400 from Anthropic (Claude Sonnet 5.5, reasoning: 'medium'):
messages.1.content.1: Invalid `signature` in `thinking` block. The block is bound to a different conversation. Remove the block, or set `thinking.block_binding.prefix_mismatch_behavior` to "drop_block". That setting requires the `thinking-binding-controls-2026-08-01` value in ...
Compaction replaces the earlier messages with a summary, so the signed thinking blocks of the kept turns no longer match the conversation prefix they were bound to.
Expected
The adapter sends thinking.block_binding: { prefix_mismatch_behavior: "drop_block" } with the thinking-binding-controls-2026-08-01 beta whenever thinking is on (pi-ai does this), or drops thinking blocks before the rewritten prefix itself.
Workaround
A custom fetch on anthropicText(model, { fetch, midConversationChannels: true }) that adds the field and the beta header. With it, the same 5-question run with compaction completes. (Passing fetch turns midConversationChannels off, so it has to be set back on.)
Where
packages/ai-anthropic/src/text/reasoning.ts builds thinking without block_binding; checked on main at 3ce3085.
- Ngôn ngữ chính
- TypeScript
- Star
- 3.3k
- Fork
- 378
- Merge trung bình
- 1 ngày 1 phút
- Pull request đã merge (30 ngày)
- 208
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọ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 TanStack/ai
-
openai-base: a Responses max_output_tokens cutoff ends as RUN_ERROR without usage instead of finishReason 'length'Có thể đã có người làm @tombeckenham đã nhận 4 ngày trước. Đang mởhas-pr waiting-on: maintainer
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
TanStack/ai#1916 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
openai-base: leaving a Responses stream at `response.completed` aborts its request, so complete calls are logged as client-closed (499)Có thể đã có người làm @AlemTuzlak đã nhận hôm nay. Đang mởhas-pr waiting-on: maintainer
TanStack/ai#1965 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
StreamProcessor folds long text and tool-call streams in quadratic memory and timeCó thể đã có người làm @jherr đã nhận 1 ngày trước. Đang mởwaiting-on: maintainer
TanStack/ai#1963 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-harness: view.dispose() doesn't cancel snapshot, transcript or describe requestsCó thể đã có người làm @AlemTuzlak đã nhận 2 ngày trước. Đang mởneeds-repro waiting-on: maintainer
TanStack/ai#1960 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Chat UI: a fallback widget for tool calls whose names aren't known when the kit is createdCó thể đã có người làm @AlemTuzlak đã nhận 3 ngày trước. Đang mởwaiting-on: maintainer
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 58/100
TanStack/ai#1953 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Remove unused dependenciesCó thể đã có người làm @alastair-smith đã nhận hôm nay. Đang mởchore other
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
alastair-smith/card-games#384 ·
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 62/100
code-yeongyu/senpi#5571 ·
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 78/100
nexu-io/open-design#9262 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
friction
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
kentcdodds/kody#4753 ·
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
lingdojo/kana-dojo#33508 · 1 bình luận · 5 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày