Skip to content

Split IPC_HANDLERS into per-namespace modules (#1447 pass S) - #1472

Merged
currentbits merged 14 commits into
mainfrom
coder/refactor-s-split-ipc-handlers-85b161
Oct 5, 2026
Merged

currentbits merged 14 commits into
mainfrom
coder/refactor-s-split-ipc-handlers-85b161

Conversation

@currentbits

@currentbits currentbits commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Round 6, pass S of #1447. IPC_HANDLERS was one ~2,000-line object literal in electron/ipc.js mapping every renderer→main channel to its handler. It's now split into 11 flat namespace modules plus ipc-shared.js for helpers several namespaces use. ipc.js composes them with spreads, and registerIpc, makeCtx and the guards stay in ipc.js.

Module Handlers Lines
ipc-threads.js 58 539
ipc-git.js 54 500
ipc-simulator.js 24 198
ipc-app.js 21 197
ipc-projects.js 19 130
ipc-devserver.js 19 173
ipc-files.js 16 193
ipc-runs.js 16 59
ipc-mcp.js 14 181
ipc-skills.js 14 128
ipc-insights.js 7 51
ipc-shared.js (helpers) 67

ipc.js: 2,476 → 176 lines.

Checked

  • Same handlers: Object.keys(IPC_HANDLERS) gives the identical 262-channel set on main and this branch. Every handler's function source text is byte-identical to main's.
  • No channel defined twice: the 11 modules export 262 handler functions in total, exactly as many as IPC_HANDLERS has, so no spread silently overrides another.
  • Key order changed, and that's harmless: the only code that loops over IPC_HANDLERS (ipc.js registration and the web bridge) registers each channel by name, so order doesn't matter.
  • Tests: merged onto current main (d02841d8) and verified there.
    • npm run typecheck is clean, including sync-ipc-preload --check.
    • Full electron suite (CI-like env) passes 4126/4126.
    • npx vite build and npm run test:smoke (real Electron over IPC) pass A–E.

🤖 Generated with Claude Code

Willem and others added 13 commits October 5, 2026 13:44
retireAgent, runRetention and resolveThreadRoot are used by more than one
upcoming ipc-<namespace>.js module, so they get a single owner that both
ipc.js and the namespace modules require. Bodies moved verbatim.

Refs #1447

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Handlers moved verbatim; ipc.js spreads the module into IPC_HANDLERS at
the rows' old position.

ipc.js now drops its cached ipc-*.js modules before requiring them. Tests
re-require ipc.js after evicting services.js / worktrees.js / the electron
stub (ipc-async-guard stubs services on the fresh copy); without the
eviction a cached ipc-<namespace>.js keeps calling the first services.js.

Refs #1447

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Handlers moved verbatim; ipc.js spreads the module into IPC_HANDLERS at
the position of the group's first row.

Refs #1447

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…:* handlers into ipc-insights.js

Handlers moved verbatim; ipc.js spreads the module into IPC_HANDLERS at
the position of the group's first row.

Refs #1447

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ers:*, sourceControl:* handlers into ipc-app.js

Handlers moved verbatim; ipc.js spreads the module into IPC_HANDLERS at
the position of the group's first row.

Refs #1447

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Handlers moved verbatim; ipc.js spreads the module into IPC_HANDLERS at
the position of the group's first row.

Refs #1447

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Handlers moved verbatim; ipc.js spreads the module into IPC_HANDLERS at
the position of the group's first row.

Refs #1447

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… ipc-runs.js

Handlers moved verbatim; ipc.js spreads the module into IPC_HANDLERS at
the position of the group's first row.

Refs #1447

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…lers into ipc-git.js

Handlers moved verbatim; ipc.js spreads the module into IPC_HANDLERS at
the position of the group's first row.

Refs #1447

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…c-files.js

Handlers moved verbatim; ipc.js spreads the module into IPC_HANDLERS at
the position of the group's first row.

Refs #1447

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ndlers into ipc-devserver.js

Handlers moved verbatim; ipc.js spreads the module into IPC_HANDLERS at
the position of the group's first row.

Refs #1447

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r.js

Handlers moved verbatim; ipc.js spreads the module into IPC_HANDLERS at
the position of the group's first row.

Refs #1447

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 39fe3fa into main Oct 5, 2026
6 checks passed
@currentbits
currentbits deleted the coder/refactor-s-split-ipc-handlers-85b161 branch October 5, 2026 13:03
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