Skip to content

Runner split steps 2–5: ask/btw, turn setup, subagents, session recording (#1447, stacked on #1456) - #1458

Merged
currentbits merged 4 commits into
mainfrom
coder/runner-split-steps-2-5-dfc14a
Oct 5, 2026
Merged

currentbits merged 4 commits into
mainfrom
coder/runner-split-steps-2-5-dfc14a

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Round 3, steps 2–5 of the createRunner split (#1447), following docs/superpowers/specs/2026-10-04-runner-split-design.md and the seam convention from step 1 (header of electron/runner-watchdogs.js).

Stacked on #1456, which is stacked on #1454. Merge order: #1454 → #1456 → this.

One commit per seam; the full electron suite passed after each.

Seam Module Lines Owns
2. Ask runs + /btw runner-ask-runs.js 445 btwActive; stopAllBtw() for stopAll
3. Worktree setup + orchestration commands runner-turn-setup.js 231 — (calls startRun through ctx at call time)
4. Subagent rows runner-subagents.js 169 SUBAGENT_ROWS_MAX
5. Session recording runner-session-recording.js 112 sessionRecorder

runner.js: 9,120 → 8,345 lines.

Checked

  • Pure move, ignoring indentation: the only non-move lines are the four create<Seam>(ctx) factories with their const {…} = ctx destructures, the four factory calls, stopAllBtw(), and one startRun: ctx.startRun. That last one is read inside an async call, so the lookup still happens at call time.
  • stopAllBtw() is the exact loop stopAll used to run inline over btwActive.
  • ctx gained: userDataPath, askComplete, searchMemory, bootstrapMemory, otel, isReplayTurn, tryReadCodeIndex, clearRun, markRunFailed, finishSuccessfulTurn, pushFn, shortError, providerBinAvailable, startRun and getMemStatus. All are opts bindings or hoisted function declarations, so they exist when the factories run.
  • Construction order: every factory call sits before the boot crew sweep and refreshAllQuotaWaits(), so nothing calls a moved function before it's bound.
  • Unchanged: createRunner's return object and module.exports.
  • Tests: full electron suite (CI-like env) passes 4109/4109; npm run typecheck is clean.

Next: seam 6 (Claude keep-alive), once the safety tests in #1457 are on main.

🤖 Generated with Claude Code

Willem and others added 4 commits October 4, 2026 20:53
Seam 2 of the createRunner split. startAskRun, startBtw, cancelBtw,
promoteBtw and listActiveBtwCount move verbatim behind a ctx destructure;
the module owns btwActive and hands stopAll a stopAllBtw() that runs the
same kill-and-clear loop at the same point. ctx gains the Ask seams
(askComplete, searchMemory, bootstrapMemory), userDataPath, otel,
isReplayTurn, tryReadCodeIndex, clearRun, markRunFailed and
finishSuccessfulTurn. The return object and module.exports are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n-setup.js (#1447)

Seam 3 of the createRunner split. materializePendingWorktree,
failWorktreeSetup and dispatchOrchCommand move verbatim behind a ctx
destructure. The one body edit: dispatchOrchCommand hands
startWithPoolFailover `startRun: ctx.startRun`, read at call time, since
startRun stays in runner.js. ctx gains pushFn, shortError,
providerBinAvailable and startRun. The return object and module.exports
are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Seam 4 of the createRunner split. SUBAGENT_ROWS_MAX and the seven
subagent-row functions (subagentRows … finishRunningSubagents) move
verbatim behind a ctx destructure. The five that the rest of createRunner
calls keep their names via the factory's return value. ctx gains nothing:
the seam needs only store, pushDetail and pushThreadsChanged. The return
object and module.exports are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…js (#1447)

Seam 5 of the createRunner split. The sessionRecorder construction,
sessionBaseFields, recordSessionOnAppend and recordSessionAtTerminal move
verbatim behind a ctx destructure. The factory returns the recorder, so
stopAll and flushTranscripts flush it unchanged, and appendMessage /
notifyRunTerminal call the record functions at the same points. The
recorder is now built with the other seam factories, before the boot
crew sweep; nothing between its old line and there could record. ctx
gains getMemStatus. The return object and module.exports are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@currentbits
currentbits changed the base branch from coder/runner-split-step-1-ctx-watchdogs-39333f to main October 5, 2026 11:02
@currentbits
currentbits merged commit c9e01ba into main Oct 5, 2026
6 checks passed
currentbits added a commit that referenced this pull request Oct 5, 2026
…10-047408

Runner split seams 6–10: claude sessions, verify gate, quota, notices, permissions (#1447, stacked on #1458)
@currentbits
currentbits deleted the coder/runner-split-steps-2-5-dfc14a branch October 5, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant