Age tool results as the context fills instead of compacting everything

Aperta
#9 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Start in src/context/mod.rs, where tool results are emitted at their capped preview size, then read src/context/archive.rs for the artifact handle and recall path, and src/context/compact.rs to see how compaction works today. The design needs a separate aging policy that keeps the last N results at full size and never ages the diff, the last failing test output, the todo plan, or the last read of an edited file. Done means a 40-turn synthetic session stays under 70% of the window, recall returns exact original text, and disabling aging matches current behavior.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area: agent-loop area: context enhancement Might look Later priority: P2

Problem

Tool results are capped and archived, but once they are in the session they stay in the context path at full preview size until a deterministic compaction rewrites the whole conversation. A long loop therefore pays for stale grep output and old test logs on every turn, then loses exact recent facts when compaction finally runs.

Recent work on harness design found that shortening older tool results as the context fills roughly doubles fail-to-pass fractions under a tight window, and does almost nothing under a wide one. That is exactly the regime LocalHarness targets.

Evidence

  • src/context/mod.rs: every tool result on the path is emitted at its capped preview size.
  • src/context/archive.rs: results already carry an artifact handle and recall can read them.
  • src/context/compact.rs: compaction is all-or-nothing and deterministic.
  • Lewis, "Same Model, Different Harness" (2026): older-tool-result shortening roughly doubles fail-to-pass under tight context.

Proposal

Add result aging as a separate policy from compaction:

  • Keep the last N tool results (default 4) at full preview.
  • Replace older results with a one-line summary plus line count, exit status, and a recall artifact id.
  • Never age the current diff, the last failing test output, the active todo plan, or the last read of a file being edited.
  • Age only when the assembled estimate crosses 60% of usable prompt; log what was aged.
  • Keep the full text in the session and artifact store, so recall is lossless.

Acceptance criteria

  • A 40-turn synthetic session stays under 70% of the window without a full compaction.
  • Aged entries keep an artifact id and recall returns the exact original text.
  • The last failing test output is never aged.
  • Disabling aging reproduces current behavior exactly.

References

Lingua principale
Rust
Stelle
0
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di GotinhaAzul/LocalHarness

Tutte le issue di GotinhaAzul/LocalHarness

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.