Skip to content

fix(web): approvals query polls while the chat's agent is live (CL-8499) - #897

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-8499-approvals-poll
Sep 18, 2026
Merged

TheGreatAxios merged 1 commit into
mainfrom
cl-8499-approvals-poll

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

What

Add an optional { refetchInterval } option to useAPIQuery (apps/web/src/api.ts), threaded through usePendingApprovals (apps/web/src/pending-approvals.ts). Chat thread and Workbench Room pages now poll the approvals query every 3s while the relevant agent is live, and stop polling once it isn't.

Why

GET /api/tenants/:t/approvals is not a mailbox event, so the SSE inbox subscription never invalidates the approvals query. A pending approval only showed up after a manual page reload.

Verified

  • bunx tsc -p apps/web --noEmit
  • bun run lint
  • bun run fmt
  • cd apps/web && bun run build
  • cd apps/web && bun test ./src (582 pass)

@linear-code

linear-code Bot commented Sep 18, 2026

Copy link
Copy Markdown

CL-8499

@TheGreatAxios
TheGreatAxios merged commit 5e3e471 into main Sep 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant