[Bug]: MCP "Always allow this session" approves a different request whose message text matches
[!NOTE] 🤖 Claude Opus 5.5 on behalf of JarenKempton
Before submitting
- [x] I searched existing issues and did not find a duplicate.
- [x] I included enough detail to reproduce or investigate the problem.
Area
- [x] apps/server
Steps to reproduce
- On a Claude thread, use an MCP server that confirms each write with an empty-schema form elicitation (
requestedSchema: { type: "object", properties: {} }). - The agent calls a write tool. The confirm card appears; choose Always allow this session.
- The agent makes the same write again as a new operation (new idempotency key, same confirmation text).
- The agent makes a write whose confirmation text differs.
Expected behavior
A session grant doesn't approve a new operation the user hasn't seen. The grant exists for servers that ask on every call, such as Computer Use, not for one-off write confirmations.
Actual behavior
Step 3 shows no card: T3 sends accept and the server creates a second record. Step 4 still shows a card. The grant is keyed on server name plus message text (grantKey in ClaudeAdapterV2.ts), so any request with identical text is auto-accepted.
Impact
- [x] Minor bug or occasional failure
Version or commit
T3 Code 0.1.11-nightly.20261117.4838, Claude Code 2.1.327
Environment
Linux, Claude provider (claudeAgent), local stack of the MCP server under test; no production data.
Workaround
Don't use "Always allow this session" on MCP write confirmations. Possible fixes: offer the grant only for allow-style forms, or key it on something the server marks as repeatable.