Repository navigation
Closed
Description
Problem
A claude-stream run (Claude or Grok) can end with this event in the transcript:
Run error: result subtype error_during_execution
cancelled
That is the raw stream-json result event dumped into the thread. The runner builds it here:
failText = `Run error: result subtype ${ev.subtype || "unknown"}`;
if (errors.length) {
failText += `\n${errors.slice(-3).join("\n")}`;
}(electron/runner.js, the type === "result" path.) subtype !== "success" always marks the thread failed and stores that string as lastError.
Session-lost (No conversation found) already gets a human follow-up line. cancelled does not. stopRun already leaves the thread idle with "Run stopped"; this path does the opposite for the same idea.
Impact
- The user sees adapter jargon (
result subtype …) instead of a reason they can act on. - A CLI-side cancel is treated as a crash: failed badge, Retry turn, lastError tooltip — not a stop.
- Known producer of this exact subtype on Grok: a permission prompt with no channel auto-cancels the first gated tool (issue Grok provider runs fail immediately after first assistant message #3; asking modes are now mapped to
autoinelectron/providers.js). If this still appears, either that mapping missed a mode or some other cancel (MCP, quota, user interrupt that still emitted a result event) is taking this path.
Fix direction
- Map known
errors[]values before falling back to the subtype string.cancelledshould look like a stop (idle + "Run stopped"), not a failure, unless we know it was an unrecoverable tool cancel. - For remaining
error_during_executioncases, surface the CLIerrors[](and stderr tail) as the message; keep the subtype out of user-facing copy. - Distinct from Permission mode picker is a no-op or silent downgrade on grok, kimi, opencode and cursor #177 (permission pill is a no-op on grok/kimi/opencode) and from Grok provider runs fail immediately after first assistant message #3 (Grok died after the first message with no reason at all).
Activity
Merge origin/main into #549
currentbits commentedon Aug 20, 2026
Shipped on main (78fe3bf); verified in the tree. Moving to plan:done.