co-mono/packages/coding-agent/test
Mario Zechner a38e619095 feat(coding-agent): implement new compaction system with overflow recovery
Phase 1: Updated compaction.ts
- findCutPoint now returns CutPointResult with isSplitTurn and turnStartIndex
- Can cut at user, assistant, or bashExecution messages (never tool results)
- Added turnPrefixSummary support for split turns (parallel summarization)
- estimateTokens helper for context size estimation

Phase 2: Updated session-manager.ts
- CompactionEntry now has optional turnPrefixSummary field
- loadSessionFromEntries injects both summaries when turn was split

Phase 3: Updated agent-session.ts
- Overflow detection via isContextOverflow after agent_end
- Proactive compaction check on turn_end before next LLM call
- _abortingForCompaction flag to skip saving aborted messages
- Auto-retry after overflow recovery or proactive compaction
- New event fields: reason (overflow/threshold), willRetry

Phase 4: Updated interactive-mode.ts
- Shows reason in compaction status (Context overflow detected...)
- Shows retry status after compaction

Tests updated for new CutPointResult return type.
2025-12-09 17:18:53 +01:00
..
fixtures Add test fixture for auto-compaction testing 2025-12-09 02:49:47 +01:00
compaction.test.ts feat(coding-agent): implement new compaction system with overflow recovery 2025-12-09 17:18:53 +01:00
fuzzy.test.ts Reorganize file structure: core/, utils/, modes/interactive/components/, modes/interactive/theme/ 2025-12-09 00:51:33 +01:00
rpc-example.ts Update RPC example to use RpcClient 2025-12-09 14:44:13 +01:00
rpc.test.ts Fix agent event ordering: update state before emitting events 2025-12-09 14:33:39 +01:00
test-theme-colors.ts Reorganize file structure: core/, utils/, modes/interactive/components/, modes/interactive/theme/ 2025-12-09 00:51:33 +01:00
tools.test.ts Reorganize file structure: core/, utils/, modes/interactive/components/, modes/interactive/theme/ 2025-12-09 00:51:33 +01:00
truncate-to-width.test.ts fix: TUI crash with Unicode characters in branch selector 2025-12-05 11:59:39 +01:00