Skip to content

fix: resolve duplicate model messages and mixed thinking text for OpenCode#385

Merged
alari76 merged 1 commit intomainfrom
fix/opencode-model-and-thinking
Apr 12, 2026
Merged

fix: resolve duplicate model messages and mixed thinking text for OpenCode#385
alari76 merged 1 commit intomainfrom
fix/opencode-model-and-thinking

Conversation

@alari76
Copy link
Copy Markdown
Contributor

@alari76 alari76 commented Apr 12, 2026

Summary

  • Duplicate model messages: Pass the current model from localStorage when creating OpenCode sessions, so the server starts with the correct model immediately instead of showing "opencode (default)" first then the actual model after the frontend's validation effect fires
  • Thinking mixed with text: Strip <think>...</think> tags from text output for models like Kimi that embed chain-of-thought reasoning in the text stream rather than using a separate reasoning field — think content is routed to the thinking summary indicator instead

Test plan

  • Create a new OpenCode session with a previously-used non-default model (e.g. kimi-k2.5) — verify only one model message appears
  • Send a message to Kimi and verify thinking content is not mixed into the response text
  • Verify models without <think> tags (e.g. Claude via OpenCode) still work normally
  • Run npm test — all 1591 tests pass
  • Run tsc -b — no type errors

🤖 Generated with Claude Code

…nCode sessions

Pass the current model when creating OpenCode sessions so the server starts
with the correct model immediately, instead of showing "opencode (default)"
followed by the actual model after the frontend's validation effect fires.

Strip <think>...</think> tags from text output for models like Kimi that embed
chain-of-thought reasoning in the text stream rather than using a separate
reasoning field. Think content is routed to the thinking summary indicator.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@alari76 alari76 force-pushed the fix/opencode-model-and-thinking branch from 46d8a11 to 0540611 Compare April 12, 2026 16:00
@alari76 alari76 merged commit 82c0824 into main Apr 12, 2026
@alari76 alari76 deleted the fix/opencode-model-and-thinking branch April 12, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant