Compaction: the model's notes replace the middle of a long run (#158)
Before each driver call, over compact_at (0.6) of the prompt budget, the same model is asked for notes over the very request it was about to get, plus one message, so the server's cache covers all but the notes. The notes, with code's list of the calls they replace, become a compaction event that renders in place of its range, keeping word for word what started the work and the last few turns. Rare, large steps keep the prompt's start unchanged between them. A later compaction folds in the earlier; one from an earlier run's view is hidden. Failed notes are logged and fitting takes over. Fitting now applies compactions before it measures, records what it cuts (Trim) and logs each cut as context.trimmed. Wired into both agents' drivers and the benchmark; nisse-dev's helper loop is a follow-up. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J5Utyfzw7gF7UhjRDEtjTk
This commit is contained in:
1 parent
fa8d93cf41
commit
cb638fe687
20 files changed
+952
-44
No files matched your search
@@ -713,6 +713,10 @@ of earlier points, replies on threads, the round cap and its reset, `stop` and
|
||||
environment only. A stop ends a git command, and a cut-short first clone is
|
||||
removed. `review.clone` / `review.fetch` log the time and size. No size
|
||||
limits yet. Tests: `test_clones.py`, against local bare repositories.
|
||||
- **Compaction** (#158; reviews of PRs touching about 20 files hit the turn cap,
|
||||
re-reading files fitting had cut): shared by both agents' driver runs, as in
|
||||
L6 above. Each cut fitting still makes is logged (`context.trimmed`).
|
||||
Tests: `test_compact.py` in nisse-core.
|
||||
|
||||
**M7.6 Deployment.** *Waits for the agent host (Phase 6).* Its image, container,
|
||||
Gitea account and secrets (R5). The image needs `git`, and `scratch/` a
|
||||
@@ -771,6 +775,15 @@ if the implementation differs.
|
||||
proposal comment older than the reply.
|
||||
- **L5 transport:** the `Transport` interface is send, ask and receive. Intake
|
||||
backoff is exponential, capped at a few minutes.
|
||||
- **L6 compaction (#158):** before each driver call, over `compact_at` (0.6) of
|
||||
the prompt budget, the same model is asked, over the same request plus one
|
||||
message, for notes on everything between what started the work and the last
|
||||
turns (at most `compact_keep_turns`, 3, in `compact_to`, 0.25). The notes,
|
||||
with code's list of the calls they replace, become a `compaction` event
|
||||
that renders in place of its range; a later one folds in the earlier.
|
||||
Failed notes are logged (`context.compaction_failed`) and fitting takes
|
||||
over; `context.compacted` logs each one. Not yet in nisse-dev's helper
|
||||
loop.
|
||||
- **L6 fitting order:** first shorten old tool results to their first and last
|
||||
lines, then drop the oldest events with a note saying so; never the system
|
||||
prompt, the current plan or the most recent turns. View labels:
|
||||
|
||||
Reference in new issue
Block a user