diff --git a/packages/ai/CHANGELOG.md b/packages/ai/CHANGELOG.md index de343972e..46465b66f 100644 --- a/packages/ai/CHANGELOG.md +++ b/packages/ai/CHANGELOG.md @@ -27,6 +27,7 @@ - Fixed Mistral GLM models producing empty text blocks and split thinking blocks from empty content deltas, which could make later requests fail with "Expected at most one leading ThinkChunk" ([#9674](https://github.com/earendil-works/pi/issues/9674)). - Fixed OpenAI Fast mode requests being priced at the standard rate when the response reports `service_tier: "fast"`, as GPT-6 models do ([#10034](https://github.com/earendil-works/pi/issues/10034)). - Fixed Mistral reasoning models ignoring the requested thinking level: GLM 5.3 now uses `reasoning_effort` instead of `prompt_mode`, GLM 5.2 accepts `max`, and Mistral models only offer the effort levels the API supports ([#9678](https://github.com/earendil-works/pi/issues/9678)). +- Fixed OpenCode Zen and OpenCode Go `qwen3.8-flash` thinking being replayed as plain text on later turns because the endpoint returns empty thinking signatures ([#10047](https://github.com/earendil-works/pi/issues/10047)). ## [0.87.1] - 2026-09-22 diff --git a/packages/ai/scripts/generate-models.ts b/packages/ai/scripts/generate-models.ts index d391d2931..96300189e 100644 --- a/packages/ai/scripts/generate-models.ts +++ b/packages/ai/scripts/generate-models.ts @@ -1212,6 +1212,10 @@ function getAnthropicMessagesCompat(provider: string, modelId: string): Anthropi if (provider === "xiaomi" || provider.startsWith("xiaomi-token-plan-")) { compat.allowEmptySignature = true; } + // OpenCode Qwen 3.8 Flash emits and accepts thinking blocks with empty signatures. + if ((provider === "opencode" || provider === "opencode-go") && modelId === "qwen3.8-flash") { + compat.allowEmptySignature = true; + } return Object.keys(compat).length > 0 ? compat : undefined; }