Skip to content

fix: advertise Codex as stdio-only (#1193) - #1292

Merged
Scriptwonder merged 2 commits into
CoplayDev:betafrom
Scriptwonder:fix/1193-codex-stdio-only
Jul 28, 2026
Merged

fix: advertise Codex as stdio-only (#1193)#1292
Scriptwonder merged 2 commits into
CoplayDev:betafrom
Scriptwonder:fix/1193-codex-stdio-only

Conversation

@Scriptwonder

@Scriptwonder Scriptwonder commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

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 = false on the Codex client descriptor
  • SupportedTransports => { Stdio }

Together these make CoerceTransportFor settle on stdio before Configure() runs, so the written config.toml gets command/args rather than a url.

Verified live

codex.SupportedTransports        = [Stdio]
UseHttpTransport pref = True
  -> CoerceTransportFor(codex)   = False
written config.toml contains 'command'/'args'
written config.toml contains 'url' = False

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 RemoveCodexServerBlock signatures, 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_SupportsStdioOnly to SupportedTransportsTests, asserting stdio is advertised, HTTP is not, and SupportsHttpTransport is false.

Full EditMode suite on 2021.3.45f2: 1168 total / 1094 passed / 0 failed / 74 skipped.

Summary by CodeRabbit

  • Bug Fixes

    • Updated Codex integration to advertise and use STDIO only.
    • Disabled HTTP transport for Codex to avoid unsupported HTTP connection attempts.
    • Improved Codex snippet generation so it stays STDIO-focused when HTTP isn’t supported (even if HTTP is preferred).
    • Added Linux Codex configuration path support.
  • Tests

    • Added regression tests confirming Codex is STDIO-only and does not support HTTP.
    • Added coverage ensuring the generated Codex manual snippet remains STDIO-oriented regardless of the global HTTP preference.

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.
Copilot AI review requested due to automatic review settings July 28, 2026 16:19
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Codex 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.

Changes

Codex transport configuration

Layer / File(s) Summary
Declare Codex transport capabilities
MCPForUnity/Editor/Clients/Configurators/CodexConfigurator.cs
Adds the Linux config path, disables HTTP support, and restricts supported transports to STDIO.
Force and validate STDIO snippets
MCPForUnity/Editor/Clients/McpClientConfiguratorBase.cs, TestProjects/UnityMCPTests/Assets/Tests/EditMode/Clients/SupportedTransportsTests.cs
Forces STDIO snippet generation when HTTP is preferred but unsupported, restores the cached preference, and tests the transport flags and generated output.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

Suggested labels: bug, safe-to-test

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The code changes address #1193 by making Codex stdio-only and adding tests for supported transports and manual snippet generation.
Out of Scope Changes check ✅ Passed The changes stay focused on Codex transport handling and related tests, with no clear unrelated or out-of-scope additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly states the main change: Codex is advertised as stdio-only.
Description check ✅ Passed The description covers the bug, fix, related issue, and testing, though several template sections are not fully filled out.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between bd72241 and 4ff8ff8.

📒 Files selected for processing (2)
  • MCPForUnity/Editor/Clients/Configurators/CodexConfigurator.cs
  • TestProjects/UnityMCPTests/Assets/Tests/EditMode/Clients/SupportedTransportsTests.cs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SupportedTransports to 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.

Comment on lines +35 to 37
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.
@Scriptwonder
Scriptwonder merged commit 334f3c0 into CoplayDev:beta Jul 28, 2026
4 of 7 checks passed
@Scriptwonder
Scriptwonder deleted the fix/1193-codex-stdio-only branch July 28, 2026 18:41
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.

[Bug]: Codex Desktop does not expose MCP tools from MCP for Unity HTTP server on Windows 11

2 participants