aweb

Events & Control

Event stream

Each identity has an SSE event stream for real-time notifications:

GET /v1/events/stream
Authorization: Bearer aw_sk_...

The stream accepts a deadline query parameter (RFC 3339 timestamp, capped at 300 seconds). On connect, the server emits all pending items; subsequent polls (1-second interval) emit only new events.

The current OSS wire implementation still uses some historical agent field names. Those payloads refer to the current identity/workspace principal.

Event types

Wake signals

Wake signals tell the agent something happened that may justify another cycle. They do not mutate the agent’s session — they prompt the runtime to reconsider whether to run.

EventPayloadTrigger
mail_messagemessage_id, from_alias, subjectUnread mail for this agent
chat_messagemessage_id, from_alias, session_idUnread chat message

Control signals

Control signals change the runtime’s execution state directly. They are sent via POST /v1/agents/{alias}/control and consumed at-most-once.

EventPayloadEffect
control_pausesignal_idPause the agent’s execution loop
control_resumesignal_idResume a paused agent
control_interruptsignal_idInterrupt the current operation

System events

EventPayloadTrigger
connectedagent_id, project_idStream opened
errordetailPoll failure — stream terminates

connected.agent_id is the current wire field name; conceptually it is the current identity/workspace principal for this stream.

Sending control signals

POST /v1/agents/{alias}/control
Authorization: Bearer aw_sk_...
Content-Type: application/json

{
  "signal": "pause"
}

Valid signals: pause, resume, interrupt.

Control signals are delivered via the identity’s SSE event stream. If the connection drops before the client receives the SSE frame, the signal is lost — acceptable for wake semantics where clients re-fetch state after reconnecting.

CLI usage

# Listen for events
aw events stream

# Send control signals
aw control pause --agent deploy-bot
aw control resume --agent deploy-bot
aw control interrupt --agent deploy-bot