Skip to content

[Feature]: CLI event stream for agent status (orca events subscribe) #37016

Open

Description

@deniskern

Problem or use case

Tools that supervise many Orca agents from outside the app (CLI scripts, coordinator agents in a terminal) have no push channel for agent state. Plugins can subscribe to agent.status.changed, but the CLI cannot, so external monitors poll orca worktree ps --json / orchestration worker-show on a timer. With ten workers that is constant traffic and still up to one interval late when an agent starts waiting for input.

Proposed solution

A streaming CLI command, e.g.

orca events subscribe [--type agent.status.changed] [--worktree <selector>] [--terminal <handle>] --json
  • Newline-delimited JSON, first line an ack (subscription_started), then one line per event with the same payload plugins receive.
  • Explicit loss signal: if the reader falls behind, emit events_lost and close, so the client resubscribes and reconciles with a snapshot (worktree ps --json) instead of silently missing transitions.
  • Works against paired servers with --environment, like the other commands.

Alternatives or additional context

Prior art: Herdr's socket events.subscribe with events_lost and subscribe-then-snapshot reconciliation (https://github.com/herdrdev/herdr/blob/master/docs/next/website/src/content/docs/socket-api.mdx). Related plugin-side events: #37001. Our workaround is a 60-second polling loop.

Activity

  1. 0xAlbertChen commented on Nov 30, 2026

    @0xAlbertChen

    Strong +1. Event subscriptions are essential for scaling external orchestration without expensive polling.

    Repeated CLI calls to inspect every agent, terminal, worker, and task become increasingly inefficient as the fleet grows.

    For a target fleet of up to 100 concurrent agent seats, we need:

    • An initial fleet snapshot.
    • Incremental structured lifecycle events.
    • Stable event IDs and sequence numbers.
    • Persistent consumer cursors.
    • Reconnection and event replay.
    • Filtering by host, provider, account, Run, Task, and Dispatch.
    • Clear event schema versioning.
    • Explicit visibility into event gaps and runtime availability.

    This would also make integration with Prometheus, Grafana, and external workflow engines much easier.

    The goal is to move from polling-based monitoring to reliable event-driven orchestration.

    Related: #9228, #37407.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions