Parallel tool calls that both hit an ask permission rule leave one prompt invisible and the turn hanging #12
Labels
No labels
Agent
Ignore
Agent
In Progress
Agent
Planned
Agent
Planning
Agent
Ready
Agent
Triage
Compat
Breaking
Kind
Bug
Kind
Documentation
Kind
Enhancement
Kind
Feature
Kind
Security
Kind
Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lucas/omp-deck#12
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Observed
In a chat session the agent issued two
bashcalls in the same turn, running in parallel:bun test src/prompts/system-prompt.test.tsandbun run typecheck. The typecheck finished in about 7 s. The test call didn't run: the turn appeared stuck for about 6 minutes until the user cancelled, and the tool result wasTool call denied … Permission request cancelled. On retry, the same command, issued on its own, passed in 1.6 s.Likely cause (from the code, sequence not reproduced)
The server supports several pending prompts per session, but the web client keeps only one:
apps/server/src/bridge/permission-filter.ts:pending/pendingFramesareMaps keyed bytoolCallId, so each concurrent call gets its own pending prompt and waits for atool_permission_responsefor that exacttoolCallId.apps/server/src/bridge/permission-filter.tsgetPendingFrame()returns only the first pending frame for the session snapshot.apps/web/src/lib/store.ts:pendingPermissionPromptsisRecord<sessionId, frame>. A secondtool_permission_promptframe for the same session overwrites the first (case "tool_permission_prompt"), andrespondToPermissiondeletes the session's entry after answering one.apps/web/src/components/chat/ToolPermissionDialog.tsxrenderspendingPermissionPrompts[activeId], so at most one dialog is shown.Result: when two calls hit an
askrule at the same time, one prompt is never shown. Its tool call blocks until the turn is aborted. This also happens after a reload, because the snapshot carries only one frame.Expected
Every pending permission prompt is visible and answerable: queued one after another, or shown together. Answering one must not drop the others, and a reload must restore all of them.
Acceptance
askrule produce two answerable prompts. Approving or denying each one resolves its own call.