Skip to content

Codex can show the wrong MCP call when two calls to one server are in flight #368

Closed

Description

@saucam

Codex can show the wrong MCP call when approving, if two calls to one server are in flight

When codex asks to approve an MCP tool call, codeoid works out which call it is by the MCP server's name alone. If codex has two calls to the same server in flight, say a delete_repo and a get_issue on one GitHub server, the approval can show the other call's tool and input.

The web UI's approval card and codeoid approve would then ask you to approve something different from what codex actually runs.

This is the same class of bug #366 fixed for the qwen backend, which matched by tool name only.

Expected: the approval is tied to the exact call codex is holding. When codeoid can't tell, it refuses to show a possibly wrong input ("ambiguous: attach to review") or denies.

For agents
  • src/daemon/providers/codex/index.ts: #pendingMcpCalls is keyed by item.server (around :630), so a second mcpToolCall to the same server overwrites the first. The elicitation handler (around :764-772) then gates whatever input is stored under that server name.
  • Suggested fix: key by itemId if the elicitation carries one. Otherwise keep a list per server and refuse to show an input, or deny, when more than one call is pending for that server.
  • Test: two parallel mcpToolCall items to one server followed by an elicitation for the first. The gated input must be the first call's, or the approval refused.

Activity

  1. added 2 commits that reference this issue on Oct 11, 2026
    f75b515
    02c8c5e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions