Chat: add model-aware history budgets and safe compaction for replay/recovery

Offen
#430 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
12/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
go
Bereich
ai-infra-agents

Rechercherichtung

This is design work spanning chat prompt construction, transcript persistence, branch/edit invalidation and native-session recovery, and the payload names no specific files or tests. Start by locating where the chat prompt and history are assembled for the selected model, and read the related transport fix in #429. Done would need a settled budget/compaction design and the listed acceptance tests (oversized draft, pending confirmations, branch invalidation, missing native transcript, multibyte UTF-8) passing against a fixture provider.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Related transport fix: #429.

Moving a chat prompt from argv to stdin avoids the operating system's per-argument limit, but does not enforce the selected model's context window. Long authoritative transcripts, including saved operation drafts, can still grow indefinitely. Branches, edited histories, executor changes and missing native sessions require full-history reconstruction, which may exceed the model budget even when normal incremental continuation works.

Please consider a separate context-management change:

  • Define provider/model-aware input budgets with room for system instructions, tool schemas and expected output. Track serialized UTF-8 bytes separately from estimated/model token counts; do not treat a 128 KiB OS argument threshold as a model context limit.
  • Build a bounded model-facing projection while preserving the authoritative user-visible transcript. Summaries should retain user constraints, pending approvals and operation receipts, and must not turn historical instructions into current authorization.
  • Use a persisted, revision-bound summary/checkpoint plus recent turns; invalidate it correctly when editing or branching. Keep the current question intact and expose a clear diagnostic when even the current turn cannot fit.
  • Ensure initial chat, long-history branches and native-session recovery use the same budget/compaction policy. Coordinate with provider-native compaction instead of replaying unbounded history after a cache miss.
  • Return structured, redacted failure codes for input budget/context overflow, distinct from process-launch E2BIG, provider quota failures and malformed tool JSON. Log byte/token counts and correlation IDs rather than complete prompts or credentials.

Acceptance tests should cover an oversized historical draft, preservation of pending confirmations, edited/branched history invalidation, missing native transcript recovery, and multibyte UTF-8 budgeting. These tests should use synthetic transcripts and a local fixture provider.

No deployment-specific transcripts, addresses or credentials are needed to reproduce or test this behavior.

Vorherrschende Sprache
Go
Sterne
141
Forks
28
Ø Merge
1 T. 15 Std.
Gemergte PRs (30 T.)
113

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus Tencent/LoopForge

Alle Issues in Tencent/LoopForge

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.