Skip to content

fix(mcp): a dead PR watch is not silently re-armed - #644

Merged
lastobelus merged 6 commits into
lastcode/mainfrom
lastcode/watch-quiet-rearm
Nov 8, 2026
Merged

lastobelus merged 6 commits into
lastcode/mainfrom
lastcode/watch-quiet-rearm

Conversation

@lastobelus

@lastobelus lastobelus commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Two kinds of PR-watch wake made Sol and Astra call watch_pull_request again on every wake, restarting a wait that could only end the same way. Opus mostly stopped after one restart.

  • Quiet expiry. The quiet deadline fired with gates still pending. Sol and Astra restarted 10–12 times per cell, in 11 of 11 sandbox cells, which kept threads cycling and added to machine load.
  • Unreadable stop. T3 stopped the watch after 8 failed reads in a row ("#N: stopped watching, could not read it"), and Sol and Astra re-armed it 4 of 4 times. Real PRs hit this too: a 404, which includes repositories the credential can't see, an unauthenticated gh, or a missing gh. Transport errors and rate limits keep the watch alive instead.

watch_pull_request now refuses both restarts unless the agent passes restart: true. The refusal tells the agent to report the blocker.

  • Quiet expiry is detected by the existing quietDeadline.dueAt: null, which any push, check change, comment or review resets. The watch stays registered: failed or passed checks, new comments or reviews, and conflicts still wake it, and a push restarts its timer, so after a push the agent only needs the gate check. quietTimeoutMinutes: null is still accepted.
  • Unreadable stop: the give-up now records unreadable: true on the ended watch (a new optional field on the watch contract). A new watch on that link is refused until it's acknowledged. The give-up wake no longer says "call watch_pull_request to watch it again". It says to report the blocker and to watch again only if the user asks.

Why an acknowledgement parameter rather than a plain refusal: the tool already documents a deliberate restart after the quiet notice, and a plain refusal would remove it. Requiring an explicit flag keeps that path, and the default call can no longer re-arm silently. An unwatch after an unreadable stop is a no-op and doesn't clear the marker, so "unwatch, then watch" isn't a silent bypass.

The new parameter has no description of its own. The quietTimeoutMinutes description was tightened to carry the rule, so the MCP tool list is 6 bytes below the base budget (75216).

Proof: a handler table test covers refused, acknowledged, timer-disabled, armed-timer and plain ended-watch rows for both cases; its refused rows fail on main. The reactor give-up test asserts the unreadable marker. vp run check:changed origin/lastcode/main passes. The existing quiet-wake eval guards (quiet-watch-pending-gates-handback, quiet-watch-stalled-review-handback) pass 8 of 8 on gpt-6.1-sol and gpt-6-astra on the final text. No new mcp-tool-use case: a case can only paraphrase a wake, not render T3's text, so the unreadable wording is measured by the babysit eval.

Local review: 2 rounds with gpt-6.1-terra (xhigh), approved; plus pre-push rounds for the budget rewording and the unreadable extension, with findings fixed or declined with reasons.

🤖 Generated with Claude Code (Claude Opus 5.5)

@lastobelus
lastobelus force-pushed the lastcode/watch-quiet-rearm branch from 71fc378 to e78f1fb Compare November 8, 2026 07:41
@lastobelus
lastobelus marked this pull request as ready for review November 8, 2026 07:43
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T09:46:15.828949Z a51a62d Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: e78f1fb019

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@lastobelus
lastobelus force-pushed the lastcode/watch-quiet-rearm branch from e78f1fb to cae5f27 Compare November 8, 2026 07:57
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: cae5f271c2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lastobelus
lastobelus force-pushed the lastcode/watch-quiet-rearm branch from cae5f27 to 47be49e Compare November 8, 2026 08:45
@lastobelus lastobelus changed the title fix(mcp): an expired quiet watch is not silently re-armed fix(mcp): a dead PR watch is not silently re-armed Nov 8, 2026
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 47be49ebd8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

lastobelus and others added 6 commits November 8, 2026 02:43
After a watch's quiet deadline fired with gates still pending, some agents
called watch_pull_request again on every wake, re-arming the same timer and
cycling the thread for hours.

watch_pull_request now refuses to re-arm a watch whose quiet wake fired with
no PR activity since, and says to report the pending gates as a blocker and
unwatch. The watch stays registered, so pushes, checks, comments and reviews
still wake it and restart its timer. A deliberate restart passes
restartAfterQuiet: true.

Co-Authored-By: Claude <[email protected]>
Carry-Group: incubator
…esets accurate

Carry-Group: incubator
Co-Authored-By: Claude <[email protected]>
When T3 stops a watch after 8 failed reads in a row (a 404, an
inaccessible repository, or missing or unauthenticated gh), some agents
called watch_pull_request again on every such wake, and each new watch
stopped the same way.

The give-up now marks the ended watch unreadable and tells the agent to
report the blocker. Re-watching that link is refused unless the agent
passes restart: true, the same acknowledgement a quiet-expired watch now
needs (renamed from restartAfterQuiet).

Carry-Group: incubator
Co-Authored-By: Claude <[email protected]>
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@lastobelus
lastobelus force-pushed the lastcode/watch-quiet-rearm branch from 47be49e to a51a62d Compare November 8, 2026 09:44
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: a51a62d7ed

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lastobelus
lastobelus merged commit 472445b into lastcode/main Nov 8, 2026
20 checks passed
@lastobelus
lastobelus deleted the lastcode/watch-quiet-rearm branch November 8, 2026 09:59
@lastobelus

Copy link
Copy Markdown
Owner Author

Follow-up from this PR's final report, not filed, by the owner's triage on 2026-11-08 PT. F4: the refusal check and the watch command aren't atomic, so a quiet wake landing between them could let one restart through. The worst case is one extra watch restart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant