From eefd4fd654b299dc1fe451f4e4e5baeef50ee02a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=93=E8=89=AF?= <1204183885@qq.com> Date: Wed, 4 Nov 2026 16:43:54 +0800 Subject: [PATCH] test(e2e): accept both plan-mode wordings in the ACP case (#16273) `acp integration > blocks write tools in plan mode` filtered tool updates with `includes('Plan mode')` and asserted `'Plan mode is active'`. The unified agent loop blocks through the core scheduler, which says `Tool blocked by plan mode: ...` (lowercase), so the case-sensitive filter found no event and the nightly unified leg failed while every push leg stayed green (run 41771749222). Match `/plan mode/i` and keep the file assertion that proves nothing ran. Verified locally: the case fails on origin/main with `QWEN_CODE_ENABLE_UNIFIED_AGENT_LOOP=1` and the same message CI reports, and passes both with and without that flag after the change. --- integration-tests/cli/acp-integration.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/integration-tests/cli/acp-integration.test.ts b/integration-tests/cli/acp-integration.test.ts index e87b9d5e662..70ef491de69 100644 --- a/integration-tests/cli/acp-integration.test.ts +++ b/integration-tests/cli/acp-integration.test.ts @@ -1099,13 +1099,17 @@ function setupAcpTest( ); const blockedEvent = writeFileEvents.find( - (e) => e.status === 'failed' && e.error?.includes('Plan mode'), + (e) => e.status === 'failed' && /plan mode/i.test(e.error ?? ''), ); expect( blockedEvent, `expected a failed write_file tool_call_update blocked by plan mode; events=${JSON.stringify(toolCallEvents)}`, ).toBeDefined(); - expect(blockedEvent?.error).toContain('Plan mode is active'); + // The ACP session gate says "Plan mode is active"; the core scheduler + // that the unified agent loop goes through says "Tool blocked by plan + // mode". Either wording proves the guard fired; the file assertion + // below proves nothing ran. + expect(blockedEvent?.error).toMatch(/plan mode/i); // Verify the file was NOT created const fs = await import('fs');