fix: advertise Codex as stdio-only (#1193) - #1292
Conversation
Codex does not expose MCP tools that are configured through the HTTP block, so writing an HTTP config produces a client that connects but surfaces no tools. Declare SupportsHttpTransport = false and restrict SupportedTransports to stdio, so CoerceTransportFor settles on stdio before Configure() runs.
📝 WalkthroughWalkthroughCodex configuration now includes a Linux config path, disables HTTP transport, and advertises STDIO only. Manual snippet generation coerces unsupported HTTP preferences to STDIO and restores the cached preference, with EditMode regression coverage. ChangesCodex transport configuration
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@TestProjects/UnityMCPTests/Assets/Tests/EditMode/Clients/SupportedTransportsTests.cs`:
- Around line 27-35: Update Codex_SupportsStdioOnly to assert that
SupportedTransports contains exactly ConfiguredTransport.Stdio, rather than only
checking inclusion and HTTP exclusion. Preserve the existing
SupportsHttpTransport assertion.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: abc408c7-49e9-4206-be84-9090716b90ca
📒 Files selected for processing (2)
MCPForUnity/Editor/Clients/Configurators/CodexConfigurator.csTestProjects/UnityMCPTests/Assets/Tests/EditMode/Clients/SupportedTransportsTests.cs
There was a problem hiding this comment.
Pull request overview
This PR fixes Codex client configuration by ensuring Codex is treated as stdio-only, preventing the plugin from generating HTTP-based MCP configuration that Codex connects to but then exposes no tools (silent failure). It fits into the Unity Editor “client configurator” layer that writes/updates external MCP client configs.
Changes:
- Mark Codex as not HTTP-capable via
SupportsHttpTransport = false. - Override Codex
SupportedTransportsto advertise stdio only. - Add an EditMode regression test asserting Codex advertises stdio-only and is not HTTP-capable.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| MCPForUnity/Editor/Clients/Configurators/CodexConfigurator.cs | Advertises Codex as stdio-only and disables HTTP capability to avoid broken HTTP config output. |
| TestProjects/UnityMCPTests/Assets/Tests/EditMode/Clients/SupportedTransportsTests.cs | Adds a regression test to ensure Codex transport capabilities are reported as stdio-only. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| private static readonly ConfiguredTransport[] StdioOnly = { ConfiguredTransport.Stdio }; | ||
| public override IReadOnlyList<ConfiguredTransport> SupportedTransports => StdioOnly; | ||
| } |
…ort set Two review findings on CoplayDev#1292. Copilot: advertising Codex as stdio-only was not enough. GetManualSnippet() calls BuildCodexServerBlock directly, which reads the global UseHttpTransport pref itself. Configure() gets that pref coerced for it by ClientConfigurationService.ConfigureWithTransportCoercion; the snippet path does not. With the HTTP pref on, the copyable snippet still rendered [features] rmcp_client = true [mcp_servers.unityMCP] url = "http://127.0.0.1:8080/mcp" reintroducing the exact silent-failure path via manual setup. Coerce to stdio around the call for any client that does not support HTTP, restoring the pref afterwards, mirroring ConfigureWithTransportCoercion. Deliberately not removing the HTTP branch from CodexConfigHelper: it is covered by BuildCodexServerBlock_HttpMode_GeneratesUrlField and is a general-purpose helper, so narrowing the caller is the smaller and more honest change. CodeRabbit: assert SupportedTransports equals exactly { Stdio } rather than contains-stdio plus not-contains-http, which would also pass if a third transport were added. Adds Codex_ManualSnippet_IsStdio_EvenWhenHttpPreferred, which fails with the url block above before this change.
Fixes #1193.
The bug
Codex does not expose MCP tools that are configured through the HTTP block. When the plugin writes an HTTP config for Codex, the client connects but surfaces no tools — a silent failure that looks like a broken bridge.
The fix
Two lines of behaviour:
SupportsHttpTransport = falseon the Codex client descriptorSupportedTransports => { Stdio }Together these make
CoerceTransportForsettle on stdio beforeConfigure()runs, so the writtenconfig.tomlgetscommand/argsrather than aurl.Verified live
The preference was restored afterwards; no user config was left modified.
Relationship to #1214 and #1110
Both of those PRs touch Codex config handling and carry incompatible
RemoveCodexServerBlocksignatures, so neither can merge as-is. This change is deliberately independent of that conflict — it fixes the transport advertisement only and touches nothing either PR renames, so it can land now and whichever of those two eventually wins can rebase over it cleanly.A pre-existing issue this makes visible
Codex now joins the set of stdio-only clients. Any UI that offers an HTTP toggle for such clients is showing an option that cannot work — but this is pre-existing behaviour that Claude Desktop already hits, not something introduced here. Worth a separate look.
Tests
Adds
Codex_SupportsStdioOnlytoSupportedTransportsTests, asserting stdio is advertised, HTTP is not, andSupportsHttpTransportis false.Full EditMode suite on 2021.3.45f2:
1168 total / 1094 passed / 0 failed / 74 skipped.Summary by CodeRabbit
Bug Fixes
Tests