Repository navigation
fix: keep a Run waiting when one of several open approvals is cancelled - #2053
Merged
Merged
Conversation
4pmtong
marked this pull request as ready for review
October 15, 2026 04:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Related Issue
Description
Problem. When a task was waiting on two approvals at once (for example parallel workers asking at the same time) and one of them was cancelled because its tool could no longer run, the app treated the whole task as interrupted, although it was still waiting for the other approval:
Cause. When an approval is answered, the backend reports how many requests are still open, and the app keeps the task waiting while that number is above zero. When an approval is cancelled this way, the backend keeps the task waiting if other requests are open, but it did not report the number, so the app always read the cancellation as the end of the wait.
Fix.
Testing Evidence (REQUIRED)
Backend: with two pending approvals, cancelling one reports one open request and the task stays waiting; with a single approval it reports none and the task is interrupted as before.
Chat view, with a live task: work 2s, two approvals, one cancelled after 10s, the other approved 10s later, work 3s. The task stays running and the timer reads 2s through the wait and 5s at the end.
Experimental timeline view, same sequence with a 30s and a 10s wait: 2s, 2s, 2s, 5s.
Run status: the task stays waiting after the cancellation and runs again after the remaining approval, with the whole 48s counted as waiting; a cancellation with nothing left open, or without the count, still interrupts it.
Chat view cards: with two approval cards, cancelling the one on screen shows the other, and cancelling the one still waiting in line removes it from the line; the task keeps running.
Stopping a task while an approval is open ends it as cancelled, not interrupted.
Without the change, the new backend and app tests fail. The related timer, timeline and run journal tests, type checking, ESLint, Prettier and ruff pass.
I have included human-verified testing evidence in this PR.
This PR includes frontend/UI changes, and I attached screenshot(s) or screen recording(s).
No frontend/UI changes in this PR.
What is the purpose of this pull request?
Contribution Guidelines Acknowledgement