Chat: add model-aware history budgets and safe compaction for replay/recovery
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 12/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- go
研究方向
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.
由索引模型根據 Issue 內容生成。
描述
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.
- 主要語言
- Go
- 星號
- 141
- 分支
- 28
- 平均合併
- 1 天 15 小時
- 30 天內合併 PR
- 113
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
Tencent/LoopForge 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 74/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
維護者通常 1 天內回覆
-
[Bug]: 官方镜像未安装 wecom-cli,企业微信通知报「通知服务未安装 wecom-cli」可能已有人在做 @newexploreor 於 1 天前認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 76/100
Tencent/LoopForge#156 · 1 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
【架构优化】合并 gitwork/workbranch.go 中 push/pull 重复的默认提交身份注入为 withFallbackIdentity可能已有人在做 @fx-kurumi 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 40/100
維護者通常 1 天內回覆
-
【架构优化】从 runtime.installNPMCLI 中拆出 npm 参数拼装 npmCLIInstallArgs 与安装结果启用 activateNPMStage可能已有人在做 @fx-kurumi 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 30/100
維護者通常 1 天內回覆
查看 Tencent/LoopForge 的全部 Issue
相似的 Issue
-
team:library-maintainers
難度 2/5 1-3 小時 新手友好度 82/100
padok-team/burrito#1208 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 62/100
bazel-contrib/rules_go#4784 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 2/5 1-3 小時 新手友好度 62/100
POSIdev-community/aictl#40 ·
-
難度 1/5 1 小時以內 新手友好度 62/100
prime-radiant-inc/evener#6306 ·
維護者通常 1 天內回覆