Skip to content

fix(web): re-read open decisions when a run parks on an approval - #64

Closed
brianjfox wants to merge 1 commit into
mainfrom
fix/poll-open-decisions
Closed

brianjfox wants to merge 1 commit into
mainfrom
fix/poll-open-decisions

Conversation

@brianjfox

Copy link
Copy Markdown
Contributor

Closes #62

What changed

  • apps/web/src/pages/workspace/agent-activity.tsx gains useProjectRunStates, which polls the project's run states every 5 seconds while any run is live (10 seconds otherwise), and heldOnApproval, which folds the runs in the approval state into one string an effect can depend on.
  • apps/web/src/pages/workspace/index.tsx depends on that string in the effect that reads the open decisions, so the decision card appears within one poll of a specialist parking on an approval. The room reload still triggers it as before.

The run-states endpoint already reports approval for a run whose latest event is a park on an approval; the live-app pane polls it for the same reason, so no hub change is needed.

Why

A coder parked on an install_packages approval raises no room event. The page read the open decisions only on a room reload, so the "wants to install" card never appeared until the person reloaded the page, while the coder waited on them for as long as that took.

How it was verified

  • ./node_modules/.bin/tsc --noEmit -p apps/web passes.
  • bun --conditions=intx-src test apps/web/src/pages/workspace passes (20 tests).
  • oxlint --deny-warnings and Prettier pass on the changed files.

A coder's package request raises no room event, so the workspace page
read the open decisions only on a room reload and the person saw no card
until they reloaded the page, while the coder waited on them.

Poll the project's run states while any run is live and read the open
decisions again whenever the set of runs held on an approval changes.

Closes #62

@corbits-triage corbits-triage Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Triage requests changes:

  • Conventions: added code matches a code pattern

@brianjfox

Copy link
Copy Markdown
Contributor Author

Continued, rebased onto main (which now reads open decisions through TanStack Query), with the triage finding fixed, in a replacement pull request from branch fix/poll-open-decisions-main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Coder package approvals never appear until the page is reloaded

1 participant