Repository navigation
Closed
Labels
plan:donePlanboard status
Description
From the T3 Code Orchestrator V2 comparison (report: reports/T3 Code orchestrator for Solenta.md on branch coder/i-want-you-to-research-t3-codes-orchestr-fae77a). This is item 2 of 4. The rule borrowed from V2: owed work is a persisted row, not an entry in an in-memory Map.
Problem
- Pending crew wake-ups (
orchNotices,electron/runner.js:1170) and machine-turn counts (autoTurns,:1179) live only in memory. - On boot, every
workingthread is marked failed with "Run interrupted: the app crashed or was force-quit mid-run" (electron/store.js:~1426-1460). - Result 1: a lead whose workers were mid-run never learns they died.
- Result 2: a worker that finished just before the crash may never wake its lead.
- The worktrees survive on disk, but nothing points anyone at them.
Build
- Persist the notices. Move
orchNoticesandautoTurnsinto the store (add them to the EMPTY shape inelectron/store.js). Write immediately when a notice is queued rather than waiting for the 250ms debounce; notices are tiny. - Dedupe. Key each notice by worker id + run id, so a replayed finish can't wake the lead twice. V2's rule: "a missed wake is cheaper than a duplicate one".
- Mark interrupted threads. Boot recovery keeps the
failedstatus, so the sidebar and waiting logic don't change, and addsinterruptedBy: "restart". - Tell the lead. For each interrupted
orchWorker, queue a notice to its lead with the worktree, branch, last checkpoint and whether the tree is dirty. - Hold notices after a restart. Don't flush them automatically at boot; V2 holds queued runs until an explicit resume. Show a "Resume crew (N updates)" control on the lead that calls
flushOrchNotices(runner.js:1360). Keep the existing budget and auto-turn gates. - Skip the rest of V2's outbox. No generic effect outbox, leases or retry worker: Solenta is one process, and wake-ups are the only owed work it currently loses.
Tests
- Restart while a worker is mid-run: the lead gets an interrupted-worker notice after the user resumes, and only then.
- A worker that finishes before the crash still wakes its lead after restart.
- No duplicate notice when the same finish is processed twice.
Size: M. Related: #182 (crash-resume for multi-phase workflows). The replay harness issue (item 4) makes the restart test realistic.
Metadata
Metadata
Assignees
Labels
plan:donePlanboard status
Activity
currentbits commentedon Oct 4, 2026
A code-level pass produced a design for this issue. Full detail:
reports/T3 Code orchestrator deep dive.mdon branchcoder/i-want-you-to-research-t3-codes-orchestr-fae77a. Size unchanged: M, about 450–550 lines including tests (3–4 days).Corrections to the issue body
store.js:1413-1461). A clean quit marks themidlethroughstopAll(runner.js:9074-9121), and neither path tells the lead. So both paths must enqueue an "interrupted" record.saveNowis a synchronous write of the whole envelope, and transcripts already use the debounce.interruptedBy.lastErroralready says what happened.Record contract
Commit this before forking workers, because #1427 extends it.
Key the dedupe on
(worker, runId), never onworkeralone. T3's #13490/#13331 show what happens when a child's follow-up runs can't wake the parent.Design
store.js):EMPTY(78-104), to the reset literal (4125-4141) and to the load whitelist next totasksByCrew(2451-2456).normalizeNoticessetsheld:trueon everything loaded from disk.*ByThreadsuffix gets cleanup indeleteThreadfor free.recoverInterruptedRunsappends a heldinterruptedrecord to each recovered orchWorker's lead.enqueueNoticededupes by id and goes through the store.flushOrchNoticesreturns early when any record isheld.stopAllenqueuescause:"quit"records.resumeCrew({threadId}): clears held, flushes, pushes, and returns{released}. The budget gate and 25-turn cap are unchanged, and the wake turn staysfromNotice, so the lead still can't land work on it.heldNoticesonThreadDetail, notThreadInfo(listThreadscaches rows by identity).runs.resumeCrewlikeresumeQuotaWait:ipcChannels.ts:182, thensync-ipc-preload.js,ipc.ts,ipc.js:1538,useCoder, and thedevCoderstub.ThreadView.tsx:8346-8385): "Solenta restarted while this crew was working — N updates are waiting" with a Resume crew (N) button. Reusestyles.retryBtn; no new.module.css.Tests
deleteThreadcleans up.CODER_SIMULATE):stopAlland a reload;resumeCrewstarts afromNoticerun;npx vite buildand typecheck.Order: land #1428's harness and the I3 one-line fix from #1425 first. #1427 builds on the record shape above.
Durable crew notices and consent-gated resume after restart (#1426)
Make crew notices durable across restarts, held for an explicit Resume (
currentbits commentedon Oct 13, 2026
Landed from Solenta thread "P1: Durable crew notices and honest restart recovery with co" (PR #1613). Closed on merge.
Durable crew notices and consent-gated resume after restart (#1426)