Skip to content

Remove ToolName display helper#21465

Open
pakrym-oai wants to merge 9 commits intomainfrom
pakrym/toolname-display-formatting
Open

Remove ToolName display helper#21465
pakrym-oai wants to merge 9 commits intomainfrom
pakrym/toolname-display-formatting

Conversation

@pakrym-oai
Copy link
Copy Markdown
Collaborator

Why

ToolName::display() made it too easy to flatten tool identity and accidentally compare rendered strings. Tool identity should stay structural until a legacy string boundary actually requires the flattened spelling.

What

  • Removes ToolName::display() and relies on the existing Display impl for messages and errors.
  • Adds structural ordering for ToolName and uses it for sorting/deduping deferred tools.
  • Carries ToolName through tool/sandbox plumbing, flattening only at legacy boundaries such as hook payloads, telemetry tags, and Responses tool names.
  • Updates MCP normalization tests to assert ToolName structure instead of rendered strings.

Testing

  • cargo test -p codex-mcp test_normalize_tools
  • cargo test -p codex-core unavailable_tool
  • just fix -p codex-protocol
  • just fix -p codex-mcp
  • just fix -p codex-core

@pakrym-oai pakrym-oai force-pushed the pakrym/toolname-display-formatting branch 2 times, most recently from 9d0a925 to f459c83 Compare May 7, 2026 03:33
@pakrym-oai pakrym-oai marked this pull request as ready for review May 7, 2026 03:38
@pakrym-oai pakrym-oai requested a review from a team as a code owner May 7, 2026 03:38
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f459c8360d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread codex-rs/protocol/src/tool_name.rs
Base automatically changed from pakrym/mcp-toolname-exposure to main May 7, 2026 17:16
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.

2 participants