From 49761cebaddf409daa9f001bf9c54841c69d7707 Mon Sep 17 00:00:00 2001 From: Nacho Chiappero Date: Tue, 25 Aug 2026 13:08:30 +0000 Subject: [PATCH] test(desktop): pin that field-level junk in an mcp_servers entry survives MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `getServers` filters on whole-entry shape only — an entry with a junk field (`{ command: 42, enabled: 'yes' }`) is still handed to the readers, which coerce and tolerate. Pin that so a later tightening of `isEntry` can't quietly start dropping entries that merely carry a bad field. Raised in review on #94338. Co-Authored-By: Claude Opus 5 --- apps/desktop/src/lib/mcp-servers.test.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/desktop/src/lib/mcp-servers.test.ts b/apps/desktop/src/lib/mcp-servers.test.ts index f25848f6fc..8928ebde1c 100644 --- a/apps/desktop/src/lib/mcp-servers.test.ts +++ b/apps/desktop/src/lib/mcp-servers.test.ts @@ -17,6 +17,15 @@ describe('getServers', () => { expect(getServers({ mcp_servers: servers })).toEqual(servers) }) + // Field-level junk is the readers' problem, not this filter's — they coerce + // and tolerate. Pinned so a later tightening of `isEntry` can't start + // dropping entries that merely carry a bad field. + it('keeps entries whose fields are junk', () => { + const servers = { files: { command: 42, enabled: 'yes' } } + + expect(getServers({ mcp_servers: servers })).toEqual(servers) + }) + // A key left without a value in config.yaml parses as `null`, and every // reader (the `enabled` gate, the transport label, the probe) reaches // straight into the entry — so one of these used to take the pane down.