Skip to content

Runner split seam 11: one module per provider run (#1447, stacked on #1459) - #1460

Merged
currentbits merged 7 commits into
mainfrom
coder/runner-split-seam-11-provider-runs-9a8e80
Oct 5, 2026
Merged

currentbits merged 7 commits into
mainfrom
coder/runner-split-seam-11-provider-runs-9a8e80

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Round 3, seam 11: the last step of the createRunner split (#1447). Each provider's run function moves into its own flat module, one commit per provider. Claude goes last because it has the most dependencies.

Stacked on #1459. Full chain: #1457 → #1454 → #1456 → #1458 → #1459 → this.

Provider Module Lines
Muse runner-provider-muse.js 511
OpenCode runner-provider-opencode.js 532
Kimi runner-provider-kimi.js 590
Cursor runner-provider-cursor.js 602
Codex runner-provider-codex.js 655
Simulated + generic runner-provider-generic.js 410
Claude runner-provider-claude.js 1,248

runner.js: 6,738 → 2,628 lines (9,321 before round 3). What's left is what the design note says stays: opts, active, the hub functions (pushDetail, appendMessage, work-log, run lifecycle, markRunFailed, notifyRunTerminal), the startRun dispatcher, workflow runs, steer/stop/stopAll, the public queries, the ctx wiring and the return object.

Checked

  • Pure move, ignoring indentation: the only non-move lines are the seven factories and their calls, one Object.assign(ctx, {…}), and two adapter destructures (cursorParse, kimiParse) that the moved code needs at module scope, as runner.js had them.
  • Eager deps: all 17 seam factories are called with every eager const {…} = ctx key already on ctx (checked by script).
  • Construction order: every factory is called before the boot crew sweep and refreshAllQuotaWaits().
  • Packaging: the new files are flat electron/*.js, so package-app.sh / package-cross.sh include them.
  • Unchanged: createRunner's return object and module.exports.
  • Tests: full electron suite (CI-like env) 4125/4125; npm run typecheck clean. npm run test:smoke (real Electron launch: threads, provider runs, a workflow to completion) passes A–E.

🤖 Generated with Claude Code

Willem and others added 7 commits October 5, 2026 10:55
Seam 11, provider 1. startMuseRun moves verbatim behind the factory's
`const {…} = ctx`; its muse.js / muse-guardrail-hook.js imports move with
it (runner.js no longer uses them). ctx gains the hub helpers every
provider run shares (abortIfCancelled, claimPreparingRun,
stampPreparingSteps, settleCancelledLaunch, the work-log trio,
notifyRunTerminal, noteToolSpan) and the module-level helpers
assertProviderBinary, crossesBoundary, resolveSpawn, formatRunExitError,
upsertThinkingCard and PUSH_THROTTLE_MS. startRun keeps calling
startMuseRun by name; the factory runs before the boot crew sweep and
refreshAllQuotaWaits, the only construction-time paths into startRun.

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

Seam 11, provider 2. startOpencodeRun moves verbatim behind the
factory's `const {…} = ctx`; the opencode.js and opencode-guardrail.js
imports move with it (runner.js no longer uses them). ctx gains
persistToolImages. startRun keeps calling startOpencodeRun by name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Seam 11, provider 3. startKimiRun moves verbatim behind the factory's
`const {…} = ctx`; the kimi.js import moves with it (runner.js no
longer uses it). ctx gains assignContextUsage and THINKING_TRUNCATE.
startRun keeps calling startKimiRun by name.

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

Seam 11, provider 4. startCursorRun moves verbatim behind the factory's
`const {…} = ctx`; the cursor.js, cursorPinTaskParent.js and
cursor-guardrail.js imports, ensureCursorMcpConfig and insertBeforeLast
move with it (runner.js no longer uses them). ctx gains
cursorToolCardSummary in the literal, and ingestTaskNotifications /
noteCursorSubagent through one Object.assign after the subagents
factory, ahead of every provider factory. startRun keeps calling
startCursorRun by name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Seam 11, provider 5. startCodexRun moves verbatim behind the factory's
`const {…} = ctx`; the codex.js, codex-guardrail.js and
codexWorkspaceWrite.js imports, isCodexChildThread, sessionIdForResume,
honouredEfforts, the Codex MCP args/env, guardrailsEnabled and
guardrailNotice move with it (runner.js no longer uses them). ctx gains
runCodexFn, savePlanSteps and trackLiveCodexPid in the literal, and
handleCodexServerRequest (runner-permissions.js) in the provider
Object.assign. startRun keeps calling startCodexRun by name;
createRunner's return still exposes handleCodexServerRequest.

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

Seam 11, provider 6. startSimulatedRun, startGenericRun and their
helpers notePhaseEvents and finishSuccessSim move verbatim behind the
factory's `const {…} = ctx`; parseAgentCommand moves with them. The
simulate clock seams (tickMs, setIntervalFn, clearIntervalFn) are passed
through ctx unchanged, along with core, runAgentFn and capitalize in the
literal and afterFailedTurn / afterSuccessfulTurn (runner-verify-gate.js)
in the provider Object.assign. startRun keeps calling both by name.

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

Seam 11, provider 7 (last). startClaudeRun, which also drives Grok,
moves verbatim behind the factory's `const {…} = ctx`; runClaude, the
grok.js / grok-guardrail-hook.js imports, the Claude/Grok MCP helpers,
isMemoryConsolidateTool, extractImages, classifyTool, fs and createHash
move with it (runner.js no longer uses them). ctx gains
unwrapStreamEvent, isPhantomClaudeResult, claudeContextTokens,
reportedModelUsageWindow, classifyClaudeResultError, trackLiveClaudeChild
and launchWasCancelled in the literal, and askUser, addSubagentRow,
setSubagentStatus, claudeSessions, CLAUDE_ACK_MS, disposeClaudeSession
and scheduleClaudeIdleReap in the provider Object.assign. startRun keeps
calling startClaudeRun by name. createRunner's return object and
runner.js 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-steps-6-10-047408 to main October 5, 2026 11:04
@currentbits
currentbits merged commit dddeb43 into main Oct 5, 2026
6 checks passed
@currentbits
currentbits deleted the coder/runner-split-seam-11-provider-runs-9a8e80 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