Repository navigation
Conversation
|
@qwen-code /review |
|
@qwen-code /review |
|
Rechecked the existing review feedback against The remaining R4-1 and R5-1 threads are non-blocking Suggestions. The unused return getter no longer has a divergent formula, and the hook test helper now passes the shared ref. The missing After five review rounds, I would defer those Suggestions rather than add another implementation cycle. The executed CI gates are green. A fresh reviewer can reconcile the historical changes-requested verdict with this head; I am not submitting a full approval here because this was a bounded recheck, and I did not run the live TUI smoke that the PR explicitly leaves unverified. |

What this PR does
Keep the app-wide stream state
Respondingwhile a local slash command is prepared. A separate command-facing idle ref lets idle-only commands run only when dispatch began from an idle session and no model stream is active. If asynchronous message logging is cancelled, the aborted submission returns before invoking the slash handler; the command-facing flag resets after success and exceptions.Why it's needed
Fixes #12224.
submitQuerymarks a user submission as responding beforeprepareQueryForLlminvokes a UI-only slash handler, so/cdsees an active response and refuses to change directory. Making the app-wide state idle would also let cancellation, telemetry, and other activity-aware consumers treat preparation as finished. A dedicated command-facing ref preserves those app-wide behaviors while allowing the command-specific guard to admit the command.Reviewer Test Plan
How to verify
/cd <directory>, and confirm the command changes the session directory.logger.logMessageduring/cd, press Esc, and confirm the slash handler and model stream are not invoked.ToolResultcontinuation, and confirm the command-facing idle signal becomes false as soon as the model stream starts, without forcing a rerender./btw, then finish the main stream while the side dispatch remains held; confirm the command-facing idle signal stays false.conversation_finishedevent is emitted after settlement.Evidence (Before & After)
Before: the Windows reproduction attached to #12224 shows
/cdrefused with “Cannot change directory while a response or tool call is in progress.” After:use-llm-stream.test.tsxandAppContainer.test.tsxcover synchronous stream-state reads, per-dispatch cleanup, cancellation, detached continuations,/btw, ordinary idle behavior, app-wide ref isolation, throw cleanup, and YOLO telemetry.Tested on
Environment (optional)
Windows 11, Node.js v24.15.0, Qwen Code worktree. The global
qwenexecutable is not installed, so no live CLI smoke was run; the delayed-logger hook tests provide the deterministic reproduction. GitHub CI and review status are tracked against the latest PR head.Risk & Scope
Responding.Linked Issues
Fixes #12224
中文说明
本 PR 在本地 slash command 准备期间让应用级流状态保持
Responding。独立的命令级 idle ref 只在派发从空闲会话开始、且没有模型流运行时允许只在空闲状态执行的命令。如果异步消息日志记录被取消,提交流程会在调用 slash handler 前响应 abort signal;命令级标志在成功和异常路径都会复位。本 PR 修复 #12224。
submitQuery会在prepareQueryForLlm调用 UI-only slash handler 之前把用户提交标记为 responding,因此/cd会看到有活动响应并拒绝切换目录。把应用级状态改成 idle 也会让取消、遥测以及其他依赖活动状态的消费者误以为准备阶段已经结束。专用的命令级 ref 保留这些应用级行为,同时允许命令专属 guard 正确准入。验证步骤
/cd <directory>,确认会话目录已切换。/cd的logger.logMessage期间按 Esc,确认 slash handler 与模型流都没有启动。ToolResultcontinuation;无需强制重新渲染,模型流启动后命令级 idle signal 就应变为 false。/btw,在 side dispatch 仍挂起时结束主流;命令级 idle signal 应保持 false。conversation_finishedevent。前后证据
之前:#12224 附带的 Windows 复现视频显示
/cd报错 “Cannot change directory while a response or tool call is in progress.” 之后:use-llm-stream.test.tsx与AppContainer.test.tsx覆盖同步流状态读取、按派发归属复位、取消、detached continuation、/btw、普通 idle、应用级 ref 隔离、异常复位与 YOLO 遥测。本地测试平台
环境(可选)
Windows 11、Node.js v24.15.0、Qwen Code worktree。当前环境没有全局
qwen命令,因此未运行实时 CLI smoke;延迟 logger 的 hook 测试提供了确定性复现。GitHub CI 与 review 状态以最新 PR head 为准。风险与范围
Responding。