Skip to content

Claude approval card stays pending after a PermissionRequest hook answers, holding back the next message #6966

Closed

Description

@Johannes-Berggren

Summary

With a Claude Code PermissionRequest hook that allows a tool, the tool runs at once, but bb's approval card for that call stays pending. The turn finishes normally, then the thread's next message is queued until someone resolves a card for a call that has already finished. I expected the card to close when Claude cancels the permission request.

Versions and environment

  • bb 0.46.1 (desktop app), macOS 27.0.1
  • claude-code, claude 2.1.316
  • Worktree environment, bb Connect in use

Not reproduced on the latest release. 0.48.1 is out, but the in-app update here failed with "Download failed. Update again to retry." The code path below is unchanged on main at d083003e469db9fa4b85d6abe56519e0e034b25f, by reading only.

Steps to reproduce

  1. Add a hook script and make it executable:

    #!/bin/sh
    cat >/dev/null
    printf '%s\n' '{"hookSpecificOutput":{"hookEventName":"PermissionRequest","decision":{"behavior":"allow"}}}'
  2. Register it in ~/.claude/settings.json:

    {"hooks":{"PermissionRequest":[{"matcher":"mcp__.*","hooks":[{"type":"command","command":"/path/to/hook.sh"}]}]}}
  3. Have any MCP server connected with a tool that is not annotated read-only. I used Linear's whoami.

  4. Start a thread in plan mode, where such calls prompt even with --permission-mode full:

    bb thread spawn --project <project> --provider claude-code --permission-mode full --plan \
      --prompt "Call mcp__linear__whoami once and reply in one line. No plan, no questions, no ExitPlanMode."
  5. When the thread goes idle, run bb thread interactions list <thread>.

  6. Run bb thread tell <thread> 'Reply OK.'

Did not reproduce with: MCP tools annotated read-only, such as Linear's list_teams. They raise no prompt in plan mode, so no card appears.

Expected vs actual

Expected: the card closes when Claude cancels the request, and the next message dispatches.

Actual: the call completes, the thread is idle, and the card is still pending:

  bb thread list --json   -> {"status":"idle","hasPendingInteraction":true}
  bb thread tell          -> Thread thr_8jajf3wgfc message queued (waiting for a pending interaction); it dispatches when that clears

Granting the stale card with `bb thread interactions grant <id> <thread> --scope turn` dispatches the queued message.

Evidence

Timing from driving claude directly over stream-json with the same flags bb uses, and delaying the answer to the permission request by 8 seconds:

5.1 PROMPT mcp__linear__whoami        (can_use_tool control_request)
5.1 HOOK hook_started
5.3 HOOK hook_response {"hookSpecificOutput":{"hookEventName":"PermissionRequest","decision":{"behavior":"allow"}}}
5.3 PROMPT CANCELLED                  (control_cancel_request)
5.6 OK  tool result returned

So Claude raises the prompt and starts the hook together, then cancels the prompt when the hook answers.

In one bb test thread, five sequential MCP calls, none annotated read-only, left five pending cards while every call completed.

Observed thread ids (archived, on my machine): thr_8jajf3wgfc, thr_h8auv2fhkr.

Likely cause (from reading the code, not confirmed by a fix): the bridge's abort handler removes its local waiter and resolves the request, but sends nothing to bb, so the interaction row stays pending:

const onAbort = (): void => {
if (!threadSession.pendingInteractiveRequests.delete(requestId)) {
return;
}
finish({
behavior: "deny",
message: "Interactive request cancelled",
toolUseID: args.toolUseId,
});
};

#4697 described this same gap for native question and permission requests and was closed unmerged on 2026-10-02, with no reason on the PR.

What you ruled out

  • Not an existing issue: searched open and closed issues for the hook, stale interactions, control_cancel_request and notifications/cancelled. Close cancelled Claude question forms #4697 is the only match, and it is a PR.
  • Not a failed tool call: the calls completed and their results reached the agent.
  • Not cleared by time or by sending a message: the card stayed pending and the message stayed queued until it was granted.

Suggested priority and effort

Medium. It affects anyone using a PermissionRequest hook with the Claude provider, and blocks the thread's next message until the card is cleared. Workaround: have the hook also grant pending MCP cards through bb thread interactions grant. No data loss. #4697 may be a useful starting point.

Checks

  • I reproduced this on the latest release or on main, or I say above that I could not.
  • I searched open and closed issues for the same problem.
  • If an agent wrote this, the body ends with > AGENT GENERATED and links the thread or report.

Produced in bb thread thr_n4c3efsc2w (local to my machine, so not linkable).

AGENT GENERATED

Activity

  1. added theissue type on Nov 3, 2026
  2. added
    providers
    provider-claude-code
    partial-repro
    on Nov 3, 2026
  3. bb-slop-cop commented on Nov 3, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · Priority: Medium · Effort: Medium. Added providers and provider-claude-code; preserved existing values.
    • Report: https://get-bb.github.io/reports/issues/6966.html
    • Verdict: PARTIALLY REPRODUCED · Confidence: high for the bridge cancellation gap. The focused regression fails identically in two clean trusted-main checkouts; the live hook, desktop card, and queued follow-up were not exercised.
    • Root cause: SDK cancellation removes the bridge's local approval waiter without notifying bb's separately tracked interaction lifecycle.
    • Reproduction label: partial-repro.
    • No PR: a safe fix needs a correlated cancellation contract across provider, runtime, daemon, and server, exceeding the rule's single-subsystem/no-public-protocol-change limits.

    AGENT GENERATED

  4. added 3 commits that reference this issue on Nov 18, 2026
    baf709f
    fc951a9
    2854f85
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

    partial-reproprovider-claude-codeproviders

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions