feat(core): preserve visual context across compaction - #7207
Conversation
tmux UI verificationTested the built CLI (
The UI run found the adjacent-user/post-compaction duplicate, which is fixed by follow-up commit 847d92a. The regression test now covers the same coalescing path. |
CI follow-upThe stacked base's first repository-wide run exposed an incomplete
PR #7207 remains stacked on #7206. The base PR's fresh Qwen Code CI run remains running and was not cancelled. |
|
Thanks for the PR! Template: the body uses Summary / Validation / Notes instead of the template's headings (What this PR does, Why it's needed, Reviewer Test Plan, Risk & Scope, Linked Issues, 中文说明). The substance is there — summary, test results, and the #6988 reference — so I'll note the mismatch without blocking. Worth aligning with the template on the next revision so reviewers can scan it at a glance. Problem: this solves a real, user-facing gap. After compaction, images from earlier in the conversation are lost — users can't reference them by ID, and visual context doesn't survive resume or Direction: squarely aligned with the roadmap/context-performance area and the multimodal routing work in the stacked base (#7206). The approach — deterministic image IDs that survive compaction, explicit multi-image focus, and store reconciliation across lifecycle events — is a natural extension of the existing image reference system. Size: 351 production logic lines across 8 source files (core: Approach: the scope feels right. The API simplification — replacing Moving on to code review. 🔍 中文说明感谢贡献! 模板:PR body 使用了 Summary / Validation / Notes 而非模板要求的标题(What this PR does、Why it's needed、Reviewer Test Plan、Risk & Scope、Linked Issues、中文说明)。实质内容都在——总结、测试结果、#6988 引用——所以标注这个差异但不阻塞。建议下次对齐模板方便 reviewer 快速浏览。 问题:解决了真实的用户问题。compaction 后早期对话中的图片丢失——用户无法通过 ID 引用,visual context 无法在 resume 或 方向:与 roadmap/context-performance 和多模态路由工作(stacked base #7206)完全对齐。方案——跨 compaction 存活的确定性 image ID、显式多图聚焦、跨生命周期事件的 store reconciliation——是现有 image reference 系统的自然扩展。 规模:8 个源文件共 351 行生产逻辑(core: 方案:范围合理。API 简化——用单一 进入代码审查 🔍 — Qwen Code · qwen3.7-max Reviewed at |
Code ReviewThe implementation is clean and well-structured. The API simplification in One issue found: No other correctness, security, or convention issues. The code follows project conventions — ESM, no Test ResultsAll changed-file tests pass except
Session.worktree.test.ts failure outputThe mock 中文说明代码审查实现清晰、结构良好。 发现一个问题: 无其他正确性、安全性或规范问题。代码遵循项目约定——ESM、无 测试结果除
失败原因:mock — Qwen Code · qwen3.7-max Reviewed at |
|
Confidence: 4/5 — solid implementation that solves a real problem cleanly; the This PR does what it sets out to do: make visual context survive compaction, resume, clear, and rewind. The implementation matches and exceeds what I would have proposed independently — the API consolidation from three functions to one ( The stacked-PR structure is clean: 3 focused commits on top of #7206's base branch, with a clear plan to retarget to Two hygiene items for the author before merge:
Approving. ✅ 中文说明信心度: 4/5 — 扎实的实现解决了真实问题; 这个 PR 完成了它的目标:让 visual context 在 compaction、resume、clear 和 rewind 中存活。实现匹配并超越了我的独立方案——API 从三个函数合并为一个( Stacked PR 结构清晰:在 #7206 基础分支上 3 个聚焦的 commit,计划在 base 合并后 retarget 到 合并前两个卫生项:
批准 ✅ — Qwen Code · qwen3.7-max Reviewed at |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Reviewed — no blockers. Suggestions are inline.
— qwen3.7-max via Qwen Code /review
|
本轮按 review feedback 做了最小修复:microcompaction 和 memory-pressure compact_history 两个直接 |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Reviewed — no blockers. Suggestions are inline.
— qwen3.8-max-preview via Qwen Code /review
🔍 Local Verification Report — PR #7207Branch: Test Results
|
4df535b to
070fc38
Compare
|
Resolved the active review threads in
Verification: 3 focused test files passed, 519 tests total. The PR is still a draft with a stale stacked base and broad merge conflicts. Since #7206 is merged, retargeting #7207 to |
Summary
Validation
Notes
mainafter that PR merges