Commit 02a60ef
feat(cli): manual /compact slash command (#128)
Auto-compaction already runs in the agent loop at the context threshold; this
exposes a manual `/compact` that summarizes the conversation on demand (reusing
core's compact()). Sets ctx.newHistory so the REPL swaps in the compacted
history, mirroring /rewind summarize. No-ops cleanly when there's no provider
or the conversation is already short.
Tests: +2 (no-provider guard, empty-history). BEHAVIOR_PARITY /compact → ✅.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent b10cb34 commit 02a60ef
3 files changed
Lines changed: 38 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
422 | 437 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
678 | 678 | | |
679 | 679 | | |
680 | 680 | | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
681 | 702 | | |
682 | 703 | | |
683 | 704 | | |
| |||
732 | 753 | | |
733 | 754 | | |
734 | 755 | | |
| 756 | + | |
735 | 757 | | |
736 | 758 | | |
737 | 759 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
0 commit comments