Skip to content

feat: add cursor-drained event subscriptions#273

Merged
umputun merged 1 commit into
masterfrom
cursor-drained-event-subscription
Jul 22, 2026
Merged

feat: add cursor-drained event subscriptions#273
umputun merged 1 commit into
masterfrom
cursor-drained-event-subscription

Conversation

@umputun

@umputun umputun commented Jul 22, 2026

Copy link
Copy Markdown
Owner

implements the event subscription accepted in Discussion #211 with a bounded in-memory ring and ordinary one-shot events.read cursor reads. agtermctl events short-polls the API and prints human or NDJSON output without changing the control server's connection lifecycle.

v1 emits status, notify, session.created, session.closed, and tree.changed. The structural event is a per-window coalesced invalidation; consumers re-read tree --json for detail. Cursors are scoped to an app run and fail explicitly on restart, expiry, or invalid positions.

a minimal client that jumps to a session when it reports blocked:

agtermctl events --json --kind status |
  jq -r --unbuffered 'select(.payload.status == "blocked") | .session' |
  while IFS= read -r session; do
    agtermctl session select --target "$session"
  done

tested with:

  • cd agtermCore && swift test (1,727 tests)
  • focused EventSubscriptionUITests
  • make build
  • make lint

discussion: #211

add a bounded cursor ring for status, notifications, session lifecycle, and tree changes. Expose one-shot reads through the control protocol and a polling agtermctl events command.
Copilot AI review requested due to automatic review settings July 22, 2026 08:54
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying agterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4e5a5c9
Status: ✅  Deploy successful!
Preview URL: https://b93a970a.agterm.pages.dev
Branch Preview URL: https://cursor-drained-event-subscri.agterm.pages.dev

View logs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@umputun
umputun merged commit eed23d4 into master Jul 22, 2026
6 checks passed
@umputun
umputun deleted the cursor-drained-event-subscription branch July 22, 2026 08:59
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.

2 participants