Skip to content

Answered chat approval reappears as a ghost card in the background-approval deck #6799

Closed

Description

@M3gA-Mind

Summary

After a chat approval card is answered, the same approval can reappear as a second card in the background-approval deck above the composer. Clicking that card fails with no pending approval found for request_id '…' (already decided or expired) and "Could not record your decision".

Reproduction

  1. In a chat, trigger a tool that needs approval (e.g. GOOGLECALENDAR_CREATE_EVENT with it removed from the always-allow list).
  2. Leave the chat card up long enough for the background poll (approval_list_pending, every 15 s) to run — a page reload triggers one immediately.
  3. Deny (or approve) on the chat card.
  4. A second "Approval needed" card for the same request appears above the composer. Deciding it fails with "already decided".

Observed 2026-09-30 on main: decision recorded at 14:45:58, three failing approval_decide calls on the ghost card at 14:46:00–02 ([rpc:approval_decide] no pending approval found (already decided/expired — benign race)).

Cause

useUnroutedApprovals shows every polled pending row that is not currently in chatRuntime.pendingApprovalByThread. Deciding from a chat card clears that entry immediately (clearPendingApprovalForThread), but the polled rows keep the park until the next poll, so for up to 15 s the answered park matches the "unrouted" filter and is rendered again.

Expected

A park that a chat card has shown is never treated as unrouted; the deck only shows parks with no chat thread and no flow.

Activity

  1. self-assigned this
    on Sep 30, 2026
  2. added
    priority: p2Soon. Real but survivable — a rough edge, a gap, a thing that will bite later.
    on Sep 30, 2026
  3. tinysweeper commented on Sep 30, 2026

    @tinysweeper

    Answered chat approval reappears as a ghost card in the background-approval deck due to timing in useUnroutedApprovals

    Labelled priority: p2.

  4. added theissue type on Sep 30, 2026
  5. added a commit that references this issue on Sep 30, 2026
    0b9606c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority: p2Soon. Real but survivable — a rough edge, a gap, a thing that will bite later.

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions