Skip to content

fix(tui): show execution failures in the viewed session - #46968

Open
kitlangton wants to merge 1 commit into
v2from
execution-toast
Open

fix(tui): show execution failures in the viewed session#46968
kitlangton wants to merge 1 commit into
v2from
execution-toast

Conversation

@kitlangton

@kitlangton kitlangton commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Why

A session can fail before the first model request and before an assistant message exists. The TUI receives session.execution.failed, but only plays a sound or sends a desktop notification when blurred. A user looking at the focused terminal gets no error explanation.

What Changes

The currently viewed session now shows the execution event's error message in a nonblocking Session failed toast. This works without an assistant message and leaves the composer and draft in place.

Event In-app behavior
Viewed session fails Show its failure message
Different session fails, or home is open Keep existing attention behavior, no unrelated toast
Duplicate terminal failure Do not repeat the notification
A new execution starts and fails Show the new failure

This uses the existing terminal-event tracking and toast component, with four production lines added. It neither fabricates an assistant message nor infers that the working directory is missing.

Demo

execution-toast-comparison.mp4

Before efefd90443; after e790e81dfc. One identical OpenCode Drive script runs the production TUI at 100×30, with an intentionally unavailable fictional model (fixture/unavailable) and an isolated project/server. The real execution fails before any model call; both runs assert zero LLM requests and zero assistant messages. The prompt is submitted through the real API while the visible composer contains a separate draft.

The matched, unscaled four-second clips start at the failure checkpoint. Both continue typing intact; only the changed TUI shows the error. No live service, user configuration, real provider, or real model is involved. Drive 2.0.1 source f6a3f55; no acceleration.

Scope

This is live presentation for the viewed session, including pre-model failures. All viewed execution failures get the toast, even when another error is already visible in the transcript. The default toast lifetime is unchanged; this does not reconstruct past errors after reopening a session.

Independent of #46967, which adds plugin/operation attribution for deferred skill failures. No dependency on or changes to #46961's location/catalog recovery UI, and no move recommendation or automatic retry.

Verification

# packages/tui
bun run test test/cli/cmd/tui/notifications.test.ts test/app-lifecycle.test.tsx -t 'execution failure'
bun run test test/cli/cmd/tui/notifications.test.ts test/app-lifecycle.test.tsx
bun run test test/cli/cmd/tui/notifications.test.ts test/app-lifecycle.test.tsx -t 'execution failure|other sessions' --rerun-each 5
bun run test
bun typecheck

# worktree, same untracked local script against each revision
OPENCODE_UNDER_TEST=/path/to/base DEMO_LABEL=BEFORE bun /path/to/opencode-drive/packages/drive/src/cli/index.ts run .drive-output/execution-toast.ts
OPENCODE_UNDER_TEST=/path/to/change DEMO_LABEL=AFTER bun /path/to/opencode-drive/packages/drive/src/cli/index.ts run .drive-output/execution-toast.ts
bun .drive-output/export-toast.ts

# normal pre-push hook enabled
git diff --check
git push -u origin execution-toast
  • Red on base: the notification regression and both 100/44-column real-component tests fail because no toast appears. Green: 33 focused tests passed, plus 25 repeated cases passed.
  • The real-component tests receive an attributed synthetic plugin failure through SSE, verify its plugin/operation text, and continue editing the existing draft at both widths.
  • Package typecheck and all 33 normal pre-push typecheck tasks passed. The simplify pass found no additional cleanup worth folding into this slice.
  • Full TUI suite: 1,180 passed, 4 skipped, zero failures, two snapshots. GitHub CI is green, including Linux and Windows unit jobs and typechecking.

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.

1 participant