Skip to content

A failed thread carries no failure reason; sidebar badge is an unexplained Failed #140

Closed

Description

@currentbits

Problem

ThreadStatus is a bare string union "idle" | "working" | "done" | "failed" (src/shared/ipc.ts:48). The sidebar badge (src/components/Sidebar.tsx:290-295) renders "Failed" with no tooltip or reason; the only place the cause lives is an event card inside the thread transcript.

Impact

After a night of parallel runs, triaging several red threads means opening each one and scrolling to find the event card. "Provider CLI crashed" vs "budget cap hit" vs "permission denied" are very different follow-ups and the UI cannot distinguish them at a glance. Retry itself exists (src/retryTurn.ts); the gap is surfacing the reason.

Fix direction

Store a short lastError on the thread when a run fails, show it as the badge tooltip and in the Agents panel row.

Activity

  1. added
    enhancement
    plan:todo
    plan:doing
    and removed
    plan:todo
    on Aug 16, 2026
  2. currentbits commented on Aug 17, 2026

    @currentbits
    OwnerAuthor

    Dispatched two grok workers on non-overlapping file sets:

    • backend (99f1b9d5): src/shared/ipc.ts field, electron/store.js (clear lastError on any non-failed status change + normalize + boot sweep), electron/runner.js (~12 status: "failed" sites already have errText in scope), electron/orchServer.js (thread_status prefers stored value, keeps the message-scan fallback for old threads), electron/test/.
    • frontend (f85aface): src/components/Sidebar.tsx badge title, src/components/AgentsPanel.tsx facts row, test/.

    Storing rather than deriving: the sidebar reads threads:summaries, which deliberately does not walk transcripts. electron/orchServer.js:296-307 already derives the same reason by scanning messages — that becomes the back-compat fallback.

  3. currentbits commented on Aug 17, 2026

    @currentbits
    OwnerAuthor

    Done. Both halves merged onto coder/use-grok-workers-to-do-this-gh-issue-you-08ef20.

    Backend (5239954)

    • shortError() in electron/runner.js — first 2 lines, 300-char cap — applied at all 14 status: "failed" sites, each of which already had the reason in scope as errText/errLabel/failText.
    • electron/store.js: migrateThread defaults lastError to null; the boot sweep of stranded working threads stamps "Run error: app quit while the run was in flight"; and updateThread clears lastError on any non-failed status change — so a retry cannot carry a stale reason, and no call site has to remember to clear it.
    • electron/orchServer.js: thread_status prefers the stored value, keeps the message scan as fallback for threads that failed before this landed.

    Frontend (69ec45d)

    • Sidebar.tsx: title={thread.lastError ?? undefined} on the Failed badge — native tooltip, no component, no dependency.
    • AgentsPanel.tsx: recap facts line appends the whitespace-collapsed reason; full text is the row title.

    Verification — tsc --noEmit clean; npm test = 38/38 core, 720/720 renderer, 814/815 electron. The single electron failure (wireClient × webBridge → production first backoff is still 1s, 120000 !== 1000) is pre-existing: it reproduces identically on the base commit 1e9f3c2 in a clean worktree, and touches none of the 11 files changed here.

    Not pushed, no PR — branch is local.

  4. added
    plan:done
    and removed
    plan:doing
    on Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementplan:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions