Uh oh!
There was an error while loading. Please reload this page.
fix: treat "other" as a continue stop reason - #20467
Conversation
The following comment was made by an LLM, it may be inaccurate: Potential Related PRs Found:
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
df65986 to
bf4dbc9Compare5d6eef9 to
49cc60eCompareThanks for updating your PR! It now meets our contributing guidelines. 👍 |
8c1272b to
36d92e3Comparea060a89 to
4e4878bComparekkugot
commented
Apr 13, 2026
I am keeping this branch up-to date with dev, would be thankful if this can be merged. engineers using Oracle Code Assist could not use opencode with Open AI models with responses API because of this bug. This is since version 1.3.4 |
rekram1-node
commented
Apr 13, 2026
@kkugot let me look over this |
Uh oh!
There was an error while loading. Please reload this page.
rekram1-node
commented
Apr 13, 2026
Im not sure this is accurate |
cb401dc to
c2caf33CompareUh oh!
There was an error while loading. Please reload this page.
6ea89bd to
d0971aaComparekkugot
commented
Apr 18, 2026
Ready for your review |
rekram1-node
commented
Apr 19, 2026
Alr thanks, ill double check this logic tmr I just need to make sure failure cases dont infinitely loop from this (its almost 1am here rn so too late for me to merge if im not 100% confident) |
kkugot
commented
Apr 21, 2026
@rekram1-node no pressure here, if I can help with tesing this - let me know. |
03c4e62 to
8dc2a25Comparekkugot
commented
Apr 25, 2026
@rekram1-node I have checked with the recent code changes on dev and we are able to reproduce this issue only when any of the MCPs are enabled. With the proposed fix everything works correctly. |
pedantilva
commented
Apr 28, 2026
Hi @rekram1-node any idea when this will be merged? This is driving people out of OpenCode tool due to this issue. |
8dc2a25 to
f54a21bComparerekram1-node
commented
May 4, 2026
/review |
Uh oh!
There was an error while loading. Please reload this page.
f54a21b to
1d793dcCompareThe v6 upgrade changed the default unmapped finish reason from "unknown" to "other", but the prompt loop continue sets were not updated to match. This caused premature loop exit after MCP tool calls, before the model produced final assistant text. Fixesanomalyco#20050Fixesanomalyco#20465
43b7797 to
32d5a37Comparerekram1-node
commented
May 8, 2026
This was tested and works? Im just noticing that the only test seems to assert other as a stop reason to stop rather than continue which i would have assumed was not ur intent? |
kkugot
commented
May 16, 2026
Our provider emits OpenAI Responses-style structural completion events, but not enough SDK-friendly finish classification for opencode’s current parser. OpenAI Responses itself does not require finish_reason; the client must derive a finish classification from the event stream. The change in this PR works because it treats the unmapped completed function-call step as "other" instead of leaving it undefined. |
kkugot
commented
May 16, 2026
To the OCA users of opencode: |
Issue for this PR
Closes#20465
Type of change
What does this PR do?
Fixes blank assistant text in TUI when MCP servers are enabled, a regression introduced in v1.3.4 by the AI SDK 5 -> 6 upgrade.
Root cause: The v6 finish-reason adapter changed the default unmapped reason from
unknowntoother. The prompt loop continue sets inprompt.tshadunknownremoved butotherwas never added as a replacement. This causes the loop to exit after MCP tool calls before the model produces final text. MCP amplifies this because tool-enabled requests hit this code path far more often.Additional fix: The TUI
AssistantMessagecomponent rendered empty space for intermediate assistant messages whose parts were all hidden (completed tools with details off, empty text). Added a reactivevisiblememo that hides the entire message when no parts would render.How did you verify your code works?
bun typecheck— no new errors (only pre-existing ripgrep.ts errors on dev)Checklist