Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion integration-tests/cli/qwen-serve-client-mcp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ const REPO_ROOT = path.resolve(__dirname, '../..');
// platform-agnostic, but daemon SIGTERM teardown is cleaner on POSIX. Keep it
// running everywhere `ws` works.
const SKIP = process.platform === 'win32';
const SANDBOX_MODE = process.env['QWEN_SANDBOX']?.toLowerCase().trim();
const SKIP_PROMPTED_MODEL_TEST = Boolean(
SANDBOX_MODE && SANDBOX_MODE !== 'false' && SANDBOX_MODE !== '0',
);
const describeMaybe = SKIP ? describe.skip : describe;
const itPromptedModelMaybe = SKIP_PROMPTED_MODEL_TEST ? it.skip : it;

let daemon: ChildProcess;
let port = 0;
Expand Down Expand Up @@ -417,7 +422,9 @@ describeMaybe('qwen serve — reverse tool channel (client-hosted MCP over WS)',
//
// This test does session/new THEN mcp_register (the "register after a session
// already exists" timing), exercising the fan-out path specifically.
it('drives a model→agent tools/call of chrome_read_page over the reverse WS channel and consumes the result', async () => {
// Under container sandboxing, the ACP child cannot reach the host-loopback
// fake model server used below; keep the discovery-only test running there.
itPromptedModelMaybe('drives a model→agent tools/call of chrome_read_page over the reverse WS channel and consumes the result', async () => {
const ws = new WebSocket(`ws://127.0.0.1:${port}/acp`, {
headers: { Authorization: `Bearer ${TOKEN}` },
});
Expand Down
4 changes: 2 additions & 2 deletions packages/chrome-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
"README.md"
],
"scripts": {
"dev": "EXTENSION_OUT_DIR=dist/extension node scripts/dev-watch.js",
"dev": "node scripts/dev-watch.js",
"debug:mac": "./scripts/debug.sh",
"sync:extension": "node scripts/sync-extension.js",
"build:bg": "node scripts/sync-extension.js && node config/esbuild.background.config.js",
"build:bg:watch": "node scripts/sync-extension.js && node config/esbuild.background.config.js --watch",
"build": "EXTENSION_OUT_DIR=dist/extension npm run clean && EXTENSION_OUT_DIR=dist/extension node scripts/sync-extension.js && EXTENSION_OUT_DIR=dist/extension node config/esbuild.background.config.js --production",
"build": "node scripts/sync-extension.js && node config/esbuild.background.config.js --production",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion] The build script silently drops npm run clean alongside the POSIX env-var fix. clean.sh has broader scope (removes native-host/dist/, chrome-extension.zip, .extension-id files, log files) than sync-extension.js's internal dist/extension/ cleaning. If intentional, consider documenting this in the PR description; if not, restore it:

Suggested change
"build": "node scripts/sync-extension.js && node config/esbuild.background.config.js --production",
"build": "npm run clean && node scripts/sync-extension.js && node config/esbuild.background.config.js --production",

— qwen3.7-max via Qwen Code /review

"test": "vitest run --config vitest.config.ts",
"test:ci": "vitest run --config vitest.config.ts",
"dev:chrome": "open -a 'Google Chrome' --args --load-extension=$PWD/dist/extension --auto-open-devtools-for-tabs",
Expand Down
28 changes: 28 additions & 0 deletions scripts/tests/chrome-extension-package.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* @license
* Copyright 2026 Qwen Team
* SPDX-License-Identifier: Apache-2.0
*/

import { readFileSync } from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { describe, expect, it } from 'vitest';

const __dirname = path.dirname(fileURLToPath(import.meta.url));
const root = path.resolve(__dirname, '../..');

describe('chrome extension package scripts', () => {
it('keeps the build script portable for Windows npm lifecycle runs', () => {
const packageJson = JSON.parse(
readFileSync(
path.join(root, 'packages/chrome-extension/package.json'),
'utf8',
),
);

expect(packageJson.scripts.build).not.toMatch(
/(?:^|\s&&\s)[A-Za-z_][A-Za-z0-9_]*=/,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion] The regression guard only asserts scripts.build, but scripts.dev also had its POSIX env-var removed in this PR. A future contributor could reintroduce the pattern in dev undetected. Consider iterating over all scripts:

const posixEnvAssignment = /(?:^|\s&&\s)[A-Za-z_][A-Za-z0-9_]*=/;
for (const [name, script] of Object.entries(packageJson.scripts)) {
  expect(script, `scripts.${name}`).not.toMatch(posixEnvAssignment);
}

— qwen3.7-max via Qwen Code /review

);
});
});
Loading