Skip to content

fix(tui): preserve underscored MCP server names#2747

Draft
cyq1017 wants to merge 1 commit into
Hmbown:mainfrom
cyq1017:codex/2744-mcp-underscore
Draft

fix(tui): preserve underscored MCP server names#2747
cyq1017 wants to merge 1 commit into
Hmbown:mainfrom
cyq1017:codex/2744-mcp-underscore

Conversation

@cyq1017
Copy link
Copy Markdown
Contributor

@cyq1017 cyq1017 commented Jun 4, 2026

Refs #2744

Summary

  • match known MCP server names before splitting the generated tool suffix
  • prefer the longest matching server name so mcp_my_db_execute_sql routes to my_db
  • add regression coverage for underscored server names and overlapping server prefixes

Verification

  • cargo test -p codewhale-tui mcp_pool_call_tool -- --nocapture
  • cargo check -p codewhale-tui
  • rustfmt --edition 2024 --check crates/tui/src/mcp.rs
  • git diff --check

Note: local macOS verification used CommandLineTools clang/SDK explicitly because the default Xcode.app cc lookup is currently hanging on this machine.

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

cyq1017 has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 4, 2026

Thanks @cyq1017 for taking the time to contribute.

This repository is currently observing a maintainer-managed contribution gate in dry-run mode, so this pull request is staying open. When enforcement is enabled, pull requests from contributors who are not listed in .github/APPROVED_CONTRIBUTORS will be closed automatically.

Please read CONTRIBUTING.md for the expected contribution shape. A maintainer can grant PR access by commenting /lgtm on a pull request.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the parse_prefixed_name function in crates/tui/src/mcp.rs to correctly parse MCP tool names when the server name contains underscores. It achieves this by matching the prefix against known server names from connections and configuration, preferring the longest match, and falling back to the previous split-on-underscore behavior if no match is found. Additionally, two unit tests have been added to verify this behavior. There are no review comments to address, and I have no additional feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

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.

1 participant