test(integration): pin simple-mcp-server to legacy MCP discovery path (#4164)

The progressive-MCP rollout (#3994) regressed non-interactive MCP tool
visibility on the first `--prompt` request — the model never sees the
configured MCP tool and answers from its own knowledge, so the test's
`waitForToolCall('mcp__addition-server__add')` assertion times out on
all three retries. Reproduced locally: 167s 3/3-fail without the
rollback flag, 22s pass with it.

Set `QWEN_CODE_LEGACY_MCP_BLOCKING=1` in the test's `beforeAll` so the
spawned CLI uses the pre-#3994 synchronous discovery path. Scoped to
this single test rather than the workflow env so other integration
tests keep exercising the new progressive-MCP code path.

Temporary workaround. Remove once #4163 is fixed.
This commit is contained in:
tanzhenxin 2026-05-15 11:35:17 +08:00 committed by GitHub
parent cc800d0132
commit fa6f664a6f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -168,6 +168,13 @@ describe('simple-mcp-server', () => {
const rig = new TestRig();
beforeAll(async () => {
// Force the pre-#3994 synchronous MCP discovery path: under progressive
// MCP availability the spawned CLI's first non-interactive `--prompt`
// request fires without the MCP `add` tool wired into the model's tool
// surface, so the model answers `15` directly and `foundToolCall` stays
// false. Remove once QwenLM/qwen-code#4163 is fixed.
process.env['QWEN_CODE_LEGACY_MCP_BLOCKING'] = '1';
// Setup test directory with MCP server configuration
await rig.setup('simple-mcp-server', {
settings: {