refactor: extract shadow control-plane into standalone omo-control-plane service#40
refactor: extract shadow control-plane into standalone omo-control-plane service#40EZotoff wants to merge 2 commits into
Conversation
Extracted to omo-control-plane as a standalone service. Removes createShadowControlPlane import, instantiation, and three /control-plane* API routes from omo-pulse's API server. Increases Bun.serve idleTimeout to 255s to prevent disconnection on slow first payload.
Control-plane tests now live in omo-control-plane. Removes vi.mock for ../server/control-plane, four control-plane route test cases, and the deleted control-plane.test.ts reference from the test suite.
There was a problem hiding this comment.
Pull request overview
Refactors omo-pulse by removing the embedded “shadow control-plane” functionality so orchestration/advisory logic can live in the standalone omo-control-plane service, and adjusts server keep-alive behavior to better tolerate slow first responses.
Changes:
- Removes embedded control-plane wiring/routes/tests from
omo-pulse(leaving monitoring/dashboard concerns in this repo). - Increases Bun server
idleTimeoutto 255s in both dev + start entrypoints. - Updates API/test code organization and lockfile metadata as part of the refactor.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/server/start.ts | Sets Bun idleTimeout to 255s for longer-lived connections in the prod entrypoint. |
| src/server/dev.ts | Sets Bun idleTimeout to 255s for the dev API server. |
| src/server/api.ts | Removes control-plane-related API surface (and reformats/organizes API module). |
| src/tests/api.test.ts | Removes/adjusts API route tests and mocking to match the new API surface. |
| bun.lock | Adds configVersion metadata (lockfile format update). |
[RISK:medium]
[SCORES]
{"security":4.5,"safety":4.5,"performance":3.5,"featureQuality":4.0,"confidence":3.5}
[/SCORES]
[SUMMARY]
The extraction/refactor direction looks consistent with the stated separation-of-concerns goal, and repo-wide searches show no remaining control-plane references. The main follow-ups are operational/maintainability oriented: make the new max idleTimeout configurable/documented, and prefer type-safe Vitest mocking helpers over unknown casts.
[/SUMMARY]
| fetch: app.fetch, | ||
| hostname: "127.0.0.1", | ||
| port, | ||
| idleTimeout: 255, |
| fetch: app.fetch, | ||
| hostname: "127.0.0.1", | ||
| port, | ||
| idleTimeout: 255, |
| const mockedCreateMultiProjectService = createMultiProjectService as unknown as { | ||
| mockReturnValue: (value: unknown) => void | ||
| } |
| ;(listSources as unknown as { mockReturnValue: (value: unknown) => void }).mockReturnValue([ | ||
| { id: "src-1", label: "My Project", updatedAt: 1000 }, | ||
| ]) | ||
| vi.mocked(getDefaultSourceId).mockReturnValue("src-1") | ||
| ;(getDefaultSourceId as unknown as { mockReturnValue: (value: unknown) => void }).mockReturnValue("src-1") | ||
|
|
Summary
Extracts the shadow control-plane from
omo-pulseinto a new standalone service:omo-control-plane.Why
omo-pulsehandles monitoring and dashboard data;omo-control-planehandles orchestration advisories.What changes
src/server/control-plane/module (5 files)src/server/api.tssrc/__tests__/api.test.tsBun.serveidleTimeoutto 255s (prevents disconnection on slow first payload)The new service
omo-pulse /api/projectsRollback
Reverting this commit restores the embedded control-plane. The extracted service is additive —
omo-pulsehas zero runtime dependency on it.