Skip to content

fix(tui): show execution failures that happen before any step - #60079

Merged
rekram1-node merged 1 commit into
devfrom
execution-failure-transcript
Oct 29, 2026
Merged

rekram1-node merged 1 commit into
devfrom
execution-failure-transcript

Conversation

@rekram1-node

@rekram1-node rekram1-node commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

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's ExecutionError view never gets a row.

Change

reduceSessionRows now 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.5

The 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:

on idle marker
  if it has an error and it differs from the last step/compaction error
    add a row for it
  forget the last error

A different error still shows. For example, a manual /compact that failed, followed by a run that failed for another reason, shows both.

Out of scope

  • The "Session failed" toast stays as is.
  • Desktop keeps its own rule, which skips the error after any failed step.

Verification

  • bun test test/cli/tui in packages/tui: 428 pass, including 4 new cases in session-rows.test.ts (failure before any step, same error not repeated, different error shown, unsent prompt and resync order)
  • bun typecheck in packages/tui: clean
  • Ran the issue's repro script against this branch in a live TUI: the error stays in the transcript after the toast fades

Visual

<svg xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72" fill="none">
  <style>
    .err { animation: show 4s ease-out infinite; }
    @keyframes show { 0%, 25% { opacity: 0; transform: translateY(4px); } 40%, 100% { opacity: 1; transform: none; } }
    @media (prefers-reduced-motion: reduce) { .err { animation: none; } }
  </style>
  <rect x="8" y="8" width="224" height="24" rx="3" fill="currentColor" opacity="0.08"/>
  <rect x="8" y="8" width="2" height="24" fill="currentColor" opacity="0.5"/>
  <rect x="20" y="17" width="120" height="6" rx="3" fill="currentColor" opacity="0.55"/>
  <g class="err">
    <circle cx="24" cy="50" r="5" stroke="currentColor" stroke-width="1.5" opacity="0.8"/>
    <path d="M24 47v3.5M24 52.5v.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" opacity="0.8"/>
    <rect x="36" y="47" width="150" height="6" rx="3" fill="currentColor" opacity="0.7"/>
  </g>
</svg>

Added by the opencode bot (AI-generated).

Related: #59177

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Before

After

@rekram1-node
rekram1-node merged commit 6a0acd1 into dev Oct 29, 2026
16 checks passed
@rekram1-node
rekram1-node deleted the execution-failure-transcript branch October 29, 2026 02:21
@amrkmn amrkmn mentioned this pull request Oct 29, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

V2: pre-runner errors are not surfaced as assistant message failures

1 participant