fix: propagate headers through OpenCode MCP adapter#622
fix: propagate headers through OpenCode MCP adapter#622sergio-sisternes-epam merged 2 commits intomicrosoft:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes OpenCode MCP config generation so remote server headers from Copilot-format configs are preserved when writing opencode.json, and adds a dedicated unit test suite to prevent regressions.
Changes:
- Propagate
headersfor remote MCP entries inOpenCodeClientAdapter._to_opencode_format(). - Add comprehensive unit tests covering OpenCode MCP config read/write, conversion, and stale cleanup behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/apm_cli/adapters/client/opencode.py |
Copies remote headers into OpenCode schema during Copilot->OpenCode config conversion. |
tests/unit/test_opencode_mcp.py |
Adds unit tests for OpenCode adapter behavior, including remote headers and MCPIntegrator.remove_stale() cleanup. |
|
Thanks for this, @alopezsanchez! Great catch on the dropped headers, and the test coverage you added is really appreciated. Two small suggestions:
Neither is a blocker — happy to merge once addressed. Nice work! |
Sure thing! Will do 👍🏻 |
49a07ed to
61e882c
Compare
`_to_opencode_format` was not mapping remote server headers from the Copilot-format config into OpenCode's schema. When a remote MCP server declared headers (e.g. Authorization), they were silently dropped from opencode.json. It also adds a comprehensive test suite to the OpenCode MCP adapter.
61e882c to
54a88a3
Compare
|
@sergio-sisternes-epam done! |
|
@danielmeppiel this will need your "Merge pull request" capabilities :) |
Description
_to_opencode_formatwas not mapping remote server headers from the Copilot-format config into OpenCode's schema. When a remote MCP server declared headers (e.g. Authorization), they were silently dropped from opencode.json.It also adds a comprehensive test suite to the Opencode MCP adapter.
Fixes #621
Type of change
Testing