Kernel V3 engine
Kernel V3 is Zagens’ production event-sourced turn engine — the same core on desktop, zagens-tui, and the headless zagens CLI.
Since v0.8.0, Kernel V3 is the only production turn path. Older shadow/diagnostic APIs (kernel-shadow) are removed.
What it means for you
| Benefit | Explanation |
|---|---|
| Consistent behavior | Desktop sidecar, terminal TUI, and CLI share one turn semantics — fewer “works in GUI but not in CLI” surprises |
| Reliable session resume | Turns are recorded as an append-only kernel event log in sessions.db; resume prefers log-first transcript repair over fragile session JSON alone |
| Auditable turns | Model calls, tool batches, approvals, steer injections, and LHT continuations leave structured events you can replay in CI |
You do not configure “Kernel V3” in Settings — it is always active in current releases.
Three surfaces, one engine
| Surface | How runtime runs | Best for |
|---|---|---|
| Desktop (Tauri) | zagens-runtime sidecar on localhost |
Diff, replay, embedded PTY, Office mode |
Terminal TUI (zagens-tui) |
In-process runtime | Full-screen terminal UI on Windows / macOS / Linux |
CLI (zagens) |
In-process runtime | exec, review, serve --http, CI |
All three call the same LiveTurnMachine + EffectInterpreter pipeline inside zagens-core.
Log-first session resume
When you reopen a thread after restart:
- Zagens loads persisted kernel events for that turn history.
- The transcript is repaired from the log when needed (default
log_transcript_repair = true). - Desktop, TUI, and CLI resume the same SQLite thread store under
~/.zagens/.
This is especially important for long LHT or CRAFT runs that span many tool steps.
Related concepts
- Steer — inject a follow-up instruction mid-turn (TUI: Enter during tool gaps, Ctrl+Enter to force). Kernel records
SteerInjectedevents. - Sidecar — desktop-only local HTTP process; TUI/CLI skip it and embed runtime directly.
- Golden replay — internal CI fixtures verify turn logs stay coherent; not a user-facing feature.
Further reading
- Terminal TUI — full-screen ratatui UI
- Headless CLI — automation and servers
- Chat sessions — threads and restore UX
- Streaming & stop — SSE and sidecar connection
Product technical spec (maintainers): AGENT_KERNEL_V3.md