Agent pane: an answer to one ask never revokes another ask's gesture ticket

Merged
TE
3d ago
+60-5

What broke

On 2026-10-21, while a folder trust question was open, Leo answered an agent's question card (AskUserQuestion) and got "Couldn't send your answer. Try again. approve this on the Mac app: allowing a permission is accepted only from the cmux app, never from the CLI, a script or an agent". He asked: "WTH COULD IT POSSIBLY RESUME WTH KIND OF RESTRICTION IS THAT IT F***ING SHULDNT BE WTFFFF".

The main causes are already fixed on base: #25424 and #25440 bind a question's answers into the relayed proof, and #25022 fixed a lost person-key enrollment. One gap is left in the host. AgentPaneGestureIntent.slot kept one _acpmux/permission_respond ticket per connection. When an answer to a second ask was reserved before the first answer's frame went out, it revoked the first ask's ticket. The first answer then went to another machine's acpmux unproved, and acpmux refused it with that same message.

The fix

  • slot keys _acpmux/permission_respond by its permissionId (_acpmux/permission_respond#<permissionId>), the way #29745 keys prompts by promptId. A newer answer to the same ask still replaces the older one.
  • Each connection keeps at most 8 answer tickets (permissionTicketsKept), dropping the oldest, like prompt tickets.
  • Redeem is unchanged: a ticket is still single-use and must match its exact pick (session, permission, option, answers).

Tests

AgentPaneRelayedAllowTests.answersToTwoAsksReservedBackToBackKeepTheirOwnTickets. The red commit 67774b50cb5 adds the two-asks case and the same-ask replacement; the fix adds the cap check. The PR's CI compile and test jobs are the check: this lane's host can't run a compile check.

Risk

Low, next to the trust boundary. A ticket still needs a real click and still covers only its own exact answer. The only change is that answers to different asks no longer revoke each other, and their number stays bounded.

Rule this serves (Leo, P0, 2026-10-21): a pending folder trust question must never block steering, sending, or answering a question. Follows #32074.

šŸ¤– Generated with Claude Code

Agent session: agent session


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Fixes an Agent pane bug where answering one ask revoked another ask's permission answer ticket, so the first answer went out unproved and acpmux refused it.

  • Keys _acpmux/permission_respond tickets by permissionId so each ask keeps its own ticket; a newer answer to the same ask still replaces the older one.
  • Caps answer tickets at 8 per connection, dropping the oldest.