| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…ature: "" Our upstream never emits an Anthropic thinking signature, so the proxy sent signature: "" (and an empty signature_delta). Strict clients (e.g. Grok Build's messages backend) reject an empty-string signature as invalid. Omit the field when there's no real signature; forward it verbatim when upstream provides one. - src/handlers/messages.js: non-stream openAIToAnthropic omits signature unless reasoning_signature is present; AnthropicStreamTranslator only emits signature_delta when a real delta.reasoning_signature arrived - test/messages.test.js: assert the field/delta is absent without a real signature; real-signature round-trip preserved
|
已合并,谢谢 🙏 这条改得对,而且原来的注释其实自己就埋了线索 —— 它写着空串是 "Foxfishc-verified safe fallback",但那个验证只覆盖了当时那个客户端。signature: "" 在 Anthropic spec 里本来就不是一个合法值,严格客户端按 spec 校验就会拒,所以"缺失时省略字段"比"填一个占位符"更符合协议本意。 流式那半修得尤其对:原来是无条件发 signature_delta,现在改成只在真有 reasoning_signature 时才发。测试也跟着从"必有一个空串 signature_delta"改成"无真实签名时不发",同时保留了 thinking_delta 与 content_block_stop 的顺序断言 —— 该松的松、该守的守,没有顺手把顺序保证一起删掉,这个分寸是对的。 上游将来真给 signature 仍原样透传,前向兼容没丢。 已加入致谢名单,评级 B+。 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
中文 TL;DR
上游从不产出 Anthropic thinking signature,代理原来发 signature:"",严格客户端
(如 Grok Build 的 messages 后端)会判为非法。改为无真实签名时省略该字段;上游给了
真实签名则原样转发。
Summary
signature: "" on an Anthropic thinking block is a proxy-synthesized placeholder,
not a real Anthropic signature (our upstream never emits one). Some strict clients
reject the empty string as invalid. Omit the field when there's no real signature;
forward a real one verbatim when upstream provides it (forward-compat).
Fix
unless reasoning_signature is present.
delta.reasoning_signature arrived (drop the empty-string fallback).
Test plan
(non-stream + streamed); real-signature round-trip preserved
Branch is on current master (v3.5.0), applies cleanly.