zeroclaw/src/agent
Argenis 93b5a0b824
feat(context): token-based compaction, persistent sessions, and LLM consolidation (#3574)
Comprehensive long-running context upgrades:

- Token-based compaction: replace message-count trigger with token
  estimation (~4 chars/token). Compaction fires when estimated tokens
  exceed max_context_tokens (default 32K) OR message count exceeds
  max_history_messages. Cuts at user-turn boundaries only.

- Persistent sessions: JSONL append-only session files per channel
  sender in {workspace}/sessions/. Sessions survive daemon restarts.
  Hydrates in-memory history from disk on startup.

- LLM-driven memory consolidation: two-phase extraction after each
  conversation turn. Phase 1 writes a timestamped history entry (Daily).
  Phase 2 extracts new facts/preferences to Core memory (if any).
  Replaces raw message auto-save with semantic extraction.

- New config fields: agent.max_context_tokens (32000),
  channels_config.session_persistence (true).

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 09:25:23 -04:00
..
agent.rs fix: expose MCP tools to delegate subagents (#3436) 2026-03-13 16:26:01 -04:00
classifier.rs feat(agent): log query classification route decisions 2026-02-24 16:02:59 +08:00
dispatcher.rs style: fix cargo fmt violations blocking CI lint (#3244) 2026-03-11 21:53:25 -04:00
loop_.rs feat(context): token-based compaction, persistent sessions, and LLM consolidation (#3574) 2026-03-15 09:25:23 -04:00
memory_loader.rs fix(memory): stop autosaving assistant summaries and filter legacy entries 2026-02-20 01:14:08 +08:00
mod.rs feat(agent): add rule-based query classification for automatic model routing 2026-02-18 14:41:58 +08:00
prompt.rs fix(agent): add channel media markers to system prompt (#3459) 2026-03-14 06:58:40 -04:00
tests.rs fix(provider): preserve reasoning_content in tool-call conversation history 2026-02-22 17:40:48 +08:00