Repository navigation
fix(cli): hide stale sticky todos from previous turns #7900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the careful read — declining this one, because the suggested guard would regress the exact case this PR fixes.
Verified at the reviewed commit: local slash commands keep
sentToModel: false(slashCommandProcessor.ts:857-860initializes it false and only flips it totruewhen the command yields asubmit_prompt; UI-only commands like/stats,/about,/exitnever do), while regular user messages leave itundefined(types.ts:124-131). Steers are alsofalse(useGeminiStream.ts:2576-2582). SosentToModel !== falsecannot separate a mid-turn steer from a local slash command — and applying it would stop/stats(the command in the #7061 screenshot) from hiding the stale panel, re-breaking #7061. This lines up with @wenshao's independent E2E on090ad18, which confirmed/statstriggers the boundary today.The
sentToModel !== falsepattern elsewhere answers "did this reach the model?" (rewind/telemetry/turn rendering);hasUserMessageAfteranswers "did the user start any new interaction?", which intentionally includes local slash commands — so the omission is deliberate. The steer case is real but minor and self-healing (nexttodo_writere-snapshots), already accepted by the author and @wenshao; a precise fix needs streaming state in this pure function, out of scope here.To make sure the naive guard can't be applied silently, I added a regression test (
hides sticky todos when a local slash command starts after the snapshot) using a faithfulsentToModel: falsefixture — it passes now and fails if the guard is added.中文说明
感谢细致的审查 —— 这一条予以拒绝,因为建议的判断条件会让本 PR 修复的场景重新回归。
已在被审查的 commit 上核实:本地斜杠命令保持
sentToModel: false(slashCommandProcessor.ts:857-860初始化为 false,仅当命令产生submit_prompt时才改为true;/stats、/about、/exit等纯 UI 命令从不触发),而普通用户消息保持undefined(types.ts:124-131)。Steer 同样是false(useGeminiStream.ts:2576-2582)。因此sentToModel !== false无法区分轮内 steer 与本地斜杠命令 —— 应用它会导致/stats(#7061 截图中的命令)不再隐藏过期面板,重新破坏 #7061。这与 @wenshao 在090ad18上的独立 E2E 验证一致:他确认当前/stats能触发边界。其他地方的
sentToModel !== false模式回答的是"这条是否发给了模型?"(rewind/telemetry/turn 渲染);而hasUserMessageAfter回答的是"用户是否开启了任何新交互?",这有意包含本地斜杠命令 —— 所以这里的省略是刻意的。Steer 场景确实存在但影响很小且可自愈(下一次todo_write重建快照),作者与 @wenshao 均已接受;精确修复需要在这个纯函数中引入 streaming 状态,超出本次范围。为防止该朴素判断被悄悄应用,我新增了一个回归测试(
hides sticky todos when a local slash command starts after the snapshot),使用忠实的sentToModel: falsefixture —— 当前通过,加上该判断后会失败。