-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Add stop hook blocking cap #4208
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 all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b469493
feat(core): add stop hook blocking cap
qqqys 3aec631
fix(core): tighten stop hook cap behavior
qqqys a7ea514
fix(cli): show goal judge details
qqqys cc6fae9
fix(core): bound stop hook blocking cap
qqqys 05fa9fa
fix(core): surface subagent stop cap warnings
qqqys e34364c
fix(core): clean up stop hook cap loop
qqqys 5628b4e
Merge upstream main into stop-hook-blocking-cap
qqqys a449a9e
test(core): cover stop hook cap integrations
qqqys 3d8a746
test(core): strengthen stop hook cap coverage
qqqys 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
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
28 changes: 28 additions & 0 deletions
28
packages/cli/src/ui/components/messages/GoalStatusMessage.test.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| /** | ||
| * @license | ||
| * Copyright 2026 Qwen Team | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| import { render } from 'ink-testing-library'; | ||
| import { describe, expect, it } from 'vitest'; | ||
| import { GoalStatusMessage } from './GoalStatusMessage.js'; | ||
|
|
||
| describe('<GoalStatusMessage />', () => { | ||
| it('shows the goal and judge reason on checking cards', () => { | ||
| const { lastFrame } = render( | ||
| <GoalStatusMessage | ||
| kind="checking" | ||
| condition="finish the refactor" | ||
| iterations={2} | ||
| lastReason="tests are still failing" | ||
| />, | ||
| ); | ||
|
|
||
| const output = lastFrame(); | ||
| expect(output).toContain('Goal check'); | ||
| expect(output).toContain('turn 2'); | ||
| expect(output).toContain('Goal: finish the refactor'); | ||
| expect(output).toContain('Judge: tests are still failing'); | ||
| }); | ||
| }); |
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]
#handleStopHookLoop的 cap-enforcement 路径未测试。config mock 已添加getStopHookBlockingCap: vi.fn().mockReturnValue(8),但没有测试将 cap 设为低值(如 1 或 2)来触发stopHookIterationCount >= stopHookBlockingCap分支。当前的两个 Stop hook 测试在 cap=8 下分别仅运行 1-2 次迭代,远未达到上限。Session.ts 的 cap 逻辑独立处理 ACP 会话(VSCode companion)的 stop hook 循环。此路径的 bug 仅会在 ACP 会话中暴露,现有测试无法捕获。
— DeepSeek/deepseek-v4-pro via Qwen Code /review