Repository navigation
feat(cli): adopt Goal v3 in non-interactive mode #8324
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 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
3f160c4
feat(cli): adopt Goal v3 in non-interactive mode
qwen-code-dev-bot 18a7c6a
test(cli): cover ACP goal control rejection
qwen-code-dev-bot 3b8ec3b
test(cli): cover queued Goal user turns
qwen-code-dev-bot 7abb7f8
fix(cli): fail closed before session turn exit
qwen-code-dev-bot 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
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.
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.
[Critical] Prevent the second source from replaying stale canonical Goal states.
runNonInteractivesubscribes directly to the runtime throughobserveGoalRuntime, while Core'ssendMessageStreamalso subscribes and later drains the same queuedGoalStatesequence. This comparison removes only consecutive duplicates. On a no-tool active Goal segment,finishTurnbroadcastsidleand synchronously schedules the next permit/broadcastsrunning; the direct listener emits both, then Core drains its queued copy. A probe against this exact head producedidle → running → idle → running, so a consumer treatinggoal_stateas authoritative regresses fromrunningto staleidleand processes both transitions twice. Please make one source authoritative (while preserving explicit status/no-model emission), or dedupe using source/transition sequencing rather than only the last payload, and add a regression where source A emits[idle, running]before source B replays[idle, running].中文说明
[严重] 防止第二个事件源重放陈旧的 canonical Goal 状态。
runNonInteractive通过observeGoalRuntime直接订阅 runtime,而 Core 的sendMessageStream也会订阅并在稍后排空同一组GoalState。这里仅能去掉相邻重复。在没有工具调用的 active Goal segment 结束时,finishTurn会先广播idle,随后同步调度下一个 permit 并广播running;直订阅先输出两者,然后 Core 再排空其缓存副本。在当前精确 head 上的最小复现实际得到idle → running → idle → running,因此把goal_state当作权威状态的消费者会从running倒退到陈旧idle,并重复处理两次状态转换。请让一个来源成为权威来源(同时保留显式 status/no-model 输出),或按来源/转换序列去重,而不是只比较最后一个 payload;并补一个回归测试:来源 A 先输出[idle, running],来源 B 随后重放[idle, running]。