125 void set_hooks(
const HookInterface& hooks) { hook_iface_ = hooks; }
131 HookInterface hook_iface_;
Manages automatic context compaction.
Handles context management for the agentic loop.
void fire_post_compact_hooks(LoopContext &ctx, int old_count, int new_count)
Fire post-compaction callbacks + ON_POST_COMPACT hook.
std::pair< int, int > prune_tool_results(LoopContext &ctx, int keep_recent)
Replace old tool results with stubs.
void prune_old_tool_results(LoopContext &ctx)
Auto-prune tool results older than TTL iterations.
void refresh_context_limit(LoopContext &ctx, int context_length)
Refresh context limit based on tier config.
bool fire_pre_compact_hook(LoopContext &ctx, bool force)
Fire ON_PRE_COMPACT; report whether compaction was cancelled.
void set_hooks(const HookInterface &hooks)
Set the hook dispatch interface.
void inject_context_warning(LoopContext &ctx)
Inject context usage warning if over threshold.
void check_compaction(LoopContext &ctx, bool force=false)
Check and perform compaction if needed.
Auto-compaction for context management.
Types for the agentic loop engine.
Hook dispatch interface injected into engine subsystems.
Activate model on GPU (WARM → ACTIVE).
Engine-level hooks called during context management.
std::function< void(LoopContext &)> after_compaction
Post-compaction hook.
Callback function pointer types for engine events.
Mutable state carried through the agentic loop.