Skip to content

refactor(lastcode): retire the Wait for PR action in favor of native PR watches - #419

Merged
lastobelus merged 17 commits into
lastcode/mainfrom
lastcode/retire-wait-for-pr
Oct 16, 2026
Merged

lastobelus merged 17 commits into
lastcode/mainfrom
lastcode/retire-wait-for-pr

Conversation

@lastobelus

@lastobelus lastobelus commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Waiting on a LastCode PR had two observers: the standalone Wait for PR polling Action and the native watch_pull_request watch. They woke the same thread twice, queued duplicate polling continuations that kept churning the daily build, and needed two sets of guidance that drifted apart. Clean reviews were also easy to miss. A Codex review that finished with only a reaction never woke the native watch, and the readiness check did not recognize a clean review whose versioned receipt marker came before the verdict. On #417, a clean review sat unrecognized until the wait timed out after 30 minutes.

Changes:

  • The polling Action is retired. This removes lc-wait-for-pr, its waiter script and tests, and the docs and agent guidance that pointed to it. The native watch is now the only passive observer. Agents call watch_pull_request, then run pnpm lastcode:pr-gates once. If it reports pending, they end the turn, then rerun the check on each wake.
  • pnpm lastcode:pr-gates is a one-shot check. It reads GitHub CI and review state for the exact PR head, never polls or sleeps, and never approves or merges. When no CI run has registered for the exact head and base and no review is pending, it reports attention instead of pending, because the native watch cannot wake for a run that never starts.
  • Native watches wake on reactions. The watch's change fingerprint now includes reactions on top-level PR conversation comments: each reaction's total count plus the sorted logins of its first 10 reactors, read through GitHub's reactors. A count increase or a changed reactor name wakes the thread, so a new reaction from someone else on the signed-in account's comments wakes it even when the review posts no new comment. Each reaction is reported once, across pushes and incomplete reads. The cheap fingerprint covers only the 100 most recently updated conversation comments. A reaction on a review, an inline review comment, or an older conversation comment is noticed at the next full read, which can take up to about 30 minutes. The full read keeps the existing limit of 1,000 conversation comments, but now takes the 1,000 most recently updated, so a new review request is always included. On a PR with more comments than that, reactions on the earliest ones can be missed, and the read reports that it was truncated.
  • Stricter merge checks. Before merging, and again under the merge lock, the guard now requires a finished, clean Codex review of the current head and zero unresolved review threads, as well as an exact successful CI run. A disabled CI workflow no longer counts as passing.
  • Receipt fix (fix(automation): recognize versioned Codex review receipts #418). Before reading the verdict and the reviewed head, the check strips only the known anchored <!-- codex-review-receipt:v1 --> marker and normalizes LF/CRLF line endings. Author, head, timing, and findings checks are unchanged. Unrelated prefixes and results for an old head are still rejected.

Validation: focused pr-gates, pr-gates CLI, and GitHub CI tests pass. Focused GitHub API, provider, and JSON decoding tests pass, including a 101-comment regression and the reactor-name fingerprint. Count-watch, shared, client, and contract tests affected by this change pass. The generated watch fingerprint query was run against GitHub's live GraphQL API, which accepted it, and its response decoded into the expected fingerprint.

Fixes #418

Background: the research draft in #286 explored this direction. This PR supersedes it.

Implemented with GPT-6.1-Sol using Codex. Guidance and independent review by Claude Opus 5.5 (High) through T3 Code / Claude Code.

🤖 Generated with Claude Code

@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T20:49:52.332455Z b366f99 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 chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 41285d83b0

ℹ️ 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

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: ed642d322a

ℹ️ 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/retire-wait-for-pr branch from ed642d3 to 5f3aa8c Compare October 16, 2026 18:56
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5f3aa8cbb8

ℹ️ 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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b7513e4e3c

ℹ️ 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/retire-wait-for-pr branch from b7513e4 to eb430d6 Compare October 16, 2026 19:26
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eb430d6b4b

ℹ️ 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".

Comment thread scripts/lastcode-pr-gates.ts Resolved
@lastobelus
lastobelus force-pushed the lastcode/retire-wait-for-pr branch from eb430d6 to 96a2552 Compare October 16, 2026 19:41
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 96a2552989

ℹ️ 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".

Comment thread scripts/lastcode-pr-gates.ts Resolved
@lastobelus
lastobelus force-pushed the lastcode/retire-wait-for-pr branch from 96a2552 to c52d46a Compare October 16, 2026 19:50
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c52d46a82d

ℹ️ 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".

Observe named reactions on the signed-in account's comments once, including review completion without a new comment. Include reaction counts in GitHub watch fingerprints.

Carry-Group: upstream-bugfixes
Carry-Observation: Review completion may arrive as a reaction without editing the request comment.
Use the native PR watcher as the sole passive observer. Remove the polling command, saved Action declaration and target-selection workflow; update skills and guidance for one-shot gate checks.

Carry-Group: resumable-actions
Carry-Observation: Independent PR wait mechanisms caused duplicate agent continuations and stale review waits.
Preserve exact GitHub CI and current-head review checks in a bounded command and the merge guard. Recognize the versioned Codex review receipt envelope without accepting unrelated prefixes or stale-head results.

Carry-Group: build-ci
Carry-Fix: #418
Carry-Observation: A clean versioned review receipt was ignored because its envelope preceded the verdict.
@lastobelus
lastobelus force-pushed the lastcode/retire-wait-for-pr branch from c52d46a to b3e8e71 Compare October 16, 2026 20:09
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b3e8e71e25

ℹ️ 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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cdde56c697

ℹ️ 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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fa07d87340

ℹ️ 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".

Comment thread .agents/skills/lastcode-pr/SKILL.md Resolved
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b366f99f25

ℹ️ 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".

Comment thread scripts/lastcode-pr-gates.ts Resolved
@lastobelus
lastobelus merged commit bb98b65 into lastcode/main Oct 16, 2026
17 checks passed
@lastobelus
lastobelus deleted the lastcode/retire-wait-for-pr branch October 16, 2026 20:55
lastobelus added a commit that referenced this pull request Nov 8, 2026
)

