Client or integration
Other — Pi coding agent (pi CLI) using OpenCodex as an OpenAI Chat Completions custom provider.
Area
Provider adapter
Summary
When Pi uses opencodex/cursor/grok-4.6, a Cursor-display MCP alias can be returned to Pi as the literal tool-call name instead of the request-declared Pi tool name.
For a Pi request that declares only grep, Cursor/Grok can return:
mcp_opencodex-responses_grep
Pi has no tool with that name. The turn stops after displaying the tool call and never executes grep or receives a tool result.
The expected client-facing name is the original request-declared name:
This is not a request to permit undeclared tools. The long Cursor display alias should be normalized to the declared Responses/Pi tool name before OpenCodex emits the client-facing tool call.
Reproduction
-
Run OpenCodex on loopback and configure Pi with the generated opencodex provider using api: "openai-completions".
-
Start Pi with the Cursor-routed Grok model and allow only grep:
pi --model opencodex/cursor/grok-4.6:high --tools grep --no-session
-
Ask the model to search the current directory with grep. A normal call can succeed and is displayed by Pi as:
-
In the same Pi session, ask it to use the Cursor-side long display alias for the only available grep tool (or wait for Cursor to choose that display form).
-
Pi receives the following instead of its declared tool name:
[TOOL_CALL]mcp_opencodex-responses_grep[ARGS]{"pattern":"OpenCodex"}
-
No normal grep execution/result follows. The turn is effectively blocked because Pi cannot dispatch a tool named mcp_opencodex-responses_grep.
The test was intentionally limited to one declared tool, so no unrelated tool catalog or MCP server was involved in the failure.
Version
OpenCodex: 2.28.0
Pi: 0.84.2
Operating system
Provider and model
provider: cursor
model: grok-4.6
OpenCodex selector: cursor/grok-4.6
reasoning effort: high
adapter: cursor
Logs or error output
Pi transcript from the failing turn:
Thinking...
長い表示別名の grep を1回だけ呼び出して、現在の作業ディレクトリを検索します。
[TOOL_CALL]mcp_opencodex-responses_grep[ARGS]{"pattern": "OpenCodex"}
The adjacent control turn in the same Pi session completed with the ordinary declared tool name:
OpenCodex recorded the requests as successful Cursor-adapter requests (provider: cursor, model: grok-4.6, adapter: cursor, HTTP status 200). The failure occurs on the tool-name translation returned to Pi, not at the upstream HTTP request boundary.
Redacted configuration
Pi provider shape:
{
"providers": {
"opencodex": {
"baseUrl": "http://127.0.0.1:10100/v1",
"api": "openai-completions",
"apiKey": "opencodex-loopback"
}
}
}
Relevant existing behavior
The Cursor adapter already has display-name normalization for the mcp_opencodex-responses_ prefix. The observed Pi result indicates that at least one Cursor return path emits the display alias without applying that normalization to generic client tools such as grep.
The existing normalization currently appears intended to fold the display name back to the advertised wire name:
mcp_opencodex-responses_grep -> grep
Please apply the same invariant to every Cursor client-tool return path before emitting a Responses/Chat Completions tool call to the downstream client, and add a regression test with a non-shell generic tool such as grep.
Related issues
Checks
Client or integration
Other — Pi coding agent (
piCLI) using OpenCodex as an OpenAI Chat Completions custom provider.Area
Provider adapter
Summary
When Pi uses
opencodex/cursor/grok-4.6, a Cursor-display MCP alias can be returned to Pi as the literal tool-call name instead of the request-declared Pi tool name.For a Pi request that declares only
grep, Cursor/Grok can return:Pi has no tool with that name. The turn stops after displaying the tool call and never executes
grepor receives a tool result.The expected client-facing name is the original request-declared name:
This is not a request to permit undeclared tools. The long Cursor display alias should be normalized to the declared Responses/Pi tool name before OpenCodex emits the client-facing tool call.
Reproduction
Run OpenCodex on loopback and configure Pi with the generated
opencodexprovider usingapi: "openai-completions".Start Pi with the Cursor-routed Grok model and allow only
grep:Ask the model to search the current directory with
grep. A normal call can succeed and is displayed by Pi as:In the same Pi session, ask it to use the Cursor-side long display alias for the only available
greptool (or wait for Cursor to choose that display form).Pi receives the following instead of its declared tool name:
No normal
grepexecution/result follows. The turn is effectively blocked because Pi cannot dispatch a tool namedmcp_opencodex-responses_grep.The test was intentionally limited to one declared tool, so no unrelated tool catalog or MCP server was involved in the failure.
Version
Operating system
Provider and model
Logs or error output
Pi transcript from the failing turn:
The adjacent control turn in the same Pi session completed with the ordinary declared tool name:
OpenCodex recorded the requests as successful Cursor-adapter requests (
provider: cursor,model: grok-4.6,adapter: cursor, HTTP status 200). The failure occurs on the tool-name translation returned to Pi, not at the upstream HTTP request boundary.Redacted configuration
Pi provider shape:
{ "providers": { "opencodex": { "baseUrl": "http://127.0.0.1:10100/v1", "api": "openai-completions", "apiKey": "opencodex-loopback" } } }Relevant existing behavior
The Cursor adapter already has display-name normalization for the
mcp_opencodex-responses_prefix. The observed Pi result indicates that at least one Cursor return path emits the display alias without applying that normalization to generic client tools such asgrep.The existing normalization currently appears intended to fold the display name back to the advertised wire name:
Please apply the same invariant to every Cursor client-tool return path before emitting a Responses/Chat Completions tool call to the downstream client, and add a regression test with a non-shell generic tool such as
grep.Related issues
shell_command/exec_commandand native-exec rejections. It does not cover Pi receivingmcp_opencodex-responses_grepas a tool name.mcp_opencodex-responses,opencodex-responses_grep, Pi/Cursor tool calls, and Cursor tool aliases before filing.Checks