Relationships
#2361 serve rejects doctor.datastores, cluster.instances and serve.config requests: no zod schema
Opened by hammz · 9/22/2026
Description
Three request types in the serve ServerRequest union (src/serve/protocol.ts) have dispatch cases in src/serve/connection.ts but no zod schema in ServerRequestSchema (the z.discriminatedUnion around connection.ts:1267). validateServerRequest therefore rejects every such request with invalid_request before the dispatch case is reached, so the handlers are unreachable over the WebSocket protocol.
| Request type | Sender | Dispatch case | Impact |
|---|---|---|---|
doctor.datastores |
CLI: swamp doctor datastores --server (src/cli/commands/doctor_datastores.ts:496) |
connection.ts:3117 -> handleDoctorDatastores | The CLI command always fails against a serve |
cluster.instances |
Dashboard over WebSocket (packages/dashboard/src/views/System.tsx:59) | connection.ts:3600 | Dashboard System view cannot load cluster instances over WS (the REST route /api/v1/cluster/instances bypasses zod and still works) |
serve.config |
Dashboard over WebSocket (packages/dashboard/src/views/System.tsx:60) | connection.ts:3612 | Dashboard System view cannot load serve config |
The sibling doctor requests (doctor.vaults, doctor.secrets, doctor.workflows, doctor.extensions) do have schemas; only doctor.datastores is missing.
Steps to Reproduce
- Start
swamp servelocally. - Run
swamp doctor datastores --server http://127.0.0.1:<port>. - Observe an
invalid_requesterror instead of the datastore doctor report.
Expected
Each request type in the ServerRequest union has a matching zod schema, and a test asserts that every ServerRequest type has one.
Additional Context
Found while triaging swamp-club#2356 (workflow resume --from fails over serve because from is missing from WorkflowResumeRequestSchema). That fix adds a compile-time parity check between protocol.ts payload fields and the zod schemas; it pins these three schema-less types in an allowlist that this issue should empty.
Closed
No activity in this phase yet.