workany icon indicating copy to clipboard operation
workany copied to clipboard

feat: add context assembler with token budget and auto-compaction

Open buuzzy opened this issue 7 months ago • 0 comments

Replaces the simple 2K-token conversation truncation with a proper context management system:

  • Token-budget-aware assembly (12K tokens default, up from 2K)
  • Auto-compaction: older messages summarized via LLM with strict identifier preservation (paths, URLs, IDs never lost)
  • Disk-persisted sessions (~/.workany/sessions/): full history on disk, compaction only affects model context
  • Graceful fallback: if compaction fails, falls back to simple truncation

Files: shared/context/assembler.ts, compaction.ts, session-store.ts + codeany adapter integration

buuzzy avatar Apr 17 '26 01:04 buuzzy