Summary
The thread/turn/item model is one of the strongest parts of the project, but protocol parity across the TUI runtime, runtime API, app-server, and resume/fork flows is still incomplete. We should stabilize that surface so outside clients can rely on it.
Scope
- Close field and behavior gaps across:
- TUI runtime
- runtime HTTP/SSE API
- app-server transport
- resume/fork/compact flows
- Preserve structured system prompt data across resume/fork/compaction instead of flattening it to plain text
- Strengthen schema-version and migration handling for persisted runtime records
- Add compatibility tests for the most important thread lifecycle operations
Acceptance Criteria
- Resume/fork/compact behavior is consistent across runtime surfaces
- Structured prompt metadata survives round-trips where intended
- Protocol docs match actual wire behavior
- Tests cover the main lifecycle paths and persisted-state compatibility
Starting Points
docs/RUNTIME_API.md
crates/app-server/src/lib.rs
crates/protocol/src/lib.rs
crates/tui/src/runtime_api.rs
crates/tui/src/runtime_threads.rs
Summary
The thread/turn/item model is one of the strongest parts of the project, but protocol parity across the TUI runtime, runtime API, app-server, and resume/fork flows is still incomplete. We should stabilize that surface so outside clients can rely on it.
Scope
Acceptance Criteria
Starting Points
docs/RUNTIME_API.mdcrates/app-server/src/lib.rscrates/protocol/src/lib.rscrates/tui/src/runtime_api.rscrates/tui/src/runtime_threads.rs