Repository navigation
Persist a failure reason on failed threads and surface it in the sidebar and Agents panel - #224
Merged
currentbits merged 4 commits intoAug 17, 2026
Conversation
added 4 commits
August 17, 2026 10:26
Surface ThreadInfo.lastError as a native title on the sidebar Failed badge, and as a truncated recap facts line in the Agents panel, so failed runs can be triaged without opening each thread.
Persist a short failure reason on ThreadInfo so the sidebar can show why a run failed without walking the transcript. updateThread clears it on any non-failed status so a retry cannot keep a stale reason.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
currentbits
deleted the
coder/use-grok-workers-to-do-this-gh-issue-you-08ef20
branch
October 3, 2026 16:07
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.
Closes #140.
Problem
ThreadStatuswas a bare"idle" | "working" | "done" | "failed", so a failed run left the sidebar showing an unexplained Failed badge with no tooltip. The only record of why was an event card buried in the thread transcript. Triaging several red threads after a night of parallel runs meant opening each one and scrolling — even though "provider CLI crashed", "budget cap hit" and "permission denied" call for completely different follow-ups.Deriving the reason on demand was not an option for the sidebar: it feeds off
threads:summaries, which deliberately does not walk transcripts (that was a prior perf fix). So the reason has to be stored.What changed
Store the reason — new
lastError: string | nullonThreadInfo(src/shared/ipc.ts).electron/runner.jsshortError()helper: first 2 lines, capped at 300 chars — tooltip-sized.status: "failed"sites. Each already had the human-readable reason in scope aserrText/errLabel/failText, so this is one added property per site. The large line count is mostly Prettier expanding one-line patch objects onto multiple lines.electron/store.jsupdateThreadclearslastErrorwhenever a patch setsstatusto anything other than"failed". Every status change routes through this one function, so a retry cannot carry a stale reason and no call site has to remember to clear it.migrateThreaddefaults the field tonull, so threads from older stores are stable rather thanundefined."Run error: app quit while the run was in flight"instead of a silentfailed.electron/orchServer.jsthread_statusprefers the storedlastErrorand keeps its existing backwards-scan for aRun errorevent as a fallback, so threads that failed before this change still report a reason.Surface the reason
src/components/Sidebar.tsx—title={thread.lastError ?? undefined}on the Failed badge. A nativetitleis the right tool here; no tooltip component and no new dependency.src/components/AgentsPanel.tsx— the recap facts line appends the whitespace-collapsed reason, with the full text as the rowtitleso a long error cannot break the layout.Tests
electron/test/thread-last-error.test.js— a failed thread keeps itslastError, patching it back toworkingclears it, andthread_statusprefers the stored value over the message scan.test/sidebarFailedBadge.test.tsx— a failed thread renders itslastErroras the badge tooltip.Verification
npm run typecheck(tsc --noEmit) — clean.npm test— 38/38 core, 720/720 renderer, 814/815 electron.The single electron failure is pre-existing and unrelated:
wireClient × webBridgeassertsproduction first backoff is still 1sand gets120000 !== 1000(an unrelated two-minute timer registers first). It reproduces identically on the base commit1e9f3c2in a clean worktree and touches none of the files changed here, so it is left alone rather than folded into this branch.Notes
Built by two agents working in parallel on disjoint file sets —
electron/*andsrc/components/*— which is why the branch has two feature commits. Both added thelastErrorfield declaration tosrc/shared/ipc.tsbyte-identically, so the halves merged without conflict.