Repository navigation
fix(tui): show execution failures that happen before any step - #60079
Merged
Merged
Conversation
There was a problem hiding this comment.
The fix works. With the #34839 repro script (switch to a model that isn't available, then prompt), the base transcript ends at the user's prompt once the toast fades. With this PR, Error: Model unavailable: opencode/gpt-5.5 stays under the prompt (screenshots below). bun test test/cli/tui passes (428), and tsc -b in packages/tui is clean.
The duplicate check looks right: a step or compaction error that matches the run's error is shown once, a different error gets its own row, and rows keep their stored order, so a prompt the failed run never sent still shows below the error, including after a resync.
Public API is unchanged; only the TUI's row building changes.
No concerns.
Related: #59177
1 task done
1 task
88 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Fixes #34839
Problem
When a run fails before any step starts (an unavailable model, a variant that doesn't exist, instructions that can't load), the TUI shows a "Session failed" toast and then nothing. Once the toast fades, the transcript ends at the user's prompt.
The server already stores the error on the idle marker that ends the run. #53826 rendered it on desktop and in the TUI, but the TUI row change was reverted in #54061. That version moved the error below a prompt the run never sent, and the reordering broke after
/model, after a resync, and for live rows. Without it, the TUI'sExecutionErrorview never gets a row.Change
reduceSessionRowsnow emits a row for a failed idle marker, in its stored position. Nothing is reordered, so a prompt the failed run left unsent still shows below it in its usual pending style.second message, are you there? +Error: Model unavailable: opencode/gpt-5.5The error is skipped only when the turn's last step or compaction already shows the same error (same type and message), so a step failure isn't shown twice:
A different error still shows. For example, a manual
/compactthat failed, followed by a run that failed for another reason, shows both.Out of scope
Verification
bun test test/cli/tuiinpackages/tui: 428 pass, including 4 new cases insession-rows.test.ts(failure before any step, same error not repeated, different error shown, unsent prompt and resync order)bun typecheckinpackages/tui: cleanVisual
Added by the opencode bot (AI-generated).
Related: #59177