Repository navigation
Conversation
|
@DataDog review |
|
🐶 babysit-pr is watching this PR — CI breakages and mechanical findings are fixed and pushed automatically; design decisions are always brought to you. This run
✅ stopped 17:19 UTC · stopped by the session: rerun loop bug found on this PR |
There was a problem hiding this comment.
Pending review events can be skipped when a resumed worker declares success. Retry scheduling and timeout handling also contain paths that interrupt monitoring or strand a staged handoff.
🤖 Bits Code Review · Commit 3d49e86
Memory overhead check: ✅ within budgetProfiler
✅ Not budgeted (too noisy on shared runners)
|
CI Test ResultsRun: #46434481811 | Commit:
Status Overview
Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled Summary: Total: 32 | Passed: 32 | Failed: 0 Updated: 2026-11-30 14:27:53 UTC |
|
❌ 29 passed, 1 failed out of 30 expected configurations Test Matrix
Failure Detailsglibc-arm64-hotspot-jdk8Tracer+profiler: Links
10 not applicable (not scheduled): musl-x64-openj9, musl-arm64-openj9. OpenJ9 requires glibc; upstream publishes no musl runtime. |
❌ ErrorsYour PR has failed checks. Please review the issues below and take necessary action before merging. 🚦 2 Pipeline jobs failed
Useful? React with 👍 / 👎 This comment will be updated automatically if new data arrives.🔗 Commit SHA: 3dd2891 | Docs | View more details | Give us feedback! |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa42f258d4
ℹ️ 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".
There was a problem hiding this comment.
A resumed worker can stop with trusted feedback still pending, and commit-message text can fool the unsigned-commit check. Feedback truncation, aggregate polling time, and a stale-base rebase instruction also leave concrete failure paths.
🤖 Bits Code Review · Commit fa42f25
|
🐶 babysit-pr is watching this PR — CI breakages and mechanical findings are fixed and pushed automatically; design decisions are always brought to you. This run
✅ stopped 10:40 UTC · two-hour cap passed; session fixed the last finding |
There was a problem hiding this comment.
The PR moves babysitting mechanics into a CLI with session-owned commits, pushes, and replies; signature detection, pending-inbox completion, feedback truncation, polling overruns, and stale-base rebasing are fixed. One issue remains: budget exhaustion during the status update can discard fetched findings and repeatedly prevent their delivery to the worker.
🤖 Bits Code Review · Commit 07d7950
|
🐶 babysit-pr is watching this PR — CI breakages and mechanical findings are fixed and pushed automatically; design decisions are always brought to you. This run
✅ stopped 12:00 UTC · Tier 3 setup broken on main (jafar-shell 0.30.0); relaunch after the pin lands |
There was a problem hiding this comment.
More details
The PR uses a deterministic babysitting CLI with session-owned commits, pushes, and replies. All findings raised in this session are resolved: signature detection, pending feedback, complete event bodies, polling deadlines, base refresh, and feedback persistence across deferred status updates; no reportable issues remain.
🤖 Bits Code Review · Commit 11fe541
… unreplaced cancels
…ed a full timeout
11fe541 to
3dd2891
Compare
|
🐶 babysit-pr is watching this PR — CI breakages and mechanical findings are fixed and pushed automatically; design decisions are always brought to you. This run
✅ stopped 14:18 UTC · stopped by the user |
|
This finding is already fixed. The last issue ("budget exhaustion during the status update can discard fetched findings and repeatedly prevent their delivery to the worker") was addressed by commit Note: |
There was a problem hiding this comment.
The documented Claude Code relaunch reuses an existing worker branch, blocking subsequent babysitting rounds. Reply bookkeeping can also hide unanswered findings, and PR closure can strand queued replies after a push has landed.
🤖 Bits Code Review · Commit 3dd2891
| Then relaunch: `start` (prints `resumed`) and launch the worker again, unless the run | ||
| is `stopped`. When the run is stopped, relay the stop summary from `status`: commits |
There was a problem hiding this comment.
Refresh the worker checkout before relaunching
After a Claude Code worker hands off a fix, its worktree and <branch>-babysit branch remain. Following the relaunch instructions repeats git worktree add -b with that existing branch and fails. Reusing the old checkout also fails the next handoff because its HEAD remains at the previous base. Each launch needs a fresh checkout of the current PR head and an unused worker branch.
| Then relaunch: `start` (prints `resumed`) and launch the worker again, unless the run | |
| is `stopped`. When the run is stopped, relay the stop summary from `status`: commits | |
| Then relaunch unless the run is `stopped`: fetch the current PR branch, run `start` | |
| (prints `resumed`), and launch a fresh worker at `origin/<branch>`. On Claude Code, | |
| use a new worktree path and a unique local branch name for each launch; the exited | |
| worker's worktree still holds its staged patch and old HEAD. When the run is | |
| stopped, relay the stop summary from `status`: commits |
React: 👍 useful · 👎 wrong · 😕 unclear · 👀 right, but not acting on it
What each reaction means
- 👍 Useful: correct, and you're fixing it or will.
- 👎 Wrong: the finding is incorrect, for example the bug can't happen or the code was misread.
- 😕 Unclear: you can't tell what it means or why it matters.
- 👀 Right, not acting: correct, but intended, out of scope for this PR, a known risk, or too minor.
🤖 Bits Code Review · Open Bits AI session
| """Post one signed reply unless GitHub already holds the babysitter's reply to `to` | ||
| (a crash between the post and the state save); records `to` in replied either way. | ||
| existing is the PR's comments of that kind, fetched when None. The posted id or None.""" | ||
| if to in st["replied"]: |
There was a problem hiding this comment.
Namespace reply records by GitHub resource type
GitHub reviews, issue comments, and inline comments use separate numeric ID namespaces, but replied stores bare integers. A focused reproduction answered issue comment 42, then polled an unanswered trusted inline root 42: the policy returned green_done without surfacing that finding. Resource-qualified keys are needed throughout reply state, recovery tags, policy checks, and handoff records, including distinguishing reviews from issue comments.
React: 👍 useful · 👎 wrong · 😕 unclear · 👀 right, but not acting on it
What each reaction means
- 👍 Useful: correct, and you're fixing it or will.
- 👎 Wrong: the finding is incorrect, for example the bug can't happen or the code was misread.
- 😕 Unclear: you can't tell what it means or why it matters.
- 👀 Right, not acting: correct, but intended, out of scope for this PR, a known risk, or too minor.
🤖 Bits Code Review · Open Bits AI session
| if gh_api("repos/%s/pulls/%d" % (REPO, a.pr))["state"] != "open": | ||
| raise Refused("PR is no longer open") | ||
| if git("symbolic-ref", "-q", "--short", "HEAD", check=False) != st["branch"]: | ||
| raise Refused("check out %s in the session checkout first" % st["branch"]) | ||
| fresh, why = review_marker_fresh(st["branch"]) | ||
| if not fresh: | ||
| raise Refused("review marker not fresh for HEAD; run pre-pr-review first: " + why) | ||
| head = git("rev-parse", "HEAD") | ||
| if head == h["base_head"]: | ||
| raise Refused("HEAD is still the handoff base: nothing to push (not rebased?)") | ||
| remote_tip = git("ls-remote", st["remote"], "refs/heads/" + st["branch"], timeout=GH_TIMEOUT_S) | ||
| # Equal: pushed before a crash lost the save. The push guards below apply only | ||
| # to a push still to make, so recovering the replies works past every cap. | ||
| if remote_tip.split("\t")[0] != head: |
There was a problem hiding this comment.
Recover landed pushes before rejecting closed PRs
If a push lands before a crash loses the phase save, and the PR closes before retrying, this guard rejects recovery before checking the remote tip. Queued replies remain unsent and stop also refuses the committed handoff. A focused in-memory reproduction confirmed the refusal despite a matching remote tip. Apply the open-PR requirement only when a new push is necessary.
| if gh_api("repos/%s/pulls/%d" % (REPO, a.pr))["state"] != "open": | |
| raise Refused("PR is no longer open") | |
| if git("symbolic-ref", "-q", "--short", "HEAD", check=False) != st["branch"]: | |
| raise Refused("check out %s in the session checkout first" % st["branch"]) | |
| fresh, why = review_marker_fresh(st["branch"]) | |
| if not fresh: | |
| raise Refused("review marker not fresh for HEAD; run pre-pr-review first: " + why) | |
| head = git("rev-parse", "HEAD") | |
| if head == h["base_head"]: | |
| raise Refused("HEAD is still the handoff base: nothing to push (not rebased?)") | |
| remote_tip = git("ls-remote", st["remote"], "refs/heads/" + st["branch"], timeout=GH_TIMEOUT_S) | |
| # Equal: pushed before a crash lost the save. The push guards below apply only | |
| # to a push still to make, so recovering the replies works past every cap. | |
| if remote_tip.split("\t")[0] != head: | |
| if git("symbolic-ref", "-q", "--short", "HEAD", check=False) != st["branch"]: | |
| raise Refused("check out %s in the session checkout first" % st["branch"]) | |
| fresh, why = review_marker_fresh(st["branch"]) | |
| if not fresh: | |
| raise Refused("review marker not fresh for HEAD; run pre-pr-review first: " + why) | |
| head = git("rev-parse", "HEAD") | |
| if head == h["base_head"]: | |
| raise Refused("HEAD is still the handoff base: nothing to push (not rebased?)") | |
| remote_tip = git("ls-remote", st["remote"], "refs/heads/" + st["branch"], timeout=GH_TIMEOUT_S) | |
| # Equal: pushed before a crash lost the save. The push guards below apply only | |
| # to a push still to make, so recovering the replies works past every cap. | |
| if remote_tip.split("\t")[0] != head: | |
| if gh_api("repos/%s/pulls/%d" % (REPO, a.pr))["state"] != "open": | |
| raise Refused("PR is no longer open") |
React: 👍 useful · 👎 wrong · 😕 unclear · 👀 right, but not acting on it
What each reaction means
- 👍 Useful: correct, and you're fixing it or will.
- 👎 Wrong: the finding is incorrect, for example the bug can't happen or the code was misread.
- 😕 Unclear: you can't tell what it means or why it matters.
- 👀 Right, not acting: correct, but intended, out of scope for this PR, a known risk, or too minor.
🤖 Bits Code Review · Open Bits AI session
What does this PR do?:
Moves every mechanical step of the
babysit-prskill out of LLM prose and into a tested stdlib CLI,utils/babysit-pr.py, with its pure decision logic inutils/babysit_pr_policy.py. The session, not the worker, now owns review, commit, push and replies.babysit-pragent)waitreturns, fixes code, runs tests, drafts replies. Never commits or pushespre-pr-review, runspush-and-reply, decides design questionsThe skill shrinks from 366 to 132 lines; it now points at CLI commands instead of inline
gh/jqrecipes.Motivation:
In a real run, triage and fixes took minutes, but the push chain stalled twice:
sleep 180/300/420and kept seeingrc=1after the session had written it.Both come from the same design: a long-lived LLM worker that improvises bash for every step, and a review marker that crosses a session boundary with no synchronous handoff. Now the session that writes the marker also checks it and pushes, so there is nothing to poll.
Additional Notes:
push-and-replyposts the queued replies only aftergit push --force-with-leaseagainst the handoff base succeeds;{commit}in a reply becomes the pushed SHA. A rerun after an interruption does not push twice and posts only the replies GitHub does not hold yet.build/babysit-pr-<n>.jsonmarker with an empty scope, so.githooks/pre-pushrefuses. A handoff is refused for files outside the scope-guard allowlist or the declared scope.apply-handoffrefuses an unsigned commit.review-marker.pyandTRUSTED_BOT_IDSare read fromorigin/mainonly.waitreruns a GitHub Actions run once, only after all its jobs finished, and records it before the request. Acancelledcheck counts as pending, never as a failure:ci.yml's concurrency group cancels superseded runs, and rerunning one cancels the live run.startadds no label:ci.ymlruns onpull_request: labeled, so a label would restart CI on every babysit start.gh/gitcall has a timeout, and insidewaiteach call is capped at the time left in the slice; a write starts only with its full timeout left, so it is never cut off mid-flight.waitreturns within 8 minutes, below the 600 s bash tool timeout.dog-sitterlabel is no longer added or removed; the status comment is the run signal. PRs labelled by the old skill keep the label until removed by hand..githooks/pre-push,utils/babysit-scope-guard.py, and both create triggers (.claude/hooks/babysit-pr.py,.pi/extensions/babysit-pr.ts).flock. Each call is bounded by its timeout.green_done; the acked event is listed in the stop summary..knowledgebase/memories/find-marker-branch-babysit-mismatch.mdno longer applies, since the worker no longer pushes. Cairn owns that file; it is left for a cairn update.babysit-pr: close crash windows and tighten handoff checks. A Sphinx review of that fix range found no HIGH; its one cheap fix was reviewed by a medium code review: one LOW left open (apply-handoffgives a misleading refusal reason when the patch file is missing). A first babysit run on this PR found that the CLI reran CI per failing job, lost the rerun record on a failed request, and treated cancelled checks as failures; together with the label, that cancelled live CI runs. Fixed inbabysit-pr: rerun once per workflow run, ignore cancelled checks, drop the labeland two follow-ups, each reviewed by a medium code review. A second babysit run triaged the Bits and Codex findings onfa42f258dand handed them to the session, since they are outside the worker's allowlist. They are fixed inbabysit-pr: address review findings on wait budget, completion, signing and rebaseand two follow-ups, each reviewed by a medium code review. A third babysit run surfaced a Bits finding (a skipped status write discarded the poll's events); fixed by saving before every status-comment update, which never fails its command, inbabysit-pr: save poll results before the status updateand four follow-ups, each reviewed by a medium code review. Open LOWs: the misleading refusal reason when the patch file is missing; no test pins the idle backoff while GitHub refuses a rerun; no test covers recovering a landed rebase push after the base moved;fix_rounds_leftcan read -1 after a manual push of the handoff head; an ambiguous status-comment POST failure can leave a duplicate status comment; thepush-and-reply/stage-handoffdeferred-update paths have no dedicated test. Findings dismissed with reasons: full-history polling, GitHub calls under the lock, permission cache across a resume, compatibility with state files from an earlier version (none was released).How to test the change?:
bash utils/tests/test_babysit_pr.shruns 70 hermetic tests against a fakegh(utils/tests/fake_gh.py) and temporary git repos with SSH commit signing. They cover the policy decisions, the trust gate, scope and allowlist refusal, signing, crash adoption, lease rejection, resumed replies, rerun dedupe and retry, cancelled-check handling, the wait-slice budget, completion while events are pending, deferred status-comment updates, the round cap and the fail-closedorigin/mainreads. CI runs the suite through theutils/tests/*.shglob inscript-tests. A real-PR run is the ticket'sproduction-checkcriterion.For Datadog employees:
credentials of any kind, I've requested a security review (run the
dd:platform-security-reviewskill, or file a request via the PSEC review form).
bewairealso runs automatically on every PR.