fix: ensure output of codex-rs/mcp-types/generate_mcp_types.py matches codex-rs/mcp-types/src/lib.rs #3439
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.
#3395 updated
mcp-types/src/lib.rs
by hand, but that file is generated code that is produced bymcp-types/generate_mcp_types.py
. Unfortunately, we do not have anything in CI to verify this right now, but I will address that in a subsequent PR.#3395 ended up introducing a change that added a required field when deserializing
InitializeResult
, breaking Codex when used as an MCP client, so the quick fix in #3436 was to make the new fieldOptional
withskip_serializing_if = "Option::is_none"
, but that did not address the problem thatmcp-types/generate_mcp_types.py
andmcp-types/src/lib.rs
are out of sync.This PR gets things back to where they are in sync. It removes the custom
mcp_types::McpClientInfo
type that was added tomcp-types/src/lib.rs
and forces us to use the generatedmcp_types::Implementation
type. Though this PR also updatesgenerate_mcp_types.py
to generate the additionaluser_agent: Optional<String>
field onImplementation
so that we can continue to specify it when Codex operates as an MCP server.However, this also requires us to specify
user_agent: None
when Codex operates as an MCP client.We may want to introduce our own
InitializeResult
type that is specific to when we run as a server to avoid this in the future, but my immediate goal is just to get things back in sync.