Repository navigation
M9: bounded host event ring + events poll op - #74
Merged
Merged
Conversation
Agents had no way to see what the app itself said happened — log lines,
lifecycle notices, subsystem chatter — without scraping stderr. This adds
a poll-only event stream per the expanded M9 PRD section:
- `EventRing`: Mutex<VecDeque<AgentEvent>>, capacity 1024, monotonic u64
seq from 1, no clock field (deterministic streams — I5). Past-capacity
evicts oldest; `lagged` tells pollers they lost events instead of
silently gapping.
- `AgentHost::event_ring()` — defaulted Option method; existing hosts
compile unchanged and fail closed with "events unsupported on this
host" rather than returning an empty list.
- `Op::Events {since, limit}` — additive on PROTOCOL_VERSION 2; `hello.
features` advertises "events" only when the host supplies a ring.
- `AgentClient::events`, CLI `gpui-agent events`, MCP `events` tool.
- todo-headless pushes an info record per successful `todo.*` invoke —
the e2e fixture proving the app-side bridge recipe.
- No subscribe/push, no runner/receipt coupling — explicit non-goals.
Tests: ring order/eviction/lagged/zero-capacity, dispatch supported +
unsupported hosts, hello advertisement, CLI e2e, MCP cursor poll.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
codeitlikemiley
force-pushed
the
m9-event-ring
branch
from
October 18, 2026 03:33
ebaaaef to
aa32d47
Compare
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.
Summary
M9 from the instinct PRD: a bounded, host-owned event ring so agents can
see what the app said happened (log lines, lifecycle notices) without
scraping stderr. Poll-only; push subscription is an explicit non-goal.
EventRing—Mutex<VecDeque<AgentEvent>>, cap 1024, monotonicu64seq, no clock field (deterministic streams per I5). Eviction sets
laggedso pollers know they dropped events instead of seeing a gap.AgentHost::event_ring()— defaultedOptionmethod. Hosts without aring fail closed:
"events unsupported on this host", never an emptylist pretending to be a stream.
Op::Events {since, limit}— additive onPROTOCOL_VERSION2;hello.featuresadvertises"events"only when the host has a ring.AgentClient::events,gpui-agent events [--since N] [--limit N],MCP
eventstool (ungated — it's a protocol op, not a policy feature).todo-headlesspushes oneinfoevent pertodo.*invoke — the e2efixture proving the app-side bridge recipe.
PRD: expanded
docs/plans/2026-10-17-instinct-prd.md§M9 with fullsemantics before implementing (was a 3-line stub).
Test plan
lagged,limit cap, zero-capacity
helloadvertiseseventsiff ring presenttests/events.rs) + MCP cursor poll(
tests/mcp_instinct.rs::events_tool_polls_the_ring)cargo test --workspace×3 configs (default / instinct / jev) — 0 failurescargo fmt --check,cargo clippy --workspace --all-targets×3 — cleanGenerated with Devin