From 179ce68e639c29029e53a5aabbd4913b9c154fca Mon Sep 17 00:00:00 2001 From: tanzhenxin Date: Thu, 26 Feb 2026 23:10:28 +0800 Subject: [PATCH] fix(test): keep plan mode active during ACP integration test 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 --- integration-tests/acp-integration.test.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/integration-tests/acp-integration.test.ts b/integration-tests/acp-integration.test.ts index 93389d605c..07e53e9609 100644 --- a/integration-tests/acp-integration.test.ts +++ b/integration-tests/acp-integration.test.ts @@ -659,7 +659,13 @@ function setupAcpTest( }> = []; const { sendRequest, cleanup, stderr, sessionUpdates } = setupAcpTest(rig, { - permissionHandler: () => ({ optionId: 'proceed_once' }), + permissionHandler: (request) => { + // Cancel exit_plan_mode to keep plan mode active + if (request.toolCall?.kind === 'switch_mode') { + return { outcome: 'cancelled' }; + } + return { optionId: 'proceed_once' }; + }, }); try {