lastCode kept its own `review-pr` and `babysit` skills, which had drifted from the copies in other projects. Global `review-loop`, `babysit` and related skills are now installed from the owner's dotfiles ([lasto-env #29](https://redirect.github.com/lastobelus/lasto-env/pull/29)). This PR removes the two project skills and moves lastCode's own landing rules to where the global skills read them.

**Merge order:** merge right after lasto-env #29, back to back.

## What changes

- **Removed:** `.agents/skills/review-pr/` and `.agents/skills/babysit/` (`.claude/skills` is a symlink to `.agents/skills`, so both entries go).
- **`lastcode-pr` "Babysit and Merge"** takes over the lastCode-specific babysit rules the global skill can't know:
  - the gate check's `attention` reasons (`observation-failed`, `mergeability-unknown`, `review-stalled`, `ci-not-registered`);
  - quiet-deadline handback;
  - Quick CI checkout and receipt identity;
  - verifying that the merged tree matches the reviewed head;
  - no Full CI for ordinary PRs;
  - Intel builds only on a separate request.

  Its `#wait-for-remote-gates` link now names the global `babysit` skill's Wait section.
- **`lastcode-pr` gate check:** `pnpm lastcode:pr-gates` needs a checkout with dependencies installed, because `pnpm` installs them first. Without one, the agent takes the `babysit` snapshot with `gh`, judges the `attention` reasons from it, and doesn't install dependencies just for the gate.
- **AGENTS.md:** the old "When babysitting" bullet is folded into the PR watch rule, which now also records that the saved `Wait for PR` Action is retired (#419). Local Reviews (`:194`) is unchanged.
- **`implement-plan`** runs its review rounds through `review-loop`, and keeps its `light`/`heavy`/N-round depth words. Its ordered review lenses go away; a separate eval is still measuring whether lenses earn their cost.
- **`docs/lastcode/release.md`:** the `#wait-for-remote-gates` link now points to `lastcode-pr#babysit-and-merge`.
- **Evals:** `evals/mcp-tool-use/cases/pull-requests.ndjson` cases `quiet-watch-stalled-review-handback` and `quiet-watch-pending-gates-handback` read `.agents/skills/babysit/SKILL.md` as context. They now read `lastcode-pr/SKILL.md`, where that guidance moved. Their assertions are unchanged.
- **Left alone:**
  - `scripts/lastcode-checkpoint.ts:452` (ignored recovery path `.agents/skills/babysit`): harmless once the directory is gone; removing it is a follow-up.
  - `_references/external-review-mechanics.md` and `stacked-pr-babysit.md`: still used by `lastcode-pr`, `review-plan`, `import-upstream-pr` and the release docs.

## Skill injection resolved

The repository's external git hook used to symlink an older `babysit` skill into any checkout that didn't track one. [agent-contexts #12](https://redirect.github.com/lastobelus/agent-contexts/pull/12) removed that injection, so landing this PR no longer brings the old skill back.

## Checks

- `git grep` finds no remaining links to `skills/review-pr`, `skills/babysit` or `#wait-for-remote-gates`. The only remaining mention is `scripts/lastcode-checkpoint.ts:452`, above.
- No local Quick CI: the change is docs, skills and two eval context paths; GitHub CI is the required gate.
- The two changed eval cases weren't run (they call paid models).

Claude Opus 5.5 in Claude Code (T3 Code).

Carry-Source-Ref: refs/lastcode/carry-sources/pr-613/9e25348d4460466746a61581835b293191c04bc4
Carry-Source-Base: bf969b0
Carry-Source-Head: 9e25348
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.

fix(automation): recognize versioned Codex review receipts

1 participant