feat: emit github.pr.opened / github.pr.merged on the event bus#24
Merged
Conversation
Broadcast PR lifecycle events (ADR 0039) so consumers can surface them without
polling — e.g. protoAgent's Fleet Room activity feed rendering "opened PR #123 ·
<title>" for a member agent.
- get_write_tools() takes an optional `emit` (the host's namespaced registry.emit).
github_create_pr emits `pr.opened` {repo, number, title, url, head, base};
github_merge_pr emits `pr.merged` {repo, number, method}. The registry namespaces
them to `github.*`.
- register() passes `emit=getattr(registry, "emit", None)` — hasattr-guarded like the
plugin's other host couplings, so an older host without the seam still loads the
tools, just without events.
- _emit swallows everything: telemetry can never fail a write tool.
Tests: 91 passed.
mabry1985
force-pushed
the
feat/pr-lifecycle-events
branch
from
July 22, 2026 18:36
81a0251 to
75c16e2
Compare
The conflict resolution (keeping main's `+ get_review_tools(...)` alongside the new `emit=` arg) was hand-wrapped; ruff format wants it on one line. `ruff format --check` is a CI gate, so this unblocks the run. No behavior change.
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.
Broadcast PR lifecycle events on the host bus (ADR 0039) so consumers can surface them without polling.
Why: protoAgent's Fleet Room activity feed can now render "opened PR #123 · <title>" for a member agent, instead of that row being impossible to source.
Changes
get_write_tools(default_repo, emit=None)takes the host's namespaced bus seam (registry.emit).github_create_pr→pr.opened{repo, number, title, url, head, base}github_merge_pr→pr.merged{repo, number, method}github.*.register()passesemit=getattr(registry, "emit", None)— hasattr-guarded like the plugin's other host couplings, so an older host without the seam still loads the tools (just no events)._emitswallows all exceptions: telemetry can never fail a write tool.Testing
pytest— 91 passed. No behavior change to tool return values.Consumer side lands in protoAgent (
FleetActivitymapsgithub.pr.opened/github.pr.merged).🤖 Generated with Claude Code
https://claude.ai/code/session_01LyQuxgkFpMUJAQbVXnqz2d