feat(babysitter): wake on real PR review feedback, not only verdicts
F1 in the Babysitter owner plan. The plan's goal: a flow that wakes on PR feedback, loads the original session, and fixes the feedback in a sandbox.
What changes
Until now the standalone Babysitter acted only on failing checks, CHANGES_REQUESTED reviews, and @babysitter directives. A reviewer's inline comments, or a review bot's findings, could never make a PR actionable.
signals.tsnow also reads/pulls/:n/comments, and returnsreviewFeedback:- inline comments that are not outdated (
line != null), newer than Babysitter's last comment, with no later reply in their thread frombotLoginor anownAgentsaccount; - non-empty
COMMENTEDreview bodies, newer than Babysitter's last comment.
- inline comments that are not outdated (
- Who counts: the PR author,
OWNER/MEMBER/COLLABORATOR, or a policyreviewBotslogin. NeverbotLoginorownAgents.AgentRelayBot(MEMBER) posts "Fixed in …" thread replies on our PRs. WithoutownAgentsthose replies would count as human feedback and loop.
- Journal budget: shortened like the other text, then dropped oldest-first after comments. Still ≤ 50KB.
- The agent task lists each item:
Review comment by X on path:line: …orReview by X: …. - Wake contract unchanged. GitHub sends
pull_request_review.submittedfor every review, including a single inline comment. Cloud's trigger profile (checks,comments,events,repository,reviews) still matches.
⚠️ Reviewer attention
- The policy pin changed on purpose.
tests/standalone-artifact.test.tsasserts the exactstandalone-policy.json. I updated that assertion to the newreviewBots/ownAgentslists, because changing the policy is what this PR does. Please confirm both lists. Iskjgbotours? - The artifact digest moves:
eed5e5de…→af8d51743982e018b1a0c0aceb66e5a4f038bf2a55ff7a75d543de8276e2322a(37,044 bytes).- Cloud #4226 pins the old digest, so it will refuse this artifact until the Cloud pin moves (plan step C1).
- Nothing is deployed today, so merging enables nothing.
Not in this PR
- Fix/push mode (F2), the Cloud pin move (C1), and per-PR sandbox reuse (C2/F3).
- Resolved-thread detection: REST does not expose it, so only "answered by us" and outdated threads are dropped.
Evidence (examples/babysitter/evidence/f1-feedback-filter/, unedited output)
01-signals-red.txt: the 4 new reader tests fail before the implementation.02-standalone-red.txt: the flow tests fail before the implementation.03-own-agents-red.txt: theownAgentstests fail before the implementation.04-all-babysitter-green.txt:tests 107, pass 100, fail 0, todo 7, exit 0. The 7 todos are the existing deliberate gates.05-artifact-check.txt:build-standalone.mjs --checkreproducesaf8d5174….06-typecheck.txt: in my local environment,main@fe60dd4chas 73 tsc errors, all environmental (missing@relayfile/relay-helpers/ai-histand a dual-packageCtx). This branch has 75: the same classes, plus 2 from the two newbody(f)test calls. 0 errors outside those classes. CI is the authority here.07-flows-check.txt:flows checkon the artifact passes.08-sdk-shipped-source.txt: the shipped-source model pins pass, 2/2.09-mutation.txt: revertingownAgentsthread-answering makesour own agent accounts are never feedback…fail. The file was restored byte-for-byte (cmpidentical) and the tests are green again.- Caveat: the
git diff --statline in that file is against HEAD (uncommitted work at that point), not the mutation alone.
- Caveat: the
🤖 Generated with Claude Code
[!NOTE]
Medium Risk
Changes when Babysitter runs on live PRs (new wake reasons, policy allowlists, and Garden auto-scope); misconfigured reviewBots/ownAgents could miss feedback or cause unwanted wakes, but behavior is bounded to diagnose-only with existing head-binding guards.
Overview
Standalone Babysitter now treats unanswered PR review feedback as actionable, alongside failing checks, change requests, and @babysitter directives.
Signal read (signals.ts) paginates /pulls/:n/comments and returns reviewFeedback: non-outdated inline threads and non-empty COMMENTED review bodies newer than Babysitter’s last marked comment, filtered to the PR author, collaborators, or policy reviewBots, and excluding botLogin and ownAgents (so our “Fixed in …” replies don’t re-wake the flow). Thread replies from Babysitter or ownAgents mark threads answered. Payload stays within the 50KB journal budget (truncate, then drop oldest feedback). The diagnose agent task lists each item with path/line when inline.
Policy & scope: standalone-policy.json pins reviewBots and ownAgents. Same-repo relayflow/* Software Garden PRs are in scope by default (drafts included); other PRs still need the babysit label. When Garden shares the app login, only comments with a <!-- babysitter: marker count as Babysitter’s own for the comment window and thread answers.
The committed standalone artifact and manifest digest update accordingly; Cloud must move its pinned digest before deploy.
Reviewed by Cursor Bugbot for commit c176f9c99696c1503b8d0d03be8d78aed237aeca. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
The Babysitter now wakes on real PR review feedback — inline review comments and non-empty COMMENTED review bodies — not just failing checks, CHANGES_REQUESTED reviews, and @babysitter directives.
- Reads
/pulls/:n/commentsand lists each item in the agent task asReview comment by X on path:line: …orReview by X: …. - Feedback counts only from the PR author,
OWNER/MEMBER/COLLABORATOR, or a policyreviewBotslogin; never frombotLoginorownAgents, so our "Fixed in …" thread replies can't loop the flow. - File-level comments count and render without a line; outdated line comments are dropped; pending-review comments date from the review's
submitted_at; the since-last-report cutoff is inclusive because timestamps are per-second. - An
@babysitterdirective from anownAgentsaccount is not a directive. - Software Garden PRs (same-repo
relayflow/*head branches) are babysat by default, including drafts — Garden opens draft PRs with failing checks, and getting them out of draft with feedback fixed is the job. Any other PR still opts in with thebabysitlabel, and label opt-in drafts still decline. - A
botLogincomment counts as Babysitter's own only when it carries a<!-- babysitter:marker, so Garden's adversarial-review comment no longer moves the "since last comment" window or marks threads answered. standalone-policy.jsonnow pinsreviewBotsandownAgents(AgentRelayBot;kjgbotwas dropped as it may be a shared human account). The artifact digest moves to70e27d2c…, so Cloud must move its pinned digest before deploying this artifact.
Agent Relay sessions
claudesession497569fc· opened viagh pr create· last active 2026-10-09