Repository navigation
Conversation
Agents that wait for CI or reviews poll gh in sleep loops. That costs tokens and stops when the turn ends. The github-pr-status plugin already polls each pull request, so it now tells a watching thread what changed. - `bb pull-request watch|watching|unwatch` store one watch per thread in the plugin database. A background service restores them after a restart. After each read, the server compares the pull request with what the thread was last told and sends one message when a check run fails, all checks pass, someone else comments or reviews, the review decision becomes approved or changes requested, the branch starts to conflict, or the pull request merges or closes. While the thread is busy, new news updates the queued message instead of queuing another. - A watch ends on merge or close, unwatch, thread archive or delete, a switch to a named branch with another pull request or none, 10 comment-only messages in a row, or 15 minutes of failed reads while the machine is online. A detached HEAD does not end it. - `bb pull-request logs|rerun` read the latest failing GitHub Actions job logs and re-run failed jobs of the pull request's own repository. - The GraphQL read adds the last 10 comments and reviews to find activity by other people. Watch-only data stays in server memory, so the public `pullRequests` row is unchanged. - The store retries a failed discovery read every 5 minutes while the environment is watched.
lanjak
marked this pull request as draft
November 21, 2026 04:39
Contributor
Author
|
Closing this for now. The feature needs maintainer sign-off on #1543 first. The branch stays on my fork as a prototype, linked on the issue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
An agent that has to wait for CI or a review has no way to be told when the pull request changes. Agents poll
ghinsleeploops or ask the user to come back. This costs tokens, and the wait stops when the turn ends. The github-pr-status plugin already polls each pull request that a client shows, but it only updates the UI. Issue #1543 asks for an exact-thread wake from that existing poller, with no second GitHub poller.What changed
All changes are in
plugins/github-pr-status. There are no server, daemon or wire changes outside the plugin, and noHOST_DAEMON_PROTOCOL_VERSIONchange.bb pull-request watch|watching|unwatch [--thread]and the RPC methodswatch,watching,unwatch. A watch belongs to one thread and is saved in a newwatchestable (append-only migration). A background service restores watches after a restart. The watch keeps the environment's row polling through the existing store, the same way an open client view does.watch.tscompares each read with what the thread was last told. It sends one message (threads.send,queue-if-active) when a check run fails (keyed by name and start time, so a re-run that fails again is new), all checks pass, someone other than the machine'sghaccount comments or reviews, the review decision becomes approved or changes requested, the branch starts to conflict, or the pull request merges or closes. While the thread is busy, later news updates the queued message (queuedMessages.update) instead of queuing another message.unwatch, thread archive or delete, environment removal, a switch to a named branch with another pull request or none, 10 comment-only messages in a row, or 15 minutes of failed reads while the machine is online. A detached HEAD (for example during a rebase) does not end a watch. While the machine is offline, the watch waits.bb pull-request logs|rerun <environment-id> [--check]and the RPC methodscheckLogs,rerunChecks. They use the latest run of each check, and only jobs in the pull request's own repository.logsprints the lines up to the last##[error]of each failing job (gh api .../actions/jobs/<id>/logs, with--allow-escape-sequencesonly whenghasks for it).rerunrunsgh run rerun <run> --failedonce per run, or--jobfor--check.viewerDidAuthor) to find activity by other people. Failed check runs and outside activity stay in server memory. The publicpullRequestsrow and its strict schema do not change, so olderbb thread showclients still parse it.Differences from #1543:
githubplugin's sync. github-pr-status already owns the per-environment pull request that the thread shows.threads.sendinside the server, so an accepted send that reports a failure is unlikely.How you verified
watch.test.ts(rules, merging, one-line GitHub text),host/checks.test.ts(log tail, Actions job links, latest run per name, other-repository jobs, escape-sequence retry, re-run grouping),server.test.ts(wake once per failed run, end on merge, restore after reload, end on thread delete, offline machine waits, 15-minute end, end on branch switch, detached HEAD keeps the watch, queued-message update, re-send after a failed send, CLIlogs/rerun),store.test.ts(retry of a failed lookup),assemble.test.tsandgit-host.test.ts(facts and outside activity). Each fix from review has a test that fails without it (checked by reverting the fix).pnpm exec turbo run typecheck test lint lint:type-aware --filter=bb-plugin-bb--github-pr-status --filter=@bb/cli: plugin 217 tests, CLI 1407 tests, 0 lint findings.apps/servertest/skills/: 105 passed.oxfmt --checkis clean on all changed files.pnpm --filter @bb/qa standalone:start) against real GitHub pull request Route native browser close shortcuts to the renderer #7831 with a Claude Haiku thread:watchstarted and listed the real failing check.logsprinted the real npm 404 error from the failing job.bb plugin reload, the watch was restored. With its saved baseline cleared, the next read sent the failure message to the thread, and the agent started to read the logs.gh2.104 refuses job logs that contain escape codes unless it gets--allow-escape-sequences. The retry handles this.Fixes #1543