Skip to content

v0.27.9

Latest

Choose a tag to compare

@Verlintas Verlintas released this 21 Nov 11:34

v0.27.9 — 厂商状态完整回放:Gemini thought signature、Anthropic thinking blocks

修复:Gemini 3 多轮工具调用 400(thought_signature)

Gemini 3 要求把上一轮 functionCall 上的 thoughtSignature 原样回传,旧版本丢弃后第二次工具调用即 400。

  • ToolCall 持久化 thoughtSignature,回放时写回 functionCall part
  • 签名出现在前置 thought/text part 时缓存并附加给下一个调用
  • 并行调用只有第一个携带签名(按官方规则)
  • 旧历史/跨服务商历史没有签名时,第一个调用使用官方约定的 skip_thought_signature_validator
  • 同时保留 Gemini 3 的 functionCall.id / functionResponse.id,同名并行调用更稳
  • 修复结束标记位于无 parts 的 chunk 时误报「流意外中断」

修复:Anthropic thinking blocks 被压成一个字符串

Anthropic 的 thinking 签名通过 signature_delta 下发,旧代码根本没有解析;而且一条 assistant 消息只存一份 thinking 文本 + 一个签名。多块或 redacted_thinking 会被拒(thinking blocks cannot be modified)。

  • 新增 List<ThinkingBlock>,按原始顺序保存每个 thinking / redacted_thinking block
  • 解析 signature_delta,支持 display: omitted(空文本 + 签名)
  • toWire 逐块原样回放,没有签名的块不会发送
  • DB v11:messages.thinkingBlocksJson(无损迁移)
  • 端到端验证:thinking + tool_use → 工具结果 → 下一次请求带签名通过校验

修复:新模型静默关闭推理

ModelCatalog.entryFor() 之前只做精确匹配,不在目录里的新版本(例如 claude-sonnet-5-5)会退化成「不支持推理」,导致 thinking 完全不启用。

  • 改为精确匹配 + 最长已知前缀匹配:新小版本继承所属家族的推理开关与上下文窗口
  • 补充 Claude 5.5(Opus / Sonnet / Haiku)目录条目

兼容性

  • OpenAI 官方新模型(gpt-5/gpt-6/o*)改用 max_completion_tokens;兼容网关(DeepSeek、Qwen 等)继续使用 max_tokens
  • 工具转录修复:请求前按工具调用顺序重排结果、丢弃孤儿/重复结果(Gemini 并行 functionResponse 按位置匹配)

升级

versionCode 65 / versionName 0.27.9。DB v10 → v11 为无损迁移(新增一列),直接覆盖安装。

SHA-256:

  • full: 34e37d93617259542e2cb77650ffda91848d7def3bd2bf1cb8f9423b706be305
  • lite: 4fb9d035dea46281e26efe8bb4abba54a8e828970fd2ee674b36abec836061c5

v0.27.9 — Exact vendor state replay: Gemini thought signatures + Anthropic thinking blocks

Fix: Gemini 3 multi-turn tool calls returned HTTP 400

Gemini 3 requires the thoughtSignature from a functionCall part to be
replayed unchanged; the old build dropped it and the second tool round in
the same turn failed.

  • Persist thoughtSignature on ToolCall and replay it on the
    function-call part
  • Signatures arriving on a preceding thought/text part are buffered and
    attached to the next call
  • Parallel calls only carry it on the first call (as specified)
  • Unsigned old/cross-provider history uses the documented
    skip_thought_signature_validator sentinel on the first call
  • Preserve Gemini 3 functionCall.id / functionResponse.id for robust
    same-name parallel calls
  • Treat a finishReason chunk without parts as a normal finish instead
    of reporting a broken stream

Fix: Anthropic thinking blocks were collapsed into one string

Anthropic sends a thinking block's signature as signature_delta, which
the old provider never parsed; a message also stored only one thinking
text + one signature. Multi-block and redacted_thinking turns were
rejected with "thinking blocks cannot be modified".

  • Store a List<ThinkingBlock> with each thinking / redacted_thinking
    block in its original order
  • Parse signature_delta; support display: omitted (empty text plus
    signature)
  • Replay every block verbatim; blocks without a signature are skipped
  • DB v11: messages.thinkingBlocksJson (non-destructive migration)
  • End-to-end verified: thinking + tool_use → tool result → the next
    request carries the signature and passes validation

Fix: reasoning silently disabled for new model versions

ModelCatalog.entryFor() used exact matching only, so a minor version not
in the catalog (e.g. claude-sonnet-5-5) fell back to "no reasoning",
disabling thinking entirely.

  • Exact match first, then longest known prefix: new minor versions inherit
    the family's reasoning flag and context window
  • Added Claude 5.5 (Opus / Sonnet / Haiku) catalog entries

Compatibility

  • Official OpenAI models (gpt-5/gpt-6/o*) now use
    max_completion_tokens; compatible gateways (DeepSeek, Qwen, …) keep
    max_tokens
  • Transcript repair now re-orders results by tool-call order and drops
    orphan/duplicate results (Gemini matches parallel responses positionally)

Upgrade

versionCode 65 / versionName 0.27.9. DB v10 → v11 is a non-destructive
migration (one new column); install over the previous version.

SHA-256:

  • full: 34e37d93617259542e2cb77650ffda91848d7def3bd2bf1cb8f9423b706be305
  • lite: 4fb9d035dea46281e26efe8bb4abba54a8e828970fd2ee674b36abec836061c5