compact: retain newest ~20% of context; refactor startup into internal/app
- Replace fixed 6-message compact retention with ratio-based logic: retain ~20% of compactable estimated tokens, with a 6-message floor and user-turn boundary alignment - Add compactRetainedTokenBudget, compactRecentStart, compactTurnBoundary helpers in internal/agent/agent.go - Add TestAgentCompactKeepsTwentyPercentRecentContext - Move startup/session/repl/bootstrap logic from root into internal/app so main.go is a thin binary entry point (15 lines) - Update /compact docs in README.md
This commit is contained in:
@@ -109,7 +109,7 @@ go run . [flags]
|
||||
Slash commands:
|
||||
|
||||
- `/clear` resets conversation history.
|
||||
- `/compact` summarizes older conversation history and keeps recent context.
|
||||
- `/compact` summarizes older conversation history and keeps the newest ~20% of context, with a small recent-message floor.
|
||||
- `/status` shows changed files with `git status --short`.
|
||||
- `/diff [--stat] [path...]` shows the unstaged git diff.
|
||||
- `/test [command...]` runs a project test command; defaults to `go test ./...` for Go modules or `npm test` for Node projects.
|
||||
|
||||
Reference in New Issue
Block a user