feat(cli): show loaded context files alongside the first prompt - #8855
Conversation
When context files (QWEN.md / context.fileName) are attached to the system prompt, surface a one-shot INFO line above the user's first prompt listing exactly which files were loaded, so users can verify discovery (e.g., catch typos in context.fileName) without digging into debug logs. Also shorten display paths for files under the user home to `~/...` in both the announcement and the /context detail breakdown. Fixes QwenLM#5267
E2E Test Report (tmux, macOS)Bundle built via 1. Startup — no new message (by design)2. First prompt — one-shot announcement appears above the prompt3. Second prompt — no repeat (full-screen grep count stays at 1)4. Typo scenario —
|
|
✅ Qwen Triage finished — CI landed green on ✅ Qwen Triage 已完成 —— |
|
Thanks for the PR! Template looks good ✓ Problem: real and observed. #5267 started as a " Direction: aligned. A small observability win requested by the reporter themselves, scoped to the CLI UI plus one additive response field. No direct counterpart found in the claude-code CHANGELOG, but context/memory-file handling is an active area there too (CLAUDE.md Size: core paths touched. Production logic ≈168 lines (core: Approach: right shape. The displayed list is carved out of the same discovery result that builds the system prompt, so what is shown cannot drift from what was attached — that's the design decision that matters, and it's the right one. The rest is mechanical: one additive response field, a Config getter/setter, a one-shot INFO item on the first non-slash submit, and the same display helper fixing the Risk: no high-risk path matches against the revert-correlated path list. Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓ **问题:**真实且已观测。#5267 最初报告 " **方向:**对齐。这是报告者本人要求的小型可观测性改进,范围限于 CLI UI 加一个增量响应字段。claude-code CHANGELOG 没有直接对应项,但 context/memory 文件处理在那边也是活跃领域(CLAUDE.md **规模:**触及核心路径。生产逻辑约 168 行(core: **方案:**形态正确。展示列表直接取自构建 system prompt 的同一份发现结果,因此显示内容与实际附加不可能漂移——这是最关键的设计决策,且是正确的。其余是机械工作:一个增量响应字段、Config getter/setter、首次非 slash 提交时的一次性 INFO 提示,以及同一个显示助手顺带修复 **风险:**未命中 revert 相关高风险路径。 进入代码审查 🔍 — Qwen Code · qwen3.8-max Reviewed at |
Code reviewThe implementation matches the design described in the PR. I verified the wiring end-to-end against the base code:
Non-blocking nits:
Test evidence (the PR's own CI, read via API)On the reviewed commit the main suite is still running; nothing is red so far. The Windows/macOS unit legs are skipped by design on PRs — they only run in the merge queue ( Final CI results for
One row per check name (latest run); skipped checks omitted; failures sort first. / 每个检查名一行(取最新一次运行),省略 skipped,失败项排在最前。 The announcement line itself is a TUI-surface behaviour that nothing in the suite pins (no AppContainer test submits a prompt and asserts the INFO item). Sandboxed verification would settle this: 中文说明代码审查实现与 PR 描述的设计一致,我对照基础代码逐条验证了接线:
非阻塞建议:
测试证据在被审查的 commit 上,主套件仍在运行,暂无红色。Windows/macOS 单测在 PR 上按设计跳过——它们只在 merge queue( 公告行本身是 TUI 表面行为,套件没有任何测试钉住它。沙盒验证可以定论: — Qwen Code · qwen3.8-max Reviewed at |
|
Confidence: 4/5 — clean, focused implementation of an explicitly requested UX gap; the two nits are cosmetic, and the TUI surface itself waits on CI (and optionally My independent proposal for this problem was exactly the shape this PR took: derive the displayed list from the same discovery result that builds the system prompt so it cannot lie, stash it on The problem is verified, not assumed: the #5267 thread shows the runtime already loads the files correctly, and the reporter explicitly asked for this exact indication — the mistyped-filename scenario is precisely what the list makes obvious. The core footprint is two small additive pieces (a response field, a getter/setter pair) that will read trivially in six months. The reservations are minor: the CI is still running on the reviewed commit (one 中文说明置信度:4/5 —— 对一个被明确请求的 UX 缺口,实现干净而聚焦;两条建议均属外观层面;TUI 表面本身等待 CI(可选 我对这个问题的独立方案与本 PR 的形态完全一致:从构建 system prompt 的同一份发现结果派生展示列表,使其不可能失真;存放在 问题是经过验证的,不是假设:#5267 讨论串表明运行时本来就正确加载了文件,而报告者明确要求的正是这个提示——拼错文件名的场景正是列表能立刻暴露的。核心足迹是两个小的增量部件(一个响应字段、一对 getter/setter),六个月后依然一目了然。保留意见都很轻微: 被审查的 commit 上 CI 仍在运行(一个 — Qwen Code · qwen3.8-max Reviewed at |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship — CI landed green after the review. ✅
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Not reviewed: build-and-test — Test (windows-latest, Node 22.x) was skipped in CI and its suite did not run locally.
Not reviewed: build-and-test — Integration Tests (CLI, No Sandbox) was skipped in CI and its suite did not run locally.
Not explored to full depth (tool budget reached): PR #8855 adds a one-shot INFO line listing the loaded con...: could not run the test suites — no node_modules in the review worktree and vitest failed to load; conclusions are from reading the test code, not executing it….
Not reviewed: reverse audit — stopped before round 5 by the review time budget.
中文说明
未审查:build-and-test — Test (windows-latest, Node 22.x) was skipped in CI and its suite did not run locally。
未审查:build-and-test — Integration Tests (CLI, No Sandbox) was skipped in CI and its suite did not run locally。
未探索到全部深度(达到工具调用预算):PR #8855 adds a one-shot INFO line listing the loaded con...:could not run the test suites — no node_modules in the review worktree and vitest failed to load; conclusions are from reading the test code, not executing it…。
未审查:反向审计——评审时间预算不足,未能开始第 5 轮。
— qwen3.8-max via Qwen Code /review (v0.21.8)
- Resolve memory-marker paths against the session working directory instead of process.cwd() in /context detail (ACP/daemon sessions) - Sanitize display paths with stripAnsiAndControl before they reach the terminal - Drop empty context files from the announced list to match concatenateInstructions' empty-content filter - Delegate home-dir shortening to tildeifyPath (with an optional home override for tests) instead of a second prefix-check implementation - Align the one-shot announcement guard with downstream input classification (trim, /btw, shell mode) - Add tests for the announcement latch, parseMemoryFiles ~ shortening, CWD-under-home and home-prefix-collision cases; use shared-volume fixtures so tests hold on Windows
Review feedback addressed (f2e90c6)Triage of the 12 findings from the automated review — 10 accepted, 2 declined with rationale below. Accepted & fixed
Declined
Verification: core + cli test suites for the touched files green ( 中文说明对自动评审的 12 条 findings 逐条 triage:采纳 10 条,不采纳 2 条(附理由)。 已修复: 不采纳:① count 与 paths 双份存储——空文件过滤修复后两者合法地不再相等(count 报告所有发现的文件,paths 只列真正进入 system prompt 的),合并会静默改变既有 count 消费方的语义;② markdown 渲染吞掉 验证:相关文件测试全绿(core memoryDiscovery 45、cli contextCommand 14、AppContainer 146),两个包 typecheck 通过,prettier/eslint 干净。 |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Not reviewed: build-and-test — Test (windows-latest, Node 22.x) was skipped in CI and its suite did not run locally.
Not reviewed: build-and-test — Integration Tests (CLI, No Sandbox) was skipped in CI and its suite did not run locally.
Not explored to full depth (tool budget reached): PR #8855 adds a one-shot INFO line listing the loaded con...: running memoryDiscovery.test.ts , contextCommand.test.ts , AppContainer.test.tsx , and core config.test.ts to confirm the updated mocks pass..
中文说明
未审查:build-and-test — Test (windows-latest, Node 22.x) was skipped in CI and its suite did not run locally。
未审查:build-and-test — Integration Tests (CLI, No Sandbox) was skipped in CI and its suite did not run locally。
未探索到全部深度(达到工具调用预算):PR #8855 adds a one-shot INFO line listing the loaded con...:running memoryDiscovery.test.ts , contextCommand.test.ts , AppContainer.test.tsx , and core config.test.ts to confirm the updated mocks pass.。
— qwen3.8-max via Qwen Code /review (v0.21.8)
|
@qwen-code /takeover |
|
🤝 Takeover engaged: the autofix loop now manages this PR — it will address new review feedback and resolve base conflicts until the label is removed or the round cap is reached. This is a fork PR, so the first round comes from the next scheduled scan (usually within minutes). Remove the 中文说明🤝 已接管:autofix 循环现在管理此 PR —— 将持续处理新的评审反馈与 base 冲突,直到移除标签或达到轮次上限。本 PR 来自 fork,首轮处理将由下一次定时扫描执行(通常几分钟内)。移除 |
|
🤖 AutoFix ran out of time before finishing (idle-timeout (no output for 1200000ms — the sandbox likely hung at startup)) (attempt 1/100) — it will retry on the next scan. What I found before stopping: See the Qwen Autofix agent step logs for model/tool output. Run log: https://github.com/QwenLM/qwen-code/actions/runs/31412188961 🧠 Handled by Qwen Code · model/模型 |
|
🤖 AutoFix ran out of time before finishing (idle-timeout (no output for 1200000ms — the sandbox likely hung at startup)) (attempt 2/100) — it will retry on the next scan. What I found before stopping: See the Qwen Autofix agent step logs for model/tool output. Run log: https://github.com/QwenLM/qwen-code/actions/runs/31412457256 🧠 Handled by Qwen Code · model/模型 |
|
🤖 AutoFix stopped: this counting window now contains 3 time-budget exhaustions (pushed rounds in between included; this round itself may have failed differently). That is 3 full agent runs that pushed nothing. 3 of those were silent-sandbox (idle) timeouts that no budget increase can cure — investigate the sandbox image and runner docker daemon for those. A human should investigate the sandbox image and runner docker daemon, then comment What I found before stopping: See the Qwen Autofix agent step logs for model/tool output. Run log: https://github.com/QwenLM/qwen-code/actions/runs/31417991439 🧠 Handled by Qwen Code · model/模型 |
|
⏸️ Takeover paused: this PR reached its round cap (100/100). Comment 中文说明⏸️ 托管已暂停:本 PR 达到轮次上限(100/100)。评论 |
…lity - Skip the announcement latch for blank submissions (dropped by the message queue before reaching the model) - Treat Windows cross-drive relative results (absolute paths) as outside the CWD tree so home-dir files still get `~` shortening - Extract the hasAttachedContent predicate shared by concatenateInstructions and contextFilePaths so "displayed = attached" holds by construction - Thread the loader's resolved userHomePath through formatContextFileDisplayPath into tildeifyPath so discovery and display agree on the home directory - Pin ordering (announcement precedes submission admission), add a whitespace-only-file filter test, exercise workingDir != cwd in the /context detail test, and cover the /directory add reload wiring
Second-round review feedback addressed (7b04b36)Triage of the 10 findings — 8 accepted, 2 declined with rationale below. Accepted & fixed
Declined
Verification: touched-file suites green (core 中文说明对第二轮 10 条 findings 逐条核实(含代码验证与 已修复:空白提交不再消费 latch( 不采纳:① 委托 验证:相关文件测试全绿(core memoryDiscovery 46、cli AppContainer 147、contextCommand 14、directoryCommand 28),两个包 typecheck 通过,prettier/eslint 干净。 |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Not reviewed: build-and-test — Test (windows-latest, Node 22.x) was skipped in CI and its suite did not run locally.
Not reviewed: build-and-test — Integration Tests (CLI, No Sandbox) was skipped in CI and its suite did not run locally.
Not explored to full depth (tool budget reached): PR #8855 (QwenLM/qwen-code) adds a one-shot INFO line lis...: none material — the checks I planned all completed; pre-existing-failure attribution was confirmed against the base commit rather than left assumed.; PR #8855 (QwenLM/qwen-code) adds a one-shot INFO line lis...: did not trace whether a daemon-served TUI session can reach performMemoryRefresh with process cwd ≠ session working dir today (finding 2 is reported at low co…; PR #8855 (QwenLM/qwen-code) adds a one-shot INFO line lis...: none — no check was left unfinished.; PR #8855 (QwenLM/qwen-code) adds a one-shot INFO line lis...: none — all checks I planned completed (~10 tool calls used of ~55).; PR #8855 (QwenLM/qwen-code) adds a one-shot INFO line lis...: none — all checks I started completed within budget..
中文说明
未审查:build-and-test — Test (windows-latest, Node 22.x) was skipped in CI and its suite did not run locally。
未审查:build-and-test — Integration Tests (CLI, No Sandbox) was skipped in CI and its suite did not run locally。
未探索到全部深度(达到工具调用预算):PR #8855 (QwenLM/qwen-code) adds a one-shot INFO line lis...:none material — the checks I planned all completed; pre-existing-failure attribution was confirmed against the base commit rather than left assumed.;PR #8855 (QwenLM/qwen-code) adds a one-shot INFO line lis...:did not trace whether a daemon-served TUI session can reach performMemoryRefresh with process cwd ≠ session working dir today (finding 2 is reported at low co…;PR #8855 (QwenLM/qwen-code) adds a one-shot INFO line lis...:none — no check was left unfinished.;PR #8855 (QwenLM/qwen-code) adds a one-shot INFO line lis...:none — all checks I planned completed (~10 tool calls used of ~55).;PR #8855 (QwenLM/qwen-code) adds a one-shot INFO line lis...:none — all checks I started completed within budget.。
— qwen3.8-max via Qwen Code /review (v0.21.9)
- Consume the one-shot latch on model-invocable slash commands: skills and MCP prompts are expanded into a submit_prompt that reaches the model, so excluding all slash commands deferred the announcement to a later plain prompt (or hid it entirely in skill-only sessions). - Build contextFilePaths from every attached file, not just memory-named ones, so the announcement matches what concatenateInstructions injects (extension context files with custom basenames were attached but unannounced while /context detail listed them). - Correct the contextFilePaths JSDoc: entries are display paths (CWD-relative or ~/... shortcuts), not paths to resolve against the CWD. - Tests: model-invocable skill first turn consumes the latch; shell-mode submissions do not; extension files with custom basenames are announced.
Third-round review feedback addressed (31c3e98)Triage of the 5 findings — 4 accepted, 1 declined with rationale below. Accepted & fixed
Declined
Verification: touched-file suites green (core 中文说明对第三轮 5 条 findings 逐条核实:采纳 4 条,不采纳 1 条。 已修复:模型可调用斜杠命令(skill、MCP prompt)经 不采纳:三处"应用 memory 结果"提取共享 helper——重复属实但模式先于本 PR 存在(本 PR 仅跟随既有惯例每处加一行),helper 无法完全去重(三处各有私有追加动作),且重构 验证:相关文件测试全绿(core memoryDiscovery 47、cli AppContainer 149 + contextCommand 14 + directoryCommand 28),prettier/eslint 干净,全仓 typecheck 通过。 |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Not reviewed: build-and-test — Test (windows-latest, Node 22.x) was skipped in CI (merge_group-only) and its suite did not run locally; the diff changes cross-platform path-display code whose win32 arm is untested everywhere (see R4-7).
Not reviewed: build-and-test — Integration Tests (CLI, No Sandbox) was skipped in CI and its suite did not run locally; the diff changes CLI UI behavior (AppContainer announcement latch, /context, /directory).
Not explored to full depth (tool budget reached): PR #8855 (QwenLM/qwen-code, round 4 review at head 31c3e9...: exact mechanism of Finding 1's order dependency (which earlier-test state makes the full-file run pass) — not pinned down.; PR #8855 (QwenLM/qwen-code, round 4 review at head 31c3e9...: full packages/cli suite + npm run typecheck not run (targeted test files only).; PR #8855 (QwenLM/qwen-code, round 4 review at head 31c3e9...: root-causing *why* the full-file run makes the shell-mode test pass (bisected two candidate enablers, both negative; the enabling side effect elsewhere in the 6…; You are review agent reverse-audit — Reverse audit agen...: none — all checks above completed within budget.; PR #8855 (QwenLM/qwen-code, round 4 review at head 31c3e9...: none — all checks I started completed within budget., and 2 more.
中文说明
未审查:build-and-test — Test (windows-latest, Node 22.x) was skipped in CI (merge_group-only) and its suite did not run locally; the diff changes cross-platform path-display code whose win32 arm is untested everywhere (see R4-7)。
未审查:build-and-test — Integration Tests (CLI, No Sandbox) was skipped in CI and its suite did not run locally; the diff changes CLI UI behavior (AppContainer announcement latch, /context, /directory)。
未探索到全部深度(达到工具调用预算):PR #8855 (QwenLM/qwen-code, round 4 review at head 31c3e9...:exact mechanism of Finding 1's order dependency (which earlier-test state makes the full-file run pass) — not pinned down.;PR #8855 (QwenLM/qwen-code, round 4 review at head 31c3e9...:full packages/cli suite + npm run typecheck not run (targeted test files only).;PR #8855 (QwenLM/qwen-code, round 4 review at head 31c3e9...:root-causing *why* the full-file run makes the shell-mode test pass (bisected two candidate enablers, both negative; the enabling side effect elsewhere in the 6…;You are review agent reverse-audit — Reverse audit agen...:none — all checks above completed within budget.;PR #8855 (QwenLM/qwen-code, round 4 review at head 31c3e9...:none — all checks I started completed within budget.,另有 2 条。
— qwen3.8-max via Qwen Code /review (v0.21.9)
|
🔓 Takeover auto-released: the autofix loop paused on this PR 4 day(s) ago (🤖 AutoFix stopped: this counting window now contains 3 time-budget exhaustions (pushed rounds in between included; this ) and no re-arm followed, so the 中文说明🔓 已自动释放接管:autofix 循环在 4 天前暂停于此 PR(🤖 AutoFix stopped: this counting window now contains 3 time-budget exhaustions (pushed rounds in between included; this ),此后无人重新武装,现移除 |
…e markers useResumeCommand now accepts an optional loadHistory override; AppContainer passes the latch-reconciling wrapper so interactive /resume (including same-id) reconciles the latch instead of leaving it consumed with no announcement in the rebuilt history. The wrapper also destructures loadHistory so its useCallback deps hold the stable function reference rather than the per-mutation historyManager identity, keeping history out of commandContext's rebuild path. concatenateInstructions sanitizes the marker displayPath with stripAnsiAndControl: newline/control characters in directory names could previously forge or hide entries in the /context parser, contradicting the sanitized announcement surface. Documented that contextFilePaths lists top-level files only (@import content is inlined into its importer). Added tests for the sessionId re-arm effect, the startup-resume armed latch, and the resume override.
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Partially reviewed — gaps disclosed.
Not reviewed: build-and-test — Integration Tests (CLI, No Sandbox) was skipped in CI and its suite did not run locally; the diff changes CLI UI behavior (announcement latch, /context, /directory).
Not reviewed: build-and-test — Test (windows-latest, Node 22.x) was skipped in CI and its suite did not run locally; the diff changes cross-platform path-display code whose win32 arm no local run exercised.
Not reviewed: reverse audit — did not converge within the reverse-audit round cap of 5.
Deferred under the convergence posture (round 15, not a blocker) — recorded, not requested in this round:
packages/cli/src/ui/AppContainer.tsx:987 — [probe] Startup --resume latch test is vacuous for the wrapper-vs-raw revertpackages/cli/src/ui/AppContainer.tsx:1634 — [probe] AppContainer's loadHistory prop into useResumeCommand is pinned by no testpackages/cli/src/ui/AppContainer.tsx:1918 — [probe] /restore's routing through the latch-reconciling wrapper is pinned by no testpackages/cli/src/ui/AppContainer.tsx:2061 — [probe] Safe-mode setContextFilePaths([]) clear is untested at both write sitespackages/core/src/utils/memoryDiscovery.ts:363 — [probe] U+2028/U+2029 in paths survive sanitization and hide entries from /contextpackages/core/src/utils/memoryDiscovery.ts:367 — [probe] Marker-path sanitization in concatenateInstructions has no test
中文说明
仅完成部分审查,审查缺口已披露。
未审查:build-and-test — Integration Tests (CLI, No Sandbox) was skipped in CI and its suite did not run locally; the diff changes CLI UI behavior (announcement latch, /context, /directory)。
未审查:build-and-test — Test (windows-latest, Node 22.x) was skipped in CI and its suite did not run locally; the diff changes cross-platform path-display code whose win32 arm no local run exercised。
未审查:反向审计——在 5 轮的反审轮数上限内未收敛。
收敛姿态下延后(第 15 轮,非阻断)——已记录,本轮不要求修改:共 6 条(原文未翻译,列表见上方英文部分)。
— qwen3.8-max via Qwen Code /review (v0.21.13)
contextCommand.test.ts: both sides added tests at the same spot — kept ours (two marker-path rendering tests) and upstream's (disabled-skills breakdown test).
ca56505 to
c88a5dd
Compare
|
Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. 中文请勿对活跃的 PR 执行 rebase 或 force-push,因为这会使已有的评审评论失效。另外,供日后参考:作为集成流程的一部分,机器人始终会自动将所有改动压缩(squash)为单个提交。 |
🩺 serve daemon A/BBuilt the PR base vs this PR head ✅ No response changes against the PR base across 4 scenario(s). — Qwen Code · serve A/B |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Partially reviewed — gaps disclosed.
Not reviewed: build-and-test — Integration Tests (CLI, No Sandbox) was skipped in CI and its suite did not run locally.
Not reviewed: build-and-test — Test (windows-latest, Node 22.x) was skipped in CI and its win32 path arm did not run locally.
Deferred under the convergence posture (round 16, not a blocker) — recorded, not requested in this round:
packages/cli/src/ui/AppContainer.tsx:1918 — [probe] /restore routing through the latch-reconciling wrapper is pinned by no testpackages/core/src/utils/memoryDiscovery.ts:367 — [probe] Marker-path sanitization in concatenateInstructions has no test
中文说明
仅完成部分审查,审查缺口已披露。
未审查:build-and-test — Integration Tests (CLI, No Sandbox) was skipped in CI and its suite did not run locally。
未审查:build-and-test — Test (windows-latest, Node 22.x) was skipped in CI and its win32 path arm did not run locally。
收敛姿态下延后(第 16 轮,非阻断)——已记录,本轮不要求修改:共 2 条(原文未翻译,列表见上方英文部分)。
— qwen3.8-max via Qwen Code /review (v0.21.13)
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Partially reviewed — gaps disclosed.
Not reviewed: build-and-test — Test (windows-latest, Node 22.x) was skipped in CI and its suite did not run locally; the diff changes cross-platform path-display code (formatContextFileDisplayPath, tildeifyPath) whose win32 arm no local run exercised.
Not reviewed: build-and-test — Integration Tests (CLI, No Sandbox) was skipped in CI and its suite did not run locally; the diff changes CLI UI behavior (announcement latch, /context, /directory).
Not explored to full depth (tool budget reached): chunk 7: could not execute memoryDiscovery.test.ts under vitest (no installed node_modules in the review worktree); all assertions were instead traced against the impl….
Deferred under the convergence posture (round 17, not a blocker) — recorded, not requested in this round:
packages/core/src/utils/memoryDiscovery.ts:367 — [probe] Marker-path strip in concatenateInstructions has no testpackages/cli/src/ui/AppContainer.tsx:2408 — [review] Remote input (--input-file) bypasses the announcement latchpackages/cli/src/ui/utils/commandUtils.ts:173 — [probe] /goal turn-start bypasses the announcement latchpackages/core/src/utils/memoryDiscovery.ts:367 — [probe] U+2028/U+2029 survive sanitization and hide entries from /context
中文说明
仅完成部分审查,审查缺口已披露。
未审查:build-and-test — Test (windows-latest, Node 22.x) was skipped in CI and its suite did not run locally; the diff changes cross-platform path-display code (formatContextFileDisplayPath, tildeifyPath) whose win32 arm no local run exercised。
未审查:build-and-test — Integration Tests (CLI, No Sandbox) was skipped in CI and its suite did not run locally; the diff changes CLI UI behavior (announcement latch, /context, /directory)。
未探索到全部深度(达到工具调用预算):chunk 7:could not execute memoryDiscovery.test.ts under vitest (no installed node_modules in the review worktree); all assertions were instead traced against the impl…。
收敛姿态下延后(第 17 轮,非阻断)——已记录,本轮不要求修改:共 4 条(原文未翻译,列表见上方英文部分)。
— qwen3.8-max via Qwen Code /review (v0.21.13)
|
Qwen Code review did not complete successfully. The review pipeline failed before a review could be posted. A transient error is retried automatically; if you are seeing this, retry with |
|
@qwen-code /review The round-18 review run was cancelled by a runner timeout before posting (see workflow logs); all functional CI suites passed. Requesting a retry per the fallback comment instructions. |
|
Qwen Code review request accepted. Review is queued in workflow run. |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Partially reviewed — gaps disclosed.
Not reviewed: build-and-test — Test (windows-latest, Node 22.x) was skipped in CI and its suite did not run locally; the diff changes cross-platform path-display code (formatContextFileDisplayPath, tildeifyPath) whose win32 arm no local run exercised.
Not reviewed: build-and-test — Integration Tests (CLI, No Sandbox) was skipped in CI and its suite did not run locally; the diff changes CLI UI behavior (announcement latch, /context, /directory).
Not explored to full depth (tool budget reached): "agent reverse-audit (round 2)": did not confirm whether any qwen --resume or worktree-startup path adopts a persisted working dir without a matching process.chdir (the reachability questio…; chunk 4: none. (Test execution was unavailable — no node_modules in the review worktree — but that is an environment limitation, not an unfinished check; static verifi….
中文说明
仅完成部分审查,审查缺口已披露。
未审查:build-and-test — Test (windows-latest, Node 22.x) was skipped in CI and its suite did not run locally; the diff changes cross-platform path-display code (formatContextFileDisplayPath, tildeifyPath) whose win32 arm no local run exercised。
未审查:build-and-test — Integration Tests (CLI, No Sandbox) was skipped in CI and its suite did not run locally; the diff changes CLI UI behavior (announcement latch, /context, /directory)。
未探索到全部深度(达到工具调用预算):"agent reverse-audit (round 2)":did not confirm whether any qwen --resume or worktree-startup path adopts a persisted working dir without a matching process.chdir (the reachability questio…;chunk 4:none. (Test execution was unavailable — no node_modules in the review worktree — but that is an environment limitation, not an unfinished check; static verifi…。
— qwen3.8-max via Qwen Code /review (v0.21.13)
yiliang114
left a comment
There was a problem hiding this comment.
Reviewed — 0 unresolved threads. Note: several resolved Criticals were silently resolved (no author reply comment); the code reads as fixed and the bot re-scan did not re-flag, but please confirm those fixes are in the head. Approve.
E2E Verification ReportDate: 2026-08-19 Result: ✅ PASS (all 4 reviewer test plan scenarios verified)Scenario 1: First prompt shows "Read context files" announcement ✅One INFO line appears above the first prompt listing all loaded context files. Project files show as CWD-relative paths, global files use Scenario 2: Second prompt does NOT repeat the announcement ✅No duplicate "Read context files:" line on subsequent prompts. The original announcement remains in scrollback but no new one is emitted. Model still follows context file instructions. (No second Scenario 3: Typo in filename — mistyped file absent from list ✅Changed settings to Note: Scenario 4:
|
Stale bot review: all threads resolved, superseded by maintainer approval (yiliang114, 2026-08-19).
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
UI-verified on real CLI build (announcement one-shot, /context detail ~/ paths) and logic-reviewed: displayed=attached holds by construction; disclosed gaps (/cd, /directory add re-arm) tracked as follow-ups. Second approval to satisfy the 2-review requirement.
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
UI-verified on real CLI build (announcement one-shot, /context detail ~/ paths) and logic-reviewed: displayed=attached holds by construction; disclosed gaps (/cd, /directory add re-arm) tracked as follow-ups. Second approval to satisfy the 2-review requirement.
Independent UI verification (real CLI builds, interactive tmux session)Setup: scratch workspace with Before — no indication anywhere, yet the reply ends with After — one-shot INFO line above the first prompt listing exactly what was attached; verified it does not repeat on the second prompt: Also verified live: |
|
Released in v0.21.15. |


What this PR does
When users attach custom context files via
context.fileNamein settings, the file contents are merged into the system prompt — a channel that is invisible in the conversation UI and never persisted to chat history. This PR makes the attachment visible: on the user's first real prompt of a session, a one-shot INFO line is shown right above that prompt listing exactly which context files were attached (e.g.Read context files: ~/.qwen/QWEN.md, QWEN.md, MY_RULES.md). The list is computed from the same discovery result that builds the system prompt, so what is displayed is exactly what was attached. The announcement only appears once per session, and only when at least one context file was actually loaded. Display paths are kept readable: files inside the project show as CWD-relative paths, while files under the user home (global memory, extensions) are shown with a~/...shortcut instead of long../../..chains. The same~/...shortcut is now applied to the per-file memory breakdown in/context detail, which previously rendered global files as truncated../../../Users/...paths.Why it's needed
Reported in #5267: a user configured
context.fileNamewith a mistyped file name and had no way to tell whether the file was actually read. The only workarounds were digging into debug logs or running/contextand comparing token counts. The reporter explicitly asked for a "read file" indication shown alongside the first prompt, mirroring how agent file reads appear in the console — so users can immediately distinguish "the file was never loaded" from "the model didn't follow the instructions". This PR delivers exactly that.Reviewer Test Plan
How to verify
QWEN.mdand a second file (e.g.MY_RULES.md), then add.qwen/settings.jsonwith"context": { "fileName": ["QWEN.md", "MY_RULES.md"] }.Read context files: ...appears directly above your prompt, listing exactly the configured files (plus any global/extension memory files).MY_RULESX.md), restart, send a prompt. Expected: the mistyped file is absent from the list./context detail. Expected: the Memory files section shows the same files, with global files rendered as~/...instead of../../../Users/....[X]") and confirm the model follows it — the displayed list corresponds to content actually in the system prompt.Evidence (Before & After)
Before (no indication anywhere; user must run
/contextand infer):After (first prompt, one-shot INFO line with readable paths):
After (typo scenario — mistyped
MY_RULESX.mdabsent from list):Before/After for
/context detailmemory breakdown:Tested on
Environment (optional)
Built bundle (
npm run build && npm run bundle), run interactively in tmux from a scratch directory.Risk & Scope
contextFilePathsfield added to the memory-discovery response is additive.Linked Issues
Fixes #5267
中文说明
本 PR 做了什么:用户通过 settings 中的
context.fileName附加自定义 context 文件时,文件内容会合并进 system prompt——这条通道在会话界面不可见,也不会写入聊天历史。本 PR 让附加行为可见:在会话的第一条真实 prompt 上方,一次性显示一行 INFO 提示,列出实际附加了哪些 context 文件(如Read context files: ~/.qwen/QWEN.md, QWEN.md, MY_RULES.md)。列表与构建 system prompt 用的是同一份发现结果,显示的即实际附加的。提示每个会话只出现一次,且仅在至少加载了一个文件时才出现。路径展示保持可读:项目内文件显示为 CWD 相对路径,用户主目录下的文件(全局 memory、扩展)用~/...缩写代替冗长的../../..链。/context detail的逐文件 memory 明细也应用了同样的~/...缩写,此前全局文件显示为被截断的../../../Users/...路径。为什么需要:#5267 报告者在
context.fileName里拼错了一个文件名,却没有任何办法确认文件是否真的被读取,唯一的手段是翻 debug 日志或运行/context比对 token 数。报告者明确要求在第一条 prompt 时显示类似"读取文件"的提示,就像 agent 读源文件时在控制台显示的那样——这样用户可以立即区分"文件根本没加载"和"模型没遵守指令"。本 PR 正是实现了这一点。验证方式:在临时目录创建
QWEN.md和MY_RULES.md并配置context.fileName;启动 CLI 确认启动区无新消息;发送第一条 prompt,预期上方出现Read context files: ...一行;发送第二条 prompt,预期不重复;把配置改成拼错的文件名后重启,预期该文件从列表消失;运行/context detail,预期 Memory files 明细中全局文件显示为~/...;可选内容级验证:在 context 文件中写一条独特规则(如"每条回复以[X]结尾"),确认模型遵守——证明列表与 system prompt 内容一致。风险与范围:每个会话在加载了 context 文件时多显示一行 INFO;无 context 文件时不显示任何内容;safe mode 下为空列表。SDK/非交互路径与 webui 不在范围内(提示纯属 CLI UI 层)。memory 发现响应新增的
contextFilePaths字段是纯增量的,无破坏性变更。