Skip to content

docs(adr): Agent Event Stream — platform-agnostic event source + notification facade - #17

Open
brettchien wants to merge 1 commit into
mainfrom
docs/adr-agent-event-stream
Open

docs(adr): Agent Event Stream — platform-agnostic event source + notification facade#17
brettchien wants to merge 1 commit into
mainfrom
docs/adr-agent-event-stream

Conversation

@brettchien

Copy link
Copy Markdown
Contributor

What

Proposed ADR (docs/adr/agent-event-stream.md) for a platform-agnostic event source + notification facade — the observation half of the ADR-4 reservation that ADR-2 §10 deferred (durable status store + a replacement for "front-ends live-observe on demand").

Why now

deploy_events (merged, #16) reads an event archive but has no source wired and no live path. And each runtime exposes events differently (ECS→EventBridge, k8s→watch), so hard-wiring the ECS path into oab-mcp would repeat the platform-specific shortcut the desktop-core-sidecar ADR fixed.

The decision (one adapter + one facade)

sources ──AgentEvent──▶ EventHub ──▶ pull:  deploy_events (list)
  EcsEventSource                  └─▶ push:  ├─ MCP notifications/resources/updated → client
  K8sEventSource                             └─ webhook (offline alerting)
  • EventSource trait per runtime: list() (pull/history) + subscribe() (push/live).
  • AgentEvent — generalize the ECS-flavoured EcsEvent on the studio-cp seam; kind maps onto ADR-1's 6-state where a transition matches.
  • EventHub — one normalization + fan-out point decoupling N sources from M sinks.

Notable points captured

  • Runtime asymmetry: ECS Task State Change omits container healthStatus (a RUNNING→unhealthy flip isn't emitted); k8s does emit probe-failure events. The abstraction fixes the ECS blind spot by construction.
  • Push needs a live subscriber: oab-mcp is per-session stdio; SQS/watch buffers while nothing's connected (no loss) but MCP push ≠ offline alerting → webhook is the only offline path.
  • Competing consumers: Orca's oab-mcp and a desktop sidecar's oab-mcp on one SQS queue would steal each other's messages → SNS fan-out / single designated subscriber.
  • Open question: whether a server-initiated MCP notification actually wakes the agent (vs just updating state) — unverified, gates the push sink's value for agents.

Docs-only; no code. Builds on ADR-1 / ADR-2 and reuses #16 wholesale.

🤖 Generated with Claude Code

…fication facade

Proposed ADR realizing the observation half of ADR-4's reservation (ADR-2
§10: durable status store + replacement for on-demand live-observe).

Introduces one `EventSource` adapter per runtime (ECS→EventBridge/SQS,
k8s→watch/informer) feeding a single `EventHub` facade that serves both a
pull history (deploy_events, PR #16) and a push stream (MCP
notifications/resources/updated + webhook). Normalizes ECS-flavoured
EcsEvent into a platform-neutral AgentEvent on the studio-cp seam.

Flags the runtime asymmetry (ECS omits health-flip events; k8s emits
probe failures), the push-needs-live-subscriber and competing-consumer
caveats, and the open question of whether an MCP client notification
wakes the agent.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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