Skip to content

A stopped worker is indistinguishable from a fork that never ran; Waiting-on under-reports #183

Closed

Description

@currentbits

Problem

A worker thread STOPPED mid-run is indistinguishable from a fork that never ran: buildWaitStates (src/waiting.ts:17-19) only counts children with status === "working"; a stopped worker has runStartedAt cleared and reads idle, so the parent's "Waiting on N" silently under-reports. The ponytail in that file already names the fix (a stopped flag).

Impact

The wait-state surface exists precisely to make hung fan-outs visible (#42); this hole reintroduces an invisible stall for the stop-mid-run case.

Fix direction

Record a stoppedAt/stopped marker on the thread when a run is stopped mid-flight and count it in the parent's wait state with its own label ("1 stopped").

Activity

  1. added
    bug
    plan:todo
    on Aug 16, 2026
  2. currentbits commented on Aug 17, 2026

    @currentbits
    OwnerAuthor

    Deep-dive detail (T3 PRs #5219/#4378): subagent fleet semantics — attribute tool calls via parentToolUseId, keep subagent narration out of the parent transcript, Stop kills the whole fleet, and a distinct Waiting state for 'root turn settled but background work still running' (mobile hides Stop in that state).

  3. added
    plan:doing
    plan:done
    and removed
    plan:todo
    plan:doing
    on Aug 25, 2026
  4. currentbits commented on Aug 25, 2026

    @currentbits
    OwnerAuthor

    Implemented on branch coder/a-stopped-worker-is-indistinguishable-fr-239c4d:

    • stoppedAt stamped on the thread in stopRun (electron/runner.js) — the single funnel for user stops (IPC + MCP thread_stop) — and in stopAll for app-quit interruptions (verified nothing resumes those runs on boot, so they stall invisibly the same way). Cleared on every run-start path.
    • Persisted in store normalization, mirrored onto thread summaries and the dev provider; typed in src/shared/ipc.ts.
    • buildWaitStates (src/waiting.ts) counts a stopped child under its own stopped state; label gains · N stopped, tooltip calls out — stopped mid-run. A working worker with a stale stamp still counts as working.
    • Tests: renderer waiting suites, runner stamp lifecycle (set/clear/idle-stop/quit+reload), summary mirror, store round-trip fixture. Renderer + electron suites green except pre-existing failures unrelated to this diff (MCP import twins — also red on main CI).
  5. added
    plan:doing
    plan:done
    and removed
    plan:done
    plan:doing
    on Oct 3, 2026
  6. currentbits commented on Oct 3, 2026

    @currentbits
    OwnerAuthor

    Landed on main via 2a5a091 "Merge worktree coder/a-stopped-worker-is-indistinguishable-fr-239c4d", the branch named in the implementation comment above. The issue was left open with plan:done; closing during the 2026-10-03 board cleanup.

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

    bugplan:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions