fix(test): keep plan mode active during ACP integration test#1956
Merged
tanzhenxin merged 1 commit intomainfrom Feb 26, 2026
Merged
fix(test): keep plan mode active during ACP integration test#1956tanzhenxin merged 1 commit intomainfrom
tanzhenxin merged 1 commit intomainfrom
Conversation
The test 'blocks write tools in plan mode' was failing because the model would attempt to exit plan mode via exit_plan_mode tool. By cancelling switch_mode tool calls in the permission handler, we ensure plan mode stays active throughout the test. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
tanzhenxin
approved these changes
Feb 26, 2026
Contributor
📋 Review SummaryThis PR fixes a flaky integration test by ensuring plan mode remains active during the test execution. The change modifies the permission handler to cancel 🔍 General Feedback
🎯 Specific Feedback
✅ Highlights
|
Contributor
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
This was referenced Feb 26, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
TLDR
Fixes the "blocks write tools in plan mode" integration test by cancelling
switch_modetool calls in the permission handler to ensure plan mode stays active throughout the test.Dive Deeper
The integration test
it('blocks write tools in plan mode (issue #1806)')was flaky/failing because when the model is asked to create a file in plan mode, it may attempt to exit plan mode first via theexit_plan_modetool (which triggers aswitch_modetool call). This would cause the test to not properly verify that write tools are blocked in plan mode.The fix adds a condition in the permission handler to cancel any
switch_modetool calls, ensuring the model remains in plan mode and the test can properly verify that write operations are blocked.Reviewer Test Plan
cd integration-tests && npx vitest run acp-integration.test.ts -t "blocks write tools in plan mode"Testing Matrix
Linked issues / bugs
Related to #1806
🤖 Generated with Qwen Code