Skip to main content
← Back to list
01Issue
BugClosedSwamp CLIPublic
AssigneesNone

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

  1. Start swamp serve locally.
  2. Run swamp doctor datastores --server http://127.0.0.1:<port>.
  3. Observe an invalid_request error 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.

02Bog Flow
✓OPEN○TRIAGED○IN PROGRESS◉CLOSED

Closed

9/22/2026, 9:39:29 PM

No activity in this phase yet.

03Sludge Pulse
Editable. Press Enter to edit.

stack72 commented 9/22/2026, 9:39:28 PM

Closed via the work in #2347

Sign in to post a ripple.