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.
This commit is contained in:
易良 authored and GitHub committed 2026-11-04 16:43:54 +08:00
1 parent ad47896d85
commit eefd4fd654
1 file changed
+6 -2
@@ -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');