You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
<think> tags in plain string content are displayed as raw text instead of being stripped or collapsed #21515
When using models that return thinking content as inline tags in a plain string content field ( via OpenAI-compatible API), opencode renders the raw tags and thinking content directly to the user: { "role": "assistant", "content": "<think>用户用中文说\"你好\",这是一个简单的问候。我应该用中文友好地回复。\n</think>\n\n你好!有什么我可以帮助你的吗?" }
Expected: Only show 你好!有什么我可以帮助你的吗? — the thinking content should be stripped or collapsed into a reasoning block.
Actual: The entire string including ... is displayed as plain text.
Context
This is related to #11439 and #18748. Many OpenAI-compatible providers use inline tags rather than structured reasoning_content fields. OpenCode should handle both formats.
Suggested Approach
At the rendering layer, parse , , tags and either:
Strip thinking content entirely, or
Display it as a collapsible reasoning block (consistent with native reasoning_content handling)
Preserve raw tags in storage so multi-turn LLM context is not broken (as noted in #11439)
Handle edge cases: unclosed tags during streaming, tags inside code blocks should be left alone
These issues cover the same core problem of handling inline <think> tags from OpenAI-compatible providers. Consider adding your context (especially the plain string content format and the Windows repro) as a comment on #11439 instead.
Activity
github-actions commentedon Apr 8, 2026
This issue might be a duplicate of existing issues. Please check:
<think>and<thinking>tags as reasoning blocks #11439: Directly related — "Support parsing<think>and<thinking>tags as reasoning blocks"<think></think>HTML mark)"These issues cover the same core problem of handling inline
<think>tags from OpenAI-compatible providers. Consider adding your context (especially the plain string content format and the Windows repro) as a comment on #11439 instead.github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.