GeezerVison is showing github.com — fix(core): keep codemode on legacy MCP entries by tneemo · Pull Request #59126 · anomalyco/opencode
Conversation
tneemo
commented
Oct 26, 2026
•
edited by opencode-agent
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Issue for this PR
Closes #59115
Type of change
- Bug fix
- New feature
- Refactor / code improvement
- Documentation
What does this PR do?
A legacy mcp.<name> entry is decoded with ConfigMCPV1.Info and rebuilt by ConfigMigrateV1.migrateMcp. The V1 local and remote schemas had no codemode field, so the decode stripped it, and migrateMcp didn't copy it. codemode: false was dropped with no diagnostic and the server stayed wrapped by Code Mode. The same key under mcp.servers.<name> already worked.
This adds an optional codemode boolean to both V1 schemas and copies it in both migrateMcp branches. When the key is omitted it stays unset, so McpCodeModeDefaultsPlugin still applies its defaults.
How did you verify your code works?
- New tests in
packages/core/test/config/normalization.test.ts cover local and remote legacy entries with codemode: false, and with the key omitted. Without the fix, the two codemode: false cases fail (Expected: false, Received: undefined).
bun run test test/config test/v1-migration.test.ts in packages/core: 294 pass, 0 fail.
bun run test in packages/core: 6523 pass, 365 skip, 0 fail.
bun run typecheck:tsc in packages/core passes.
oxlint on the touched directories reports 0 warnings and 0 errors.
Screenshots / recordings
Not a UI change.
Checklist
- I have tested my changes locally
- I have not included unrelated changes in this PR
Added by the opencode bot (AI-generated).
Public API: legacy mcp.<name> entries now honour codemode, matching mcp.servers.<name> (backwards compatible)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I called ConfigNormalize.normalize in both checkouts. On the base, a legacy mcp.<name> local or remote entry loses codemode: false and reports no diagnostic. With this change it is kept. Leaving the key out still leaves it unset, so McpCodeModeDefaultsPlugin still applies its defaults. An invalid legacy value such as "no" now gets the same 'malformed' diagnostic as the mcp.servers.<name> shape. I couldn't run opencode debug config from source: its background server fails with Cannot find module 'react/jsx-dev-runtime' on the base too. The new normalization tests and typecheck:tsc pass.
Public API: the legacy flat mcp.<name> config shape now accepts and honours the existing codemode key, the same way mcp.servers.<name> already does. This is backwards compatible: configs without the key behave as before. Nothing else changes.
No blocking concerns.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Oct 29, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|