Skip to content

Split workflow.js: per-provider spawners and phase helpers into modules (#1447 pass R) - #1470

Merged
currentbits merged 8 commits into
mainfrom
coder/refactor-r-split-workflow-js-e634b3
Oct 5, 2026
Merged

currentbits merged 8 commits into
mainfrom
coder/refactor-r-split-workflow-js-e634b3

Conversation

@currentbits

@currentbits currentbits commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Round 6, pass R of #1447. electron/workflow.js (2,557 lines) runs multi-phase Build workflows. Its per-provider agent spawners and view/prompt helpers move into eight flat modules. startWorkflowRun stays in workflow.js, and the deps-object contract with runner.js / runner-provider-*.js is unchanged.

Module Lines Holds
workflow-phases.js 315 view and prompt helpers
workflow-agents-muse.js 227 Muse spawner
workflow-agents-codex.js 218 Codex spawner
workflow-agents-cursor.js 199 Cursor spawner
workflow-agents-claude.js 193 claude-stream spawner
workflow-agents-opencode.js 193 OpenCode spawner
workflow-agents-kimi.js 183 Kimi spawner
workflow-spawn.js 80 shared spawn helpers

workflow.js: 2,557 → 1,106 lines.

Checked

  • Same API: Object.keys(require("./electron/workflow.js")) is identical on main and this branch (15 keys).
  • No module-level mutable state: there's no let at module scope in any of the files. Shared helpers live only in workflow-spawn.js.
  • Pure move, ignoring indentation: there are no non-move lines beyond requires and export lists.
  • Tests:
    • electron/test/workflow*.test.js pass 97/97.
    • The full electron suite (CI-like env) passes 4126/4126, and npm run typecheck is clean.
    • Per the worker's run, test:smoke passes A–E. Pass E runs a real workflow end to end.

🤖 Generated with Claude Code

Willem and others added 8 commits October 5, 2026 13:43
…1447)

Pure move: hashSeed, capitalize, truncate, agentModelLabel, the view
builders, agent-id parsing, prompt building, template checks and
kickoffText. Bodies verbatim; workflow.js re-exports the same keys.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…1447)

Pure move: crossesBoundary, resolveWorkflowSpawn, notePhaseGuardrail,
realSessionId and claudeStreamSessionId, shared by every per-provider
phase spawner. Bodies verbatim.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-claude.js (#1447)

Pure move of spawnAgentClaude (claude, grok and other claude-stream
providers). Body verbatim; workflow.js drops the imports only it used.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
#1447)

Pure move of spawnAgentCodex. Body verbatim; workflow.js drops the
imports only it used.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…1447)

Pure move of spawnAgentKimi. Body verbatim; workflow.js drops the
imports only it used.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…1447)

Pure move of spawnAgentMuse. Body verbatim; workflow.js drops the
imports only it used.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
….js (#1447)

Pure move of spawnAgentCursor. Body verbatim; workflow.js drops the
imports only it used.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…code.js (#1447)

Pure move of spawnAgentOpencode. Body verbatim; workflow.js keeps only
spawnPhaseAgent's dispatch plus the run loop, and drops the imports the
spawners used.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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 merged commit 8d71ac8 into main Oct 5, 2026
6 checks passed
@currentbits
currentbits deleted the coder/refactor-r-split-workflow-js-e634b3 branch October 5, 2026 12:49
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