You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A thread waiting on the user stays in Working while its PR watch is still on
#18787
When agents first got watch_pull_request (#15057), a watched thread returned to the inbox each time its turn ended. The Working section (#13926) folded away only threads that were running.
#16204 changed that. A pull request watch now counts as background work, so a watched thread stays in Working with a "Waiting" status between wakes. That fixed threads bouncing between the inbox and Working on every wake.
Problem
The watch wakes the agent when the branch starts to conflict with its base. Some conflicts are not the agent's to finish. Resolving one needs a rebase and a force push, and a force push can need the user's approval. The agent resolves the conflict locally, asks in plain text whether to push, and ends its turn.
The watch is still on, so the thread is still in Working. The Working section is collapsed and holds threads that need nothing from the user. The user does not see the question, and does not learn that the pull request conflicts. The pull request stays conflicted until the user happens to open that thread.
The same happens for any wake that ends with the agent waiting on the user, such as a failed check whose fix needs a decision.
Why
A watched thread leaves Working when the watch ends. Per #16204, that is when the agent calls unwatch_pull_request, the pull request merges or closes, the watch gives up, the agent asks a question, or the run fails.
A question written as plain text does not end the watch. The only guard is the instruction to call unwatch_pull_request before handing the work back. The same wake message says that T3 Code keeps watching, so an agent can end its turn without seeing that it has handed the work back.
Proposal
Tell the agent what to do when it must wait on the user. Where agents are told to unwatch before handing the work back, add this: if the next step needs the user's approval, call unwatch_pull_request before asking, and call watch_pull_request again after the user answers and the step is done.
The thread then returns to the inbox while it waits on the user, and the agent is woken again once the work continues.
Implementation
I would like to implement this myself, and I can open a PR if you approve the direction.
Keep monitored threads out of the Working section #16980 asks to move a thread that only waits on a monitor out of the Working section. This proposal is narrower. It leaves the section as it is and covers only a thread whose agent is waiting on the user.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
When agents first got
watch_pull_request(#15057), a watched thread returned to the inbox each time its turn ended. The Working section (#13926) folded away only threads that were running.#16204 changed that. A pull request watch now counts as background work, so a watched thread stays in Working with a "Waiting" status between wakes. That fixed threads bouncing between the inbox and Working on every wake.
Problem
The watch wakes the agent when the branch starts to conflict with its base. Some conflicts are not the agent's to finish. Resolving one needs a rebase and a force push, and a force push can need the user's approval. The agent resolves the conflict locally, asks in plain text whether to push, and ends its turn.
The watch is still on, so the thread is still in Working. The Working section is collapsed and holds threads that need nothing from the user. The user does not see the question, and does not learn that the pull request conflicts. The pull request stays conflicted until the user happens to open that thread.
The same happens for any wake that ends with the agent waiting on the user, such as a failed check whose fix needs a decision.
Why
A watched thread leaves Working when the watch ends. Per #16204, that is when the agent calls
unwatch_pull_request, the pull request merges or closes, the watch gives up, the agent asks a question, or the run fails.A question written as plain text does not end the watch. The only guard is the instruction to call
unwatch_pull_requestbefore handing the work back. The same wake message says that T3 Code keeps watching, so an agent can end its turn without seeing that it has handed the work back.Proposal
Tell the agent what to do when it must wait on the user. Where agents are told to unwatch before handing the work back, add this: if the next step needs the user's approval, call
unwatch_pull_requestbefore asking, and callwatch_pull_requestagain after the user answers and the step is done.The thread then returns to the inbox while it waits on the user, and the agent is woken again once the work continues.
Implementation
I would like to implement this myself, and I can open a PR if you approve the direction.
Related
watch_pull_request.All reactions