Skip to content

fix(server): a watched PR the merge queue drops wakes the agent - #88

Merged
maschwenk merged 1 commit into
mainfrom
fix/pr-watch-merge-queue-removal
Nov 16, 2026
Merged

maschwenk merged 1 commit into
mainfrom
fix/pr-watch-merge-queue-removal

Conversation

@maschwenk

@maschwenk maschwenk commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

when github's merge queue kicks a watched PR out (merge conflict with the queue, failed queue checks), the agent never hears about it. the PR stays open, its head, checks and comments don't change, so the watch's fingerprint never moves and evaluation has nothing to report. the agent's turn already ended with "waiting on the merge queue", so the PR just sits there until someone notices. merges already wake the agent; this is the other way out of the queue

what changed

  • the github detail read asks for the latest RemovedFromMergeQueueEvent (timelineItems(last: 1, itemTypes: [REMOVED_FROM_MERGE_QUEUE_EVENT])) and maps it to PullRequestDetail.mergeQueueRemoval (at, reason, by). github logs a removal with reason merged when the queue merges a PR, so that one maps to null
  • the watch fingerprint counts queue removals (filteredCount), so a removal changes status and triggers a detail read on the next sweep instead of waiting for the 30 min forced reread
  • a removal after the watch began wakes the agent once: - The merge queue took it out without merging: merge conflict., summary #N: left the merge queue, outcome failed. the watch stores mergeQueueRemovedAt so the same removal never wakes twice; a later one (requeued, dropped again) does. a removal from before the watch, or one the agent made itself, doesn't wake
  • both new fields are github.com only, gated with @include like isRequired, so enterprise reads don't change

checked

  • vp run check:changed: format, lint, knip, graphql, typecheck (36 packages), tests all pass
  • the new evaluator test fails on main's pullRequestWatch.ts and passes with this
  • ran both new query fragments against github.com with @include on and off. real removal reasons there are snake case (merge_conflict, merged), actor github-merge-queue
  • not reproduced end to end: i didn't get a real PR kicked out of a queue while a dev server watched it

GitHub's merge queue can take a PR out (merge conflict with the queue,
failed queue checks) without touching its head, checks or comments, and
the PR stays open. The watch saw nothing, so an agent waiting on the queue
was never told.

The GitHub detail read now asks for the latest RemovedFromMergeQueueEvent
and the watch fingerprint counts them, both github.com only like
isRequired. A removal after the watch began that the agent did not make
wakes it once with the reason; the queue's own "merged" removal is
ignored.
@maschwenk maschwenk added the coder-task-generated Created from a coding task label Nov 16, 2026
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:L labels Nov 16, 2026
@maschwenk
maschwenk marked this pull request as ready for review November 16, 2026 20:42
@github-actions

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 21.5 KiB 21.5 KiB 0 B (0.0%) 24.4 KiB ✅
Codex Live turn messages 1 1 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.9 KiB 21.9 KiB 0 B (0.0%) 24.4 KiB ✅
Claude Live turn messages 1 1 0 (0.0%) 8 ✅

Baseline: 21bc832 · PR result: db8aa30 · Source CI: success

Scenario and decoded snapshot size

10 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.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@maschwenk
maschwenk merged commit 3c7ea93 into main Nov 16, 2026
38 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

coder-task-generated Created from a coding task size:L vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant