Enforce strict Zod parsing across session, auth, and MCP config paths 8 months ago
Authored
mweinbach 2/22/2026, 9:24:12 PM Remove permissive fallback parsing in session persistence and DB mappers, make config/API key and codex auth reads fail fast on invalid schema, and stop MCP runtime from merging legacy .agent layers automatically.
Update affected tests to assert strict validation behavior and canonical cowork storage paths.
Co-authored-by: Codex <noreply@openai.com> Parent5b2fa7a
31 files changed
apps/desktop/electron/services/persistence.ts +93 −82 apps/desktop/electron/services/serverManager.ts +12 −6 apps/desktop/src/lib/wsProtocol.ts +23 −1 apps/desktop/test/persistence-permissions.test.ts +1 −1 apps/desktop/test/persistence-state-sanitization.test.ts +56 −63 apps/desktop/test/ws-protocol-parse.test.ts +35 −0 src/cli/repl/stateStore.ts +18 −10 src/client/agentSocket.ts +26 −6 src/config.ts
+94
−53
src/connect.ts +0 −1
src/mcp/authStore.ts +57 −121
src/mcp/configRegistry.ts +37 −30
src/mcp/index.ts +0 −2
src/providerStatus.ts +1 −1
src/providers/codex-auth.ts +51 −89
src/providers/codex-cli.ts +1 −1
src/server/sessionBackup.ts +43 −5
src/server/sessionDb.ts +37 −24
src/server/sessionDb/mappers.ts +65 −58
src/server/sessionDb/normalizers.ts +46 −40
src/server/sessionStore.ts +68 −73
src/store/connections.ts +45 −49
test/agentSocket.parse.test.ts +32 −0
test/config.test.ts +50 −28
test/connect.test.ts +5 −4
test/mcp.config-registry.test.ts +5 −6
test/mcp.test.ts +2 −2
test/providerStatus.test.ts +4 −3
test/session-db-mappers.test.ts +82 −56
test/session-db.test.ts +7 −0
test/session-store.test.ts +13 −11