ai-anthropic: 400 on signed thinking blocks after compaction rewrites history (missing block_binding drop_block)
维护者通常 1 天内回复
评估
这个 Issue 还没有评估数据。
描述
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.
- 主要语言
- TypeScript
- 星标
- 3.3k
- 派生
- 378
- 平均合并
- 1 天 2 小时
- 30 天内合并 PR
- 248
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TanStack/ai 的其他 Issue
-
openai-base: a Responses max_output_tokens cutoff ends as RUN_ERROR without usage instead of finishReason 'length'可能已有人在做 @tombeckenham 于 7 天前认领。 未关闭has-pr waiting-on: maintainer
难度 2/5 1-3 小时 新手友好度 74/100
TanStack/ai#1916 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
feat(ai): speechSession() for streaming text-to-speech over a live socket可能已有人在做 @AlemTuzlak 今天认领。 未关闭enhancement waiting-on: maintainer
维护者通常 1 天内回复
-
Reconnecting to a durable sandbox run during a long tool call delivers the rest of the run twice可能已有人在做 @tombeckenham 今天认领。 未关闭waiting-on: maintainer
维护者通常 1 天内回复
-
withSandbox fails with "never called provide()" when the sandbox has no workspace可能已有人在做 @tombeckenham 今天认领。 未关闭has-pr waiting-on: maintainer
维护者通常 1 天内回复
-
ai-claude-code and ai-sandbox: add "sideEffects": false so translateSdkStream tree-shakes可能已有人在做 @tombeckenham 于 1 天前认领。 未关闭waiting-on: maintainer
维护者通常 1 天内回复
相似的 Issue
-
unwrapDatabaseError masks real DB errors with TypeError: Cannot convert object to primitive value未关闭
难度 2/5 1-3 小时 新手友好度 74/100
NEARBuilders/everything-dev#798 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
vercel-labs/durable-harness#53 ·
维护者通常 1 天内回复
-
[Bug]: Redesign tab bars ignore clicks on Linux: hidden chat layers keep window drag regions可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
experiência: a doc manda subir para o Micro do Supabase, mas não diz que exige plano pago nem quanto custa可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭area/docs area/ui enhancement
难度 1/5 1-3 小时 新手友好度 88/100
melgarafael/DeskcommCRM#4098 ·
维护者通常 1 天内回复
-
dependencies platform: ios
难度 1/5 1-3 小时 新手友好度 78/100
software-mansion/react-native-executorch#1617 ·
维护者通常 1 天内回复