test(desktop): pin that field-level junk in an mcp_servers entry survives

`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 <noreply@anthropic.com>
This commit is contained in:
Nacho Chiappero
2026-08-25 13:08:30 +00:00
committed by Teknium
parent 13afe9e9e1
commit 49761cebad
+9
View File
@@ -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.