Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Report malformed Hermes and DeepSeek Harness documents as YAML. Carry the compiled setup/uninstall diagnostics coverage from #2153 onto the existing validation from #2157, including unchanged files and no backup writes. Add malformed YAML scenarios for both clients. Validation: 174 focused tests, npm run check, test discovery, package verification, and npm pack --dry-run. Co-authored-by: Jax367 <[email protected]>
|
Thanks @Jax367 for the careful diagnostics work and CLI regression coverage! The core configuration-shape fix is already on main through #2157. I carried the remaining changes into 94153f1: your compiled setup/uninstall tests, adapted to the current diagnostics, and the YAML syntax-error labels for Hermes and DeepSeek Harness. I also added malformed YAML regression cases for both clients and credited you as co-author. All 174 focused tests, type checking/lint/architecture checks, test discovery, package verification, and the package dry run passed on macOS. Closing this PR as superseded by #2157 and the follow-up above. Thank you for the contribution! |
Summary
Fixes #2152. When a client configuration contains a non-object root or MCP server table, setup and uninstall now name the rejected field instead of printing a Zod issue dump or claiming that valid JSON could not be parsed. Both commands continue stopping before configuration writes or removals.
Problem and expected behavior
For
{"mcpServers":null,"keep":1}, setup previously displayed aninvalid_typeissue with an empty path, and uninstall said the document was not valid JSON. The shared parser now reportsConfiguration field "mcpServers" must be an object.A root such as[]reportsThe configuration root must be an object.OpenCode's nested table reports"mcp.servers".Change and scope
Validate decoded roots and server tables once at the shared parsing boundary, using the existing tagged
ConfigurationErrorwith a named setting and the original validation cause. Setup's existing file-readerResultpreserves that message; uninstall now preserves structural configuration errors. Syntax failures retain their format-specific diagnostics, including YAML for Hermes/DSH.Contract and boundary impact
ClientConfigurationDocumentadmission of decoded client settings.Evidence and regression coverage
60259a91d, the initial seven structural scenarios failed their diagnostic assertions; the syntax-error control passed. All ten final scenarios pass with this fix.Configuration <selected path> is malformed: Configuration field "mcpServers" must be an object. It was not changed. Repair it, then rerun uninstall.Validation performed
Native Windows, pinned Node 24.18.0 / npm 11.16.0:
npm run test:focused -- tests/acceptance/setup/clientConfigurationDiagnosticsCli.test.ts tests/boundary/filesystem/dshClientConfiguration.test.ts src/application/Setup.configuration.test.ts— 103 passed, including all ten real CLI journeys.clientLifecycle.test.ts,hermesClientConfiguration.test.ts, andpiClientConfiguration.test.ts— 189 passed, 14 failed. The same 14 test names fail on unmodified base code: five Windows symlinkEPERMfailures, six path spelling/drive assumptions, and three existing Pi alignment failures. No failures were added by this change; these remain outside this PR's scope.npm run check— all six tasks and architecture guards passed (existing lint warnings).npm run verify:test-discovery— all 916 test files discovered exactly once.npm pack --dry-run --json— passed, including lifecycle checks.npm run verify:package— attempted; its repository-skill stage failed atspawn npm ENOENTon this Windows host before installation/verification. Temporary workspace cleanup completed. Full packaged-install verification remains unverified.git diff --check— passed.Compatibility, safety, and release
Review checklist