Comma Agents
@comma-agents/daemonProtocol

List & Subscribe

Listing runs, subscribing to events, and unsubscribing.

Clients can list all runs and subscribe to (or unsubscribe from) a specific run's events.

Listing Runs

Request: list_strategies

Request a list of all runs (pending, running, completed, errored, cancelled).

{
  "type": "list_strategies",
  "requestId": "list-1"
}
FieldTypeRequiredDescription
type"list_strategies"yesMessage type discriminator
requestIdstringnoEchoed on the response for correlation

Response: strategy_list

{
  "type": "strategy_list",
  "runs": [
    {
      "runId": "run_abc123",
      "strategyName": "Code Review Pipeline",
      "status": "running",
      "startedAt": "2025-01-15T10:30:00.000Z"
    },
    {
      "runId": "run_def456",
      "strategyName": "Research Team",
      "status": "completed",
      "startedAt": "2025-01-15T10:25:00.000Z",
      "completedAt": "2025-01-15T10:26:30.000Z"
    }
  ],
  "requestId": "list-1",
  "ts": "2025-01-15T10:30:05.000Z"
}
FieldTypeDescription
type"strategy_list"Message type discriminator
runsRunSummary[]Array of run summaries
requestIdstring?Echoed from the request
tsstringISO-8601 timestamp

Subscribing to a Run

The client that sends prepare_run is automatically subscribed to the run's events. Other clients can subscribe to an existing run to receive its events.

Request: subscribe

{
  "type": "subscribe",
  "runId": "run_abc123",
  "requestId": "sub-1"
}
FieldTypeRequiredDescription
type"subscribe"yesMessage type discriminator
runIdstringyesThe run to subscribe to
requestIdstringnoEchoed on any error response

On success, there is no direct response — the client begins receiving events for the run (step_started, agent_output, etc.).

On failure (run not found or client not registered), the daemon replies with an error:

{
  "type": "error",
  "code": "SUBSCRIBE_ERROR",
  "message": "Run run_abc123 not found",
  "ts": "2025-01-15T10:30:00.000Z"
}

Unsubscribing from a Run

Request: unsubscribe

{
  "type": "unsubscribe",
  "runId": "run_abc123"
}
FieldTypeRequiredDescription
type"unsubscribe"yesMessage type discriminator
runIdstringyesThe run to unsubscribe from
requestIdstringnoNot used (no response sent)

There is no response. The client silently stops receiving events for the run.

On this page