clawdie-ai/docs/internal
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
..
scripts fix: update all stale PostgreSQL 17 references to 18 2026-04-18 09:12:48 +00:00
sessions docs: add session log for Aider+Pi harness migration (Sam & Claude) 2026-04-12 10:34:20 +02:00
sql fix: replace hardcoded 'clawdie' with AGENT_NAME across 22 files 2026-04-15 21:41:41 +00:00
AGENT-HARNESS-V2.md docs: mark Phase 2.4 skill library validation complete 2026-04-18 22:18:22 +00:00
BUILD-TEST-REPORT-06.APR.2026.md bump: align version to 0.9.0 + add build test report 2026-04-06 12:37:27 +00:00
BUILTIN-KNOWLEDGE-SPEC.md
CLEAN-RESET-PI-TUI.md docs: fix 19 stale/broken issues across docs.clawdie.si and markdown sources (Sam & Claude) 2026-04-12 13:36:33 +02:00
CMS-DEPLOYMENT-PLAN.md docs: standardize subnet to 10.0.0 + fix stale references 2026-04-06 02:15:41 +00:00
CODEX-FREEBSD.md
DEBUG_CHECKLIST.md docs: update SQLite references to PostgreSQL ops database (Sam & Claude) 2026-04-11 14:56:24 +02:00
DOCUMENTATION.md docs: comprehensive doc audit — update 16 files for consistency with codebase 2026-04-18 22:15:59 +02:00
HEARTBEAT.md docs: comprehensive doc audit — update 16 files for consistency with codebase 2026-04-18 22:15:59 +02:00
JAIL-CLEANUP-MODEL.md docs: update architecture, install, and handoff docs for current state 2026-04-16 08:34:32 +00:00
LOCAL-KNOWLEDGE-BOOTSTRAP.md
LOCAL-LLM.md Remove legacy agent IDs + tighten task API 2026-04-19 06:54:28 +00:00
mount-allowlist.example.json
nanoclaw-architecture-final.md Tighten aider runner timeouts and tests 2026-04-12 16:54:33 +00:00
PI-SKILLS-INTEGRATION.md docs: update plan, architecture, and roles docs with prompt assembly changes (Sam & Claude) 2026-04-16 12:51:20 +02:00
POSTGRES-HYBRID-MEMORY.md docs: PG17→PG18, delete stale docs, merge documentation + Strapi docs (Sam & Claude) 2026-04-16 11:41:44 +02:00
POSTGRES-MEMORY.md fix: update all stale PostgreSQL 17 references to 18 2026-04-18 09:12:48 +00:00
POSTGRES-PERMISSIONS.md docs: PG17→PG18, delete stale docs, merge documentation + Strapi docs (Sam & Claude) 2026-04-16 11:41:44 +02:00
REFACTOR-PLAN.md Remove legacy agent IDs + tighten task API 2026-04-19 06:54:28 +00:00
SKILLS-ARTIFACT-V1-PLAN.md Docs: align split-brain and doctor with dev mode 2026-04-18 19:11:05 +00:00
STRAPI-FREEBSD-SETUP.md docs(strapi): document API token algorithm and regeneration procedure 2026-04-13 13:32:50 +00:00
test-results.md docs: add test-results.md — 91 files / 1527 tests passing 2026-04-15 05:57:38 +00:00
tmux-screenshot-sample.png