Concept reference

The Agent Runtime

How SimPilot acts like an engineering agent: phases, typed events, tools, approvals, subagents, and replay.

1 min read

Phases, not free-form chat

Every chat turn runs through a typed phase from packages/agent/src/kernel/phase-config.ts: intake_plan, specify, execute, diagnose, validate, report. Each phase has its own prompt, tool budget, approval policy, and exit conditions. A run that violates a phase contract is paused for review rather than silently retried.

Typed events over transcript prose

A turn is not just text. It can contain plan updates, case artifacts, tool calls, approvals, command records, solver diagnostics, validation results, report previews, notifications, and subagent events. The UI projects typed records; the model receives a lean transcript through ModelMessage conversion.

Tools are capability contracts

Core tools span workspace inspection, file patches, CaseSpec mutation, command execution, knowledge search, docs search, resource navigation, skill loading, compile/run/postprocess, validation, report generation, and publication. Each tool is Zod-typed for input and output and ships with a renderer, approval policy, and error contract. Good fixes strengthen these contracts instead of hardcoding prompt-only shortcuts.

Subagents for separable concerns

When a problem is genuinely distinct — solver debugging, resource research, UI verification, report review — the kernel can spawn a signed subagent with a constrained tool budget. Subagents have their own rollout segment; they return typed findings to the parent agent without polluting its context.

Autocompact

Long investigations would otherwise blow the context window. The autocompact pass (packages/agent/src/kernel/autocompact.ts) summarizes cold segments into typed memory entries, preserving citations, decisions, and case-state references while shedding raw bytes. The full rollout remains replayable from durable records.

Replay and debuggability

Local development exposes rollout records through /dev/euphony, Harmony JSONL exports, raw Codex-session JSONL, and the typed ?format=rollout endpoint. Use those when debugging agent behavior — they preserve the typed event sequence behind the chat UI.

Was this page helpful?

Edit this page on GitHub

Search docs

Find pages across the SimPilot docs.