Downcity
API Reference

Session Events

Which event types session.subscribe() emits and what each one means

Session Events

session.subscribe() currently emits these core event types:

  • turn-start
  • text-delta
  • reasoning-delta
  • tool-call
  • tool-result
  • assistant-step
  • turn-finish
  • error

The most common one is text-delta

If you only need real-time text output, this is usually enough to handle first:

if (event.type === "text-delta") {
  process.stdout.write(event.text);
}

If you want a fuller experience, you will usually also handle:

  • turn-start
  • turn-finish
  • error
  • assistant-step
  • tool-call
  • tool-result

assistant-step is especially useful for transports such as chat bridges that want step-level visible reply chunks without owning Session history persistence themselves.