Skip to content

feat: emit github.pr.opened / github.pr.merged on the event bus#24

Merged
mabry1985 merged 2 commits into
mainfrom
feat/pr-lifecycle-events
Jul 22, 2026
Merged

feat: emit github.pr.opened / github.pr.merged on the event bus#24
mabry1985 merged 2 commits into
mainfrom
feat/pr-lifecycle-events

Conversation

@mabry1985

Copy link
Copy Markdown
Member

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_prpr.opened {repo, number, title, url, head, base}
    • github_merge_prpr.merged {repo, number, method}
    • The registry auto-namespaces these 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 no events).
  • _emit swallows all exceptions: telemetry can never fail a write tool.

Testing

pytest91 passed. No behavior change to tool return values.

Consumer side lands in protoAgent (FleetActivity maps github.pr.opened / github.pr.merged).

🤖 Generated with Claude Code

https://claude.ai/code/session_01LyQuxgkFpMUJAQbVXnqz2d

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
mabry1985 force-pushed the feat/pr-lifecycle-events branch from 81a0251 to 75c16e2 Compare July 22, 2026 18:36
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.
@mabry1985
mabry1985 merged commit e01d976 into main Jul 22, 2026
1 check passed
@mabry1985
mabry1985 deleted the feat/pr-lifecycle-events branch July 22, 2026 18:40
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.

1 participant