Architecture
Events & replay
Roder represents meaningful runtime transitions as RoderEvent values in
roder-api. Events are wrapped in an EventEnvelope with source,
timestamp, thread id, turn id, and stable event identity.
What flows through the stream
- Runtime and extension registration events.
- Session creation, session load, turn start, turn completion, and cancellation.
- Context assembly, inference start, and provider inference events.
- Tool call requested, started, completed, and failed events.
- Approval requests, approval resolutions, policy decisions, and plan-mode exits.
- Subagent lifecycle events and child-agent transcript updates.
- Task, notification, memory, file-change preview, and UI-oriented events.
Why this matters
The TUI, app server, journals, telemetry exporters, eval harnesses, and future training systems should not reach into the runner. They subscribe to the same event stream and render, persist, score, or replay from canonical data.
Event sinks
Extensions can register EventSink implementations. That is the natural
seam for OpenTelemetry, JSONL stores, RL trajectory collection, audit logs, or product
analytics without coupling those concerns to roder-core.
Design rule. If a behavior is important to reproduce or explain later,
it should become a typed event instead of a side-effect hidden in a UI or provider adapter.