Repository navigation
Conversation
…ettles A watched PR that merged ended its watch with no message, and since upstream PR 26395 a merged PR's watch no longer held auto-settle. So the thread settled as soon as the PR sync stored the merged snapshot, and an agent that ended its turn planning post-merge work (check the deploy, open the next PR) never got another turn. A merge now wakes the agent once, like a close already did, on both the host-read and link-snapshot paths. A merged PR's watch holds auto-settle until that wake lands, and a refused wake ends the watch silently so it cannot hold the thread forever.
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
This branch has not been deployed
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.
an agent of mine queued a 2-PR stack on GitHub's merge queue (private work repo), called
watch_pull_requeston both, and ended its turn with "once the stack merges, i'll check that the deployed service includes both commits". the queue merged both. 21 seconds later T3 settled the thread and detached the agent's session. it never got another turn, and i only noticed ~4 hours later when i asked why the thread went quietwhat happened, from the thread's event log
(quotes trimmed to drop internal names)
merged. both links still have a livewatchthread.settledfromserver:auto-settle, sourceauto_pull_request_merged. settling also ends both watches and detaches the session ("Thread settled.")three things lined up:
PullRequestWatchReactorwakes the agent when a watched PR closes, but on merge it just didrecord(target, null), on both paths (its own host read, and the merged snapshot the sync reactor usually stores first). the watch result tells agents "T3 Code wakes you on the next change", so assuming a merge counts is pretty reasonablemerged, because of (1): the reactor would only end them silently on its next 2 min sweep anyway. so the moment the sync storedmergednothing held the threadfixing (3) alone wouldnt help. a held thread still never gets a turn because nothing wakes it
what changed
#N: merged, stopped watchingmergedexemption inpullRequestWatchTasks. without this the settle wins the race every time: it runs on the link update (3s after the sync here) while the reactor sweeps every 2 min, and the orchestrator refuses a wake on a settled thread ("The pull request watch ended or its thread settled while it was read."). once the wake commits, its run holds the thread. when that run ends the watch is gone and the normal settle path takes over, including the reply check, which now reads the post-merge replyfinishedfalls back to a silent end, same asgiveUpalready does. close shares the helper so it gets the fallback tooendsWithoutReadchecks settled and subagent threads beforemerged, since the orchestrator refuses wakes on thosedocs/user/source-control.mdsays a merge wakes the agent and holds the thread until thentradeoffs
every watched PR that merges now costs one more agent turn, including ones the agent merged itself mid-turn and ones you merged when the agent had nothing left to do. agents that hand back properly call
unwatch_pull_requestfirst and dont pay ita merged-and-watched thread sits in "Waiting on Watching pull request #N" for up to 2 min until the sweep wakes it, which is the wait 26395 removed. the difference is that the wait now ends in a turn instead of nothing
a stack that merges together wakes once per PR, so 2 turns for a 2-PR stack. the second is usually "already handled". batching per thread could be a follow-up
upstream has gone back and forth on this. 26395 picked silent merges. 26271 (open, the one julius said is being kept) and 25181 / 33201 (closed as dupes of it) wake on merge, and 26271 also skips the wake when the thread's own agent ran the merge command. i didnt port 26271, it's built on a newer reactor than ours. it also keeps the
mergedsettle exemption, so it'd still lose the race above. the upstream bug for that race (29896) was closed as not planned. when 26271 lands upstream, take theirs for the reactor and keep the settle hold from herefix(server): watched PRs wake the agent when they merge pingdotgg/t3code#26271
fix(server): wake agents when watched pull requests merge pingdotgg/t3code#25181
fix(server): watched PRs tell the agent when they merge pingdotgg/t3code#33201
[Bug]: Auto-settle on PR merge settles the thread before the agent hears that the PR merged pingdotgg/t3code#29896
proof
orchestrationV2PendingBackgroundWork.test.ts: the existing watch table now expects its merged row to hold. fails on main, passes hereruntimeLayer.test.ts, new case with 3 rows: merge seen by a host read, merge seen on the link snapshot, and a merge on a thread whose provider instance is gone. the first two fail on main (no wake). the third passes on main (silent end) and fails here if i take the fallback out (the watch stays on)derivePendingBackgroundWorkwith the latest run completed. main:[], holds auto-settlefalse, so it settles. this branch: both merged watch tasks, holdstruewritten with claude opus 5.5 in claude code