Skip to content

fix: preserve tool identity in permission requests - #759

Open
ruixingshi wants to merge 2 commits into
agentclientprotocol:mainfrom
ruixingshi:codex/fix-permission-tool-identity
Open

ruixingshi wants to merge 2 commits into
agentclientprotocol:mainfrom
ruixingshi:codex/fix-permission-tool-identity

Conversation

@ruixingshi

Copy link
Copy Markdown

Permission clients cannot reliably route or apply policy to approvals when only display labels or call IDs are present. This makes permission requests self-contained while keeping the existing approval decisions and MCP correlation rules.

Closes #553.

  • Emit stable operation names on command, file-change, MCP and plan approvals, and on their originating tool calls. Explicit stdin approvals use write_stdin.
  • Preserve the uniquely correlated MCP item's {server, tool, arguments} and MCP marker in the permission request. Reuse the existing prompt-scoped correlation state; do not guess a tool when several calls match.
  • Provide file-change paths and operation kinds in rawInput without duplicating diffs. Document unavailable stdin bytes and unmatched-call behavior.
  • Update existing assertions/snapshots for the new wire fields; no new test framework or suite.

Validation

  • npm run typecheck, npm run build, git diff --check pass.
  • Real Codex ACP v1 smoke in an isolated home/workspace: read-only, one list_agents MCP call, permission granted only when its structured identity matched, call completed.
  • Existing non-integration suite: 2,502 passed, 4 failed, 39 skipped. The four local failures also reproduce on unmodified upstream commit 9b2a785: one macOS symlink-cleanup error in session-index and three existing subagent event-order/terminal snapshots. Their unrelated expected-output changes are not included.

This is independent of #758: that PR fixes the required ACP v2 permission prompt title; this PR fixes tool identity. Correlated MCP approvals on v2 need both fixes. No client-side permission bypass, dependency patch, or version bump.

@EugeneTheDev
EugeneTheDev self-requested a review November 16, 2026 10:57

This branch has not been deployed

No deployments
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.

Permission requests should carry toolCall.name for every approval kind (file change, MCP, non-unified-exec commands)

1 participant