Skip to content

fix(codex): omit unsupported MCP type field from generated TOML - #512

Open
RGB-loop wants to merge 1 commit into
SaladDay:mainfrom
RGB-loop:fix/codex-mcp-omit-type
Open

RGB-loop wants to merge 1 commit into
SaladDay:mainfrom
RGB-loop:fix/codex-mcp-omit-type

Conversation

@RGB-loop

Copy link
Copy Markdown

Summary

Codex rejects a type key in [mcp_servers.<id>] tables: it warns, and errors under --strict-config. json_server_to_toml_table wrote our internal type (stdio/http/sse) into every generated table.

  • Stop writing type to the Codex TOML. It's still used internally to choose the core fields (command/args/env/cwd vs url/http_headers).
  • Round-trip is preserved: import_from_codex already infers type when it's absent (url → http, otherwise stdio). Note: sse re-imports as http, which matches Codex itself, since it only supports streamable HTTP.

Testing

  • New unit test codex_toml_omits_unsupported_type_field (stdio / no type / http / sse → no type key, correct command/url).
  • cargo fmt --check ✅
  • cargo test --lib ✅ 4567 passed, 0 failed, 2 ignored (after rebase onto current main). Note: session_usage_codex::test_incremental_resume_keeps_replay_prefix_alignment is intermittently flaky locally, independent of this change.
  • Integration tests: the 7 failures in import_export_sync/prompt_commands/provider_commands are pre-existing on main in my environment (no default editor, official-provider usage template), unchanged by this PR.

Closes #496

Codex does not accept a `type` key on [mcp_servers.*] entries; it warns
about it and fails under --strict-config. Codex infers the transport from
`command`/`url`, and import_from_codex already infers `type` the same way
when it is absent, so the field can be dropped from generated TOML without
losing round-trip information.

Closes SaladDay#496
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(codex): omit unsupported MCP type field from generated TOML

1 participant