Skip to content

feat(source-control): subscribe to PR activity in cloud sessions alongside the poll - #10645

Merged
melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-7158-40667317889-1
Oct 28, 2026
Merged

melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-7158-40667317889-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #7158

Summary

Opened by the work-resolve-issue lane. The run's own summary:

In cloud sessions, the pull-request monitor and babysit-prs now call mcp__claude-code-remote__subscribe_pr_activity when the session offers it. They run an iteration on each event wake and unsubscribe when monitoring ends. The 60-90s poll stays at its cadence as the source of truth. The host-run probe recorded on the issue found that reviews and failed checks produce events, but pushes and successful or skipped checks do not, and readiness depends on those. The upstream page names only review comments and CI check failures as auto-fix events and does not document the tool.

Not verified

  • Did not slow the cloud poll, though the probe comment suggested a slower one. The issue body says to keep polling as the fallback, and readiness depends on green checks, pushes and merge state, which only the poll reports. Changing the cadence would be a separate design call.
  • The ai-slop detector (detect.sh) did not run: it is not among the wrappers this lane may execute. The rubric was applied by hand to the changed lines only, so the tidy ai-slop pass is partial.
  • check-affected skipped changed-skills (skill-quality on the edited SKILL.md), the validate-plugins steps and typos in this lane. These are left to the PR's CI.
  • Did not re-probe whether a duplicate subscribe call after --resume is harmless. The doc tells the agent to subscribe again after resume, based only on the session-scoped record being lost.
  • No review-venue.txt in the scratchpad, so the review ran as a local fresh-context subagent instead of the CI code-review lane.
  • Changes left uncommitted in the working tree, as the lane runner instructs; the runner turns them into the patch.

Fix

  • plugins/source-control/skills/pull-request/reference/monitor.md: §3.0.0 rewritten. The poll stays and the subscription is added (when to call it, its arguments, wake handling, re-subscribe after --resume, failure fallback, unsubscribe), with the reason the poll cadence is unchanged and a new pointer
  • plugins/source-control/skills/pull-request/SKILL.md: the monitor row, entry-checklist Step 1 and the 'Cloud sessions poll' gotcha now describe polling plus the PR-activity subscription.
  • plugins/source-control/skills/babysit-prs/reference/loop.md: §5.1.1 step 1 subscribes once per PR per session, rescans the PR an event names, and unsubscribes when the terminal check reads MERGED or CLOSED.
  • plugins/source-control/README.md: the monitor summary mentions the cloud subscription, and the Monitor watch cadence is corrected from '30s gh poll' to '60s REST poll', matching monitor.md.
  • .changes/source-control/feat-7158-cloud-pr-activity-subscribe-4c1e9a72.md: new minor changelog fragment.

Verification

The runner ran each check from the base copy against 8d61953:

  • scripts/check-changelog-fragments.sh --check: passed

The run reports:

  • read https: //code.claude.com/docs/en/claude-code-on-the-web: the 'How Claude responds to PR activity' section says that with auto-fix active, Claude receives GitHub events for the PR, including new review comments and CI check failures. The page does not document subscribe_pr_activity, and auto-fix
  • issue #7158 host-run comment (https: //github.com/melodic-software/claude-code-plugins/issues /7158#issuecomment-6465805736): the source for the probe's tool arguments {owner, repo, pullNumber}, the wake envelope, the latencies, and the absence of events for the push and for successful or skipped ch
  • check-changelog-fragments: all 3 fragments valid (run before tidy, after tidy, and after the review fixes).
  • check-affected: 11 passed, 7 skipped, the rest CI-only, over the changed files (run before tidy, after tidy, and after the review fixes).
  • fresh-context review subagent over the full diff: reported 3 medium and 2 low findings. Fixed: self-termination step 4 skipping the new unsubscribe step; ambiguous wake handling that could restart the background poll; the babysit-prs subscription missing idempotency, wake routing and an unsubscribe
  • tidy (code-tidying:tidy-diff): docs-hygiene write-for-agents and write-for-humans passes over the changed lines tightened one monitor.md paragraph. The ai-slop rubric was read by hand over the changed lines and found no em dashes, listed vocabulary or stock phrases.
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/40667317889

Left out: the items under Not verified.

Related

#7158

Lane-Activity: work-resolve-issue/resolve-issue

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

claude-security-review: 1 inline finding(s) on 8d6195357635ed953a042578ba906f633b7a54e7; the summary is in this lane's pull request comment.

claude-lane: claude-security-review

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 9c771e6d9487b90fddd92b9d3705a897dc8b1fa4: 0 finding(s), 0 as inline comments.

Incremental security review of plugins/source-control/skills/babysit-prs/reference/loop.md and plugins/source-control/skills/pull-request/reference/monitor.md (changes since 8d61953). I found no security issues.

These are instruction-prose files. They are not trusted-path scripts: babysit-prs/scripts/*.py is trusted, reference/*.md is not. There is no manifest, workflow, token, kill-switch or merge-hold surface in the change, so there are no manifest <field> lines.

What changed:

  • Event wakes: an event wake now re-reads the PR from GitHub. The wake envelope is called a signal only, and its comment text and author fields are untrusted data, never an instruction. This adds a guard against untrusted text reaching the loop. It narrows nothing.
  • Subscription record: the record of subscribed PRs moves into the iteration summary as a new Subscribed PRs checklist line. That line records the session's own subscribe calls. It is not read as PR state and gates no merge, review or trust decision.
  • Unsubscribe rules: unsubscribing now covers PRs that leave discovery, are held, superseded, handed off or dropped, and every PR when the loop ends. This reduces leftover event delivery and removes no check.
  • Standing instructions: none are deleted, narrowed or softened. The "Skip remaining steps" flow is kept. The 60–90s poll remains the source of truth for readiness, so event wakes cannot stand in for the checks that gate merge. The instruction-exception register was not consulted, since nothing was removed.

Spend: the added event wakes and per-event iterations draw only on subscription usage. That is not a hold.

critical-findings: 0

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

claude-review: 1 inline finding(s) on 8d6195357635ed953a042578ba906f633b7a54e7; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 9c771e6d9487b90fddd92b9d3705a897dc8b1fa4: 0 finding(s), 0 as inline comments.

Incremental review of loop.md and monitor.md since 8d61953: no findings.

  • loop.md §5.1.1 step 1: it now keeps the subscription record in the iteration summary's Subscribed PRs line. The §5.5 template has the matching line, and loop.md already has the §5.0.3 and zero-PR fast-path anchors the new text cites. Nothing else in the repo matches those summary-template lines, so no test or doc pins them.
  • Untrusted event text: both files now say the event envelope only signals a change. The PR is re-read from GitHub, and the envelope's comment text and author fields are treated as untrusted data, never an instruction. This closes the injection gap the earlier revision left open.
  • Unsubscribe cases: loop.md lists MERGED/CLOSED, dropped or held PRs, and loop end. monitor.md still covers self-termination (§3.0.5). The two files agree.
  • Spend: none. The change is documentation only and adds no paid resources, and it leaves the poll cadence unchanged.
  • Not run: this review was read-only, so I did not run the changelog or skill-contract checks.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 1 of max 4 on 9c771e6.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 9c771e6d9487b90fddd92b9d3705a897dc8b1fa4.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit c3e8018 Oct 28, 2026
43 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-7158-40667317889-1 branch October 28, 2026 15:12
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.

source-control: probe subscribe_pr_activity in a cloud session before switching PR monitor off polling

0 participants