agent-loop: projection, recovery, compaction into the crate (phase 3)
Nightly Build / build (push) Successful in 6m49s
Nightly Build / build (push) Successful in 6m49s
The session handler is now a thin shell: three entry points in kernel_turn.rs (run_kernel_turn / recover_turn / resolve_pending_call) and the ChatSessionHandler. Everything that shaped a Value — projection, recovery, compaction mechanics, the LLM loop, message building — lives in agent-loop or behind a loop_adapters trait. agent-loop: - projection/ (mod + media): stored history -> wire messages, the one place provider divergence lives; well-formedness contract, DTL injections (append-only), media parts. LinearAssembler is now a Projection + ProjectionHooks config, not its own implementation - recovery.rs: reap interrupted batches -> resolve the deepest frame's non-terminal calls (Running by policy + RestartHint, AwaitingHuman re-asked) -> un-wedge finished children -> cascade up, every frame on its own agent (B3) - compaction.rs: split point (never assistant+tool group), transcript, SUMMARY_PREFIX/preamble/template, the no-tools model call, summary row - manager: resolve_pending (gate skipped, real ToolContext, then continue incl. sub-agent); start_loop used by recovery; LiveInput - delegate: AsyncExecutor + StoreSink for mode:async (durable cron row, result delivered back into the parent conversation) - kernel/context/store: support the above (TurnScope via Extensions, frame lookups, aligned result-text semantics) skald-core: - loop_adapters: UserLoopRuntime (D12 - one LoopManager per user), TurnScope (per-turn state in the Extensions type-map; no scope is denied), projection_cfg/media_source/tool_digest (Skald's projection knobs without owning projection code), async_task (CronExecutor + DurableSink) - session/handler: stripped to mod.rs + kernel_turn.rs + config.rs + interface_tools.rs + media.rs; deleted agent_dispatch, approval, dispatch, emitter, gate, llm_call, llm_loop, message_builder, messages, outcome, resume - compactor.rs: policy only (threshold, model pick, CompactionEvent); mechanics are the crate's CLAUDE.md updated (recovery, compaction, sub-agents, approval gate, projection sections now describe the crate-owned flow).
This commit is contained in:
@@ -192,7 +192,7 @@ pub async fn for_stack_all(
|
||||
}
|
||||
|
||||
/// Ok messages for a stack frame whose id is strictly greater than `after_id`,
|
||||
/// ordered chronologically. Used by `build_openai_messages` when a compaction
|
||||
/// ordered chronologically. Used by the projection when a compaction
|
||||
/// summary exists: only the "raw" messages after the summary boundary are loaded.
|
||||
pub async fn for_stack_since(
|
||||
pool: &SqlitePool,
|
||||
|
||||
@@ -12,7 +12,7 @@ pub struct ChatSummary {
|
||||
pub stack_id: i64,
|
||||
pub content: String,
|
||||
/// All chat_history rows with `id <= covers_up_to_message_id` are covered
|
||||
/// by this summary. `build_openai_messages` loads only rows *after* this id.
|
||||
/// by this summary. The projection loads only rows *after* this id.
|
||||
pub covers_up_to_message_id: i64,
|
||||
pub created_at: String,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user