clawdie-ai/docs
Clawdie AI 40cc606b6e feat(compaction): session compaction with LLM summarization, /compact command, sanitize utils
When pi session JSONL exceeds AGENT_SESSION_MAX_BYTES, the runner now
compacts instead of silently dropping the session. Old turns are
summarized via pi --print --no-session (with concatenation fallback),
stored in mevy_brain at importance=4, and the session file is rewritten
with a compaction header + last N recent turns at full fidelity.

If compaction fails, a memory handoff is injected into the system prompt
via <session-reset-context> so the fresh session has context carryover.

Also:
- Extract sanitizeInboundText/truncateUtf8ByBytes to src/sanitize.ts
- Fix mojibake (double-encoded U+2500 box-drawing) in telegram.ts
- Add /compact Telegram command (admin-gated, inline keyboard)
- Delete superseded docs/internal/compact-implementation-plan.md
- Add AGENT_SESSION_COMPACT_ENABLED/KEEP_TURNS/MIN_ENTRIES config vars

---
Build: pass | Tests: pending — FreeBSD validation needed (Sam & Claude)
2026-04-20 12:17:55 +02:00
..
internal feat(compaction): session compaction with LLM summarization, /compact command, sanitize utils 2026-04-20 12:17:55 +02:00
public docs: document hostd API proxy architecture for jail agents 2026-04-19 08:32:29 +02:00