Skip to content

Runner split seams 6–10: claude sessions, verify gate, quota, notices, permissions (#1447, stacked on #1458) - #1459

Merged
currentbits merged 9 commits into
mainfrom
coder/runner-split-steps-6-10-047408
Oct 5, 2026
Merged

currentbits merged 9 commits into
mainfrom
coder/runner-split-steps-6-10-047408

Conversation

@currentbits

@currentbits currentbits commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Round 3, seams 6–10 of the createRunner split (#1447), following docs/superpowers/specs/2026-10-04-runner-split-design.md and the seam convention in electron/runner-watchdogs.js.

Stacked on #1458, which is stacked on #1456 and #1454. The base of this branch also carries the three safety-test commits from #1457 (cherry-picked), so the moved code was under those tests throughout. Merge #1457 first; the duplicate commits then merge as identical content.

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

Seam Module Lines Owns
6. Claude keep-alive runner-claude-sessions.js 104 claudeSessions, the CLAUDE_* constants
7. Verify gate and turn-end trio runner-verify-gate.js 382 —
8. Quota wait and failover runner-quota-wait.js 299 quotaTimers, cancelAll()
9. Orchestration notices and crew sweeps runner-orch-notices.js 467 orchNotices, autoTurns, Codex park/release Maps, cancelAll()
10. Permissions, questions and CI sign-off runner-permissions.js 606 ciWorkflowSignOffs, planPromptHandled

runner.js: 8,345 → 6,738 lines. It started at 9,321 before round 3.

Checked

  • Pure move, ignoring indentation: besides factories, destructures and requires, the only non-move lines are late-bound calls: ctx.startRun, ctx.flushOrchNotices, ctx.queueOrchNotice, ctx.sweepDoneWorkers, ctx.maybeDrainQueued. They're attached via Object.assign(ctx, …) and ctx.x = x, plus the two cancelAll() wrappers.
  • Eager deps: for all 10 factories, every key in the eager const {…} = ctx exists on ctx at the factory call (checked by script). ctx.isAutoTurn is attached before the permissions factory, so the CI sign-off check always has the real function.
  • stopAll: the only change is calling cancelAllQuotaWakes() and cancelAllOrchNotices(). Those run the exact loops and .clear() calls that used to be inline, in the same order.
  • Construction order: all factories are called before the boot crew-sweep loop and refreshAllQuotaWaits().
  • CI sign-off still fails closed in the moved module: each mutation below was applied to runner-permissions.js / runner-claude-sessions.js and reverted:
Mutation Result
single-use delete removed caught
any request id accepted caught (2)
idle cap 3 → 4 caught
isAutoTurn check removed not caught by this branch's copy of the tests. The gap predates this PR (the line moved verbatim). It's closed by the new auto-turn case in #1457 (1095b192), which this PR picks up once #1457 is on main.
  • Tests: full electron suite (CI-like env) passes 4125/4125; npm run typecheck is clean.

Next: seam 11, the per-provider runs (about 4,200 lines).

🤖 Generated with Claude Code

Willem and others added 8 commits October 5, 2026 10:29
Deny, refused decisions, stale ids, stopRun, restart, cross-thread and
changed-patch approvals all leave the merge blocked with nothing landed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mock.timers drives the 30-minute window; no product seam needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A merge that fails after the gate (pre-commit hook) consumes the approval;
the identical retry raises a fresh card instead of reusing it.

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

Seam 6. claudeSessions, the CLAUDE_* constants, disposeClaudeSession,
retireClaudeSession and scheduleClaudeIdleReap move verbatim.
startClaudeRun and stopAll keep reading claudeSessions and CLAUDE_ACK_MS
through the factory's return; finishRunningSubagents reaches the factory
via ctx.

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

Seam 7. shouldVerify, worktreeHeadSha, lastRunIdFor, nextVerifyAttempt,
settleVerifyCrash, runVerifyGate, afterFailedTurn, afterSuccessfulTurn and
finishSuccessfulTurn move verbatim. startRun, maybeDrainQueued,
queueOrchNotice, flushOrchNotices and sweepDoneWorkers are read lazily
from ctx. finishSuccessfulTurn is set on ctx right after the factory so
createAskRuns still destructures it eagerly.

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

Seam 8. quotaTimers, cancelQuotaWake, lastUserOnThread, tryQuotaFailover,
scheduleFailoverResume, fireFailoverResume, scheduleQuotaWake,
fireQuotaWake, resumeQuotaWait, refreshQuotaWait and refreshAllQuotaWaits
move verbatim; startRun is read lazily from ctx. markRunFailed stays in
runner.js and calls tryQuotaFailover / scheduleQuotaWake from the
factory's return. stopAll clears the timers through cancelAll(), and the
boot refreshAllQuotaWaits() still runs after the factory is built.

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

Seam 9. orchNotices, autoTurns, recentlyReleasedCodex, codexReleaseFlush,
codexParkNotified, the notice and Codex park/release functions,
sweepCrew, sweepDoneWorkers, stopCrew and isAutoTurn move verbatim,
together with MAX_WORKERS_PER_ORCHESTRATOR and the CODEX_* notice
constants (used only here). startRun is read lazily from ctx; every
setTimeout/clearTimeout is unchanged. clearRun keeps calling
noteCodexRelease and startRun keeps reading autoTurns/codexSessionHeld via
the factory's return; stopAll clears the timers and Maps through
cancelAll(). The factory runs before the boot sweepCrew loop, and
queueOrchNotice/flushOrchNotices/sweepDoneWorkers are put on ctx for the
verify gate's lazy reads.

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

Seam 10. ciWorkflowSignOffs, planPromptHandled, getPendingPermission,
pendingPlanAsPermission, handleCodexServerRequest, respondCodexPermission,
respondPermission, askUser, requestCiWorkflowSignOff, clearQuestion,
maybePersistPlanApproval and respondPersistedPlan move verbatim, with
PLAN_STORE (used only here). No body edits. pushDetail resolves
getPendingPermission and startRun reads ciWorkflowSignOffs through the
factory's return, bound in createRunner scope before any of them can
run. isAutoTurn comes from the notices factory via ctx. The sign-off Map
stays private to createRunner and keeps failing closed (mutation-checked
against ci-workflow-signoff.test.js).

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.

…s (incl. the auto-turn case from #1457)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@currentbits
currentbits merged commit 77b8d37 into main Oct 5, 2026
5 of 6 checks passed
currentbits added a commit that referenced this pull request Oct 5, 2026
…provider-runs-9a8e80

Runner split seam 11: one module per provider run (#1447, stacked on #1459)
@currentbits
currentbits deleted the coder/runner-split-steps-6-10-047408 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.

2 participants