Repository navigation
fix(orchestration): port T3 Stop cascade and PR watch fixes - #11
Merged
Merged
Conversation
When the provider rejects or times out the interrupt, Stop no longer returns refused and leaves the run active forever. It emits turn_canceled, settles the run, resolves pending permissions and keeps partial output, then abandons the turn so a late provider event cannot revive or fail the stopped agent. Replace, reload and rewind still refuse.
…tches Port of T3 #16002. Stopping an agent now drops every open delegation cohort and queued wake of the agent even while it is idle waiting on children, ends its pull request watches, and walks its live Paseo descendants depth first: each holds its queue, drops its cohorts and watches, and cancels its run, and one failure does not stop the walk. A user_stop hold now covers an empty queue, so system messages (wakes, PR-watch news, permission notices) queue instead of starting a turn until the user resumes or writes. create_agent and watch_pull_request from a run Stop reached fail with AgentRunStoppedError.
Port of T3 #16335 task_cancel. cancel_agent now reuses the Stop cascade: besides dropping the caller's results for the child, it holds the child's queue, ends its watches and cancels its run, then walks its live descendants the same way, including the running grandchildren of a child that already finished.
…eady passed Track the head commit and the passed required check names on each watch. A push resets the check state, so a push whose checks all finish within one pass still wakes the agent, and a required check that shows up already passed wakes again. Watches saved before these fields adopt the current head without a wake. Ported from pingdotgg/t3code#15804, with the required-only re-wake from #16208.
Read lastEditedAt for timeline comments, reviews, and review-thread comments, and count a remark's activity time as its last edit, so a bot that rewrites its summary comment still wakes the agent. Edits count toward the comment-only wake limit. Ported from pingdotgg/t3code#15415.
- Read each watched pull request once per pass for every agent watching it, grouped by URL, instead of once per watch. - Read a pull request with nothing in flight every two minutes; keep the one-minute cadence while a check runs, mergeability is unknown, or the remarks could not be read. - A rate limit skips the rest of the pass and never counts toward giving up. Required-check and viewer reads no longer swallow a rate limit. - Give up after 8 failed reads in a row instead of 15 minutes of failures. - A subagent cannot watch, since its parent owns the pull request; a watch left on one ends on the next pass. Ported from pingdotgg/t3code#16208.
Each ended watch writes one info line, pull_request_watch.ended, with the reason (merged, closed, unreadable, comment-limit, unwatched, archived, subagent, stopped), minutes alive, minutes since the last push, the longest stretch without a push, wakes, and successful reads. Tracking is in memory, so a watch older than the daemon is marked partial. Ported from pingdotgg/t3code#16262.
Paseo children often open their own pull request, and Stop now cascades to their watches, so the T3 rule that only parents may watch is not needed.
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.
Ports the orchestration fixes T3 Code shipped after 2026-10-04 (pingdotgg/t3code#16002, #16335, #15442, #15804, #15415, #16208, #16262) onto Paseo's own stores.
Stop and cancel
user_stop, wakes, PR-watch news and permission notices queue instead of starting a turn. That hold is in memory only, so after a daemon restart a wake can start the agent again (same as today's restart behavior).create_agent/watch_pull_requestfrom a run Stop already reached fail withAgentRunStoppedError.cancel_agentstops the child's whole subtree.Pull request watch
pull_request_watch.endedinfo log per watch.No protocol changes. Docs: agent-lifecycle.md, data-model.md.
Tests: stop, agent-manager, delegation, agent-queue runner, message-dispatch, mcp-server, pull-request-watch, github-service, lifecycle-command. The 6 orchestration-instructions failures in agent-manager.test.ts and the 9 in session.test.ts also fail on main.