Routing
The router begins with heuristics about the input and current state. It can use a small model classification when the heuristic is uncertain. Configuration and special runtime inputs can force deliberate processing.
The checked-in harness defaults are 1,024 reflex output tokens and 16,384 deliberate output tokens. Provider behavior, model configuration, and the active route determine what is actually used.
Turn assembly
The runtime combines stable identity instructions with changing context: body state, current input, relevant knowledge and episodes, relationship context, procedures, projects, and tool availability. Not every stored object belongs in every prompt. Retrieval and context budgets choose a working subset, while the authoritative state remains outside the model request.Agent loop
The tool loop submits the current context, receives tool requests, executes registered calls, and returns their results to the model. Native tool mode includes agency tools for speaking and ending a turn, alongside work tools for files, research, execution, and spatial actions. The loop has bounded steps and continuation rounds. It tracks repeated work and completion signals so a tool-rich turn can make progress without continuing indefinitely. Explicit turn completion is treated as a completion signal; control-plane cancellation does not ask the model to decide whether to stop. Multiple tool calls can be dispatched within a round. Treat external tool effects as real side effects: cancelling later inference does not roll back a file write, message, or other completed action.Context compaction
Automatic compaction runs before inference when estimated input size crosses the configured fraction of the effective working budget. The default threshold ratio is0.6.
1
Protect continuity
Preserve the first exchange and a recent tail. Choose boundaries that keep tool-call and result pairs coherent.
2
Retain useful facts
When enabled, extract durable facts from older context into knowledge. This is best-effort and does not make summarization lossless.
3
Summarize the middle
Reduce older tool output and summarize the middle conversation into a structured handoff that includes the existing rolling summary.
4
Commit a successful summary
Replace the compacted middle only after a usable summary is available. Report progress to the connected surface.
Manual controls
Telegram/compact and the spatial context control request summarization. /reset clears the live conversation instead. Neither deletes durable memory. Usage and controls explains pause, cancellation, and compaction feedback.
Source: entity.py, cognition/deliberate.py, and cognition/history_compression.py.