Files
qwen-code/package.json
T
Shaojin Wen d4e8d9ffde test(managed-agent): gate the A4 takeover-load reply-loss handoff (#15857)
* test(managed-agent): gate the A4 takeover-load reply-loss handoff

The A4 load half was recorded as a recovery gap (a lost takeover-load reply
leaving the original Turn stuck RUNNING). On the current tree that variant does
not reproduce: when the replacement loses the reply to its first drive load and
the control plane redrives the same load into the now-active driver, the redrive
restates the active attachment and the original Turn projects exactly one
terminal with the recovered answer. Two clean real-stack runs (Linux aarch64,
MySQL 8.0.46, JDK 21) recover correctly with the fault injected.

Rather than leave the row focused, package it as a regression gate so the
handoff cannot silently regress:

- A test-gated Harness hook (QWEN_E2E_DROP_LOAD_REPLY=<sessionId>, set only on
  the replacement by the arm, never in production) destroys the first load
  attach reply once, after the driver started.
- The arm asserts the reply was actually lost (via the replacement's captured
  log) before trusting the recovery, then requires one terminal, the recovered
  answer, one settled execution and one file effect.
- Refusing the redrive's active-branch restatement makes the arm fail at the
  adoption barrier, proving the gate is load-bearing.

The failover job grows to 24 arms (ceiling 255). The bilingual Step 3 design and
the server README flip the A4 load row from a focused gap to packaged and note
that the earlier stuck-RUNNING variant did not reproduce on the current tree.

* test(cli): document the A4 load-reply fault flag in the serve env guard

The packaged load-reply-lost arm reads QWEN_E2E_DROP_LOAD_REPLY once at session-bridge construction in hosted-harness-session.ts. The serve process.env guard requires every access to be a documented process-scoped exception, so register the test-gated flag with its reason. Fixes the Qwen Code CI env-guard red on the merged head.
2026-10-29 15:26:20 +00:00

254 lines
17 KiB
JSON

{
"name": "@qwen-code/qwen-code",
"private": true,
"version": "0.26.4",
"packageManager": "[email protected]+sha512.bd27e345e976dcb0be0b7a1228217b049a817e21b1f355c90dbe7dc46671895a8bc1e6d06c24554505ea93ea0b45f489a27ec1bfbc8de6a9659fca0f16fa0000",
"engines": {
"node": ">=22.0.0"
},
"type": "module",
"workspaces": [
"packages/*",
"packages/cua-driver/typescript",
"packages/channels/base",
"packages/channels/telegram",
"packages/channels/weixin",
"packages/channels/dingtalk",
"packages/channels/wecom",
"packages/channels/feishu",
"packages/channels/qqbot",
"packages/channels/github",
"packages/channels/dws",
"packages/channels/email",
"packages/channels/gitlab",
"packages/channels/plugin-example",
"integrations/external-context",
"integrations/external-context-mem0",
"integrations/test-failure-explorer",
"integrations/generated-ui",
"!packages/desktop",
"!packages/live-host",
"!packages/mobile-shell"
],
"repository": {
"type": "git",
"url": "git+https://github.com/QwenLM/qwen-code.git"
},
"config": {
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.26.4"
},
"scripts": {
"start": "node scripts/start.js",
"dev": "node scripts/dev.js",
"dev:daemon": "node scripts/daemon-dev.js",
"dev:managed-agent-web": "npm --workspace packages/web-shell run dev -- --port 5174",
"dev:managed-agent": "node scripts/managed-agent-dev.js",
"debug": "cross-env DEBUG=1 node --inspect-brk scripts/start.js",
"generate": "node scripts/generate-git-commit-info.js",
"generate:settings-schema": "node --import tsx/esm scripts/generate-settings-schema.ts",
"generate:model-catalog": "node --import tsx/esm scripts/generate-model-catalog.ts",
"build": "cross-env NODE_OPTIONS=\"--max-old-space-size=6144\" node scripts/build.js",
"build-and-start": "npm run build && npm run start",
"build:vscode": "node scripts/build_vscode_companion.js",
"build:all": "npm run build && npm run build:sandbox && npm run build:vscode",
"build:packages": "corepack pnpm -r run build",
"build:sandbox": "node scripts/build_sandbox.js",
"bundle": "npm run generate && node esbuild.config.js && node scripts/copy_bundle_assets.js",
"test": "cross-env NODE_OPTIONS=\"--max-old-space-size=3072\" npm run test --workspaces --if-present",
"test:ci:workspaces": "cross-env NODE_OPTIONS=\"--max-old-space-size=3072\" npm run test:ci --workspaces --if-present --",
"test:ci": "npm run test:ci:workspaces && npm run test:scripts",
"test:release": "npm run test:release:workspaces && npm run test:scripts",
"test:release:workspaces": "cross-env NODE_OPTIONS=\"--max-old-space-size=3072\" npm run test:ci --workspaces --if-present -- --coverage.enabled=false",
"test:standalone:runtimes": "node scripts/test-standalone-runtimes.mjs",
"test:standalone:runtimes:ci": "node scripts/test-standalone-runtimes.mjs --ci",
"test:scripts": "npm run test:standalone:runtimes:ci && npm run test:scripts:unit --",
"test:scripts:unit": "vitest run --config ./scripts/tests/vitest.config.ts",
"test:e2e": "cross-env VERBOSE=true KEEP_OUTPUT=true npm run test:integration:sandbox:none",
"test:e2e:managed-agent-server": "tsx scripts/run-managed-agent-server-e2e.ts",
"test:e2e:managed-session-failover": "tsx scripts/run-managed-agent-server-e2e.ts --session-failover",
"test:e2e:managed-inflight-failover": "tsx scripts/run-managed-agent-server-e2e.ts --inflight-failover",
"test:e2e:managed-continuation-failover": "tsx scripts/run-managed-agent-server-e2e.ts --continuation-failover",
"test:e2e:managed-big-output": "tsx scripts/run-managed-agent-server-e2e.ts --big-output",
"test:e2e:managed-harness-restart-failover": "tsx scripts/run-managed-agent-server-e2e.ts --session-failover --harness-only",
"test:e2e:managed-harness-restart-inflight-failover": "tsx scripts/run-managed-agent-server-e2e.ts --inflight-failover --harness-only",
"test:e2e:managed-harness-restart-continuation-failover": "tsx scripts/run-managed-agent-server-e2e.ts --continuation-failover --harness-only",
"test:e2e:managed-continuation-frozen-owner-failover": "tsx scripts/run-managed-agent-server-e2e.ts --continuation-failover --freeze",
"test:e2e:managed-harness-restart-approval-allow": "tsx scripts/run-managed-agent-server-e2e.ts --continuation-failover --harness-only --g3-verify allow",
"test:e2e:managed-harness-restart-approval-deny": "tsx scripts/run-managed-agent-server-e2e.ts --continuation-failover --harness-only --g3-verify deny",
"test:e2e:managed-harness-restart-approval-cancel": "tsx scripts/run-managed-agent-server-e2e.ts --continuation-failover --harness-only --g3-verify cancel",
"test:e2e:managed-harness-restart-approval-expiry": "tsx scripts/run-managed-agent-server-e2e.ts --continuation-failover --harness-only --g3-verify expiry",
"test:e2e:managed-harness-restart-approval-after-decision": "tsx scripts/run-managed-agent-server-e2e.ts --continuation-failover --harness-only --g3-verify allow --g3-fault after-decision",
"test:e2e:managed-harness-restart-approval-after-prepare": "tsx scripts/run-managed-agent-server-e2e.ts --continuation-failover --harness-only --g3-verify allow --g3-fault after-prepare",
"test:e2e:managed-harness-restart-approval-after-result": "tsx scripts/run-managed-agent-server-e2e.ts --continuation-failover --harness-only --g3-verify allow --g3-fault after-result",
"test:e2e:managed-harness-restart-approval-cleanup-failed": "tsx scripts/run-managed-agent-server-e2e.ts --continuation-failover --harness-only --g3-verify allow --g3-fault cleanup-failed",
"test:e2e:managed-harness-restart-approval-decision-reply-lost": "tsx scripts/run-managed-agent-server-e2e.ts --continuation-failover --harness-only --g3-verify allow --g3-fault decision-reply-lost",
"test:e2e:managed-harness-restart-approval-admission-reply-lost": "tsx scripts/run-managed-agent-server-e2e.ts --continuation-failover --harness-only --g3-verify allow --g3-fault admission-reply-lost",
"test:e2e:managed-harness-restart-approval-load-reply-lost": "tsx scripts/run-managed-agent-server-e2e.ts --continuation-failover --harness-only --g3-verify allow --g3-fault load-reply-lost",
"test:e2e:managed-harness-restart-approval-terminal-reply-lost": "tsx scripts/run-managed-agent-server-e2e.ts --continuation-failover --harness-only --g3-verify allow --g3-fault terminal-reply-lost",
"test:e2e:managed-harness-restart-approval-terminal-write-failed": "tsx scripts/run-managed-agent-server-e2e.ts --continuation-failover --harness-only --g3-verify allow --g3-fault terminal-write-failed",
"test:e2e:managed-harness-restart-continuation-closeout": "tsx scripts/run-managed-agent-server-e2e.ts --continuation-failover --harness-only --g3-verify continuation",
"test:e2e:managed-harness-restart-model-round-failover": "tsx scripts/run-managed-agent-server-e2e.ts --model-round-failover --harness-only",
"test:e2e:managed-frozen-control-plane-failover": "tsx scripts/run-managed-agent-server-e2e.ts --model-round-failover --frozen-control-plane",
"test:chrome-extension:e2e": "npm -w packages/chrome-extension run test:e2e:chrome",
"test:chrome-extension:release": "npm run build && cross-env DEV=true npm run bundle && npm -w packages/chrome-extension run test:release",
"test:integration:all": "npm run test:integration:sandbox:none && npm run test:integration:sandbox:docker && npm run test:integration:sandbox:podman",
"test:integration:sandbox:none": "cross-env QWEN_SANDBOX=false vitest run --root ./integration-tests",
"test:integration:sandbox:docker": "cross-env QWEN_SANDBOX=docker npm run build:sandbox && QWEN_SANDBOX=docker vitest run --root ./integration-tests",
"test:integration:sandbox:podman": "cross-env QWEN_SANDBOX=podman vitest run --root ./integration-tests",
"test:integration:hosted:sandbox:none": "cross-env QWEN_SANDBOX=false vitest run --root ./integration-tests --config ./vitest.hosted.config.ts",
"test:integration:no-ak:sandbox:none": "cross-env QWEN_SANDBOX=false vitest run --root ./integration-tests --poolOptions.forks.maxForks 2 ./fake-openai-server.test.ts ./test-helper.test.ts ./chat-transcript-contract.test.ts ./skill-hooks-invocation-parity.test.ts ./skill-hooks-resume.test.ts ./qwen-live-m4-acp-call.test.ts ./qwen-live-m4-acp-permission.test.ts ./qwen-live-m4-acp-steering.test.ts ./qwen-live-m4-acp-multibackend.test.ts ./qwen-live-m1-call.test.ts ./qwen-live-m2-inject.test.ts ./qwen-live-m2-permission.test.ts ./qwen-live-m2-steering.test.ts ./cli/_prompt-latency-policy.test.ts ./cli/agent-loop-parity.test.ts ./cli/acp-agent-loop-parity.test.ts ./cli/hosted-harness-process.test.ts ./cli/daemon-invocation-context.test.ts ./cli/headless-workflow-skill.test.ts ./cli/workflow-ancestor-discovery.test.ts ./cli/daemon-workflow-ancestor-trust.test.ts ./cli/workflow-intent.test.ts ./cli/workflow-mode.test.ts ./cli/acp-workflow-mode.test.ts ./cli/daemon-workflow-intent.test.ts ./cli/daemon-workflow-mode.test.ts ./cli/list_directory.test.ts ./cli/tool-hook-context.test.ts ./cli/tool-hook-updated-input.test.ts ./cli/qwen-serve-routes.test.ts ./cli/qwen-serve-session-cd.test.ts ./cli/qwen-serve-streaming.test.ts ./cli/qwen-serve-standalone-concurrency.test.ts ./interactive/workflow-completion.test.ts ./interactive/workflow-intent.test.ts ./interactive/workflow-mode.test.ts ./interactive/mods-tool-middleware.test.ts ./interactive/statusline-parity.test.ts ./interactive/tui-editor-parity.test.ts ./interactive/tui-input-ownership.test.ts ./sdk-typescript/abort-and-lifecycle.test.ts ./sdk-typescript/permission-control.test.ts ./sdk-typescript/sdk-mcp-server.test.ts ./sdk-typescript/subagents.test.ts ./sdk-typescript/system-control.test.ts ./sdk-typescript/tool-control.test.ts ./sdk-typescript/workflow-intent.test.ts ./sdk-typescript/workflow-mode.test.ts",
"test:integration:sdk:sandbox:none": "cross-env QWEN_SANDBOX=false vitest run --root ./integration-tests --poolOptions.forks.maxForks 2 sdk-typescript",
"test:integration:sdk:sandbox:docker": "cross-env QWEN_SANDBOX=docker npm run build:sandbox && QWEN_SANDBOX=docker vitest run --root ./integration-tests --poolOptions.forks.maxForks 2 sdk-typescript",
"test:sdk:python": "python3 -m pytest -c packages/sdk-python/pyproject.toml packages/sdk-python/tests -q",
"test:integration:cli:sandbox:none": "cross-env QWEN_SANDBOX=false vitest run --root ./integration-tests cli",
"test:integration:cli:sandbox:docker": "cross-env QWEN_SANDBOX=docker npm run build:sandbox && QWEN_SANDBOX=docker vitest run --root ./integration-tests cli",
"test:integration:interactive:sandbox:none": "cross-env QWEN_SANDBOX=false vitest run --root ./integration-tests interactive",
"test:integration:interactive:bun-ink:sandbox:none": "cross-env QWEN_E2E_RENDERER=ink QWEN_E2E_RUNTIME=bun QWEN_SANDBOX=false vitest run --root ./integration-tests interactive",
"test:integration:interactive:opentui:sandbox:none": "cross-env QWEN_E2E_RENDERER=opentui QWEN_SANDBOX=false vitest run --root ./integration-tests interactive",
"test:integration:interactive:sandbox:docker": "cross-env QWEN_SANDBOX=docker npm run build:sandbox && QWEN_SANDBOX=docker vitest run --root ./integration-tests interactive",
"test:terminal-bench": "cross-env VERBOSE=true KEEP_OUTPUT=true vitest run --config ./vitest.terminal-bench.config.ts --root ./integration-tests",
"test:terminal-bench:oracle": "cross-env VERBOSE=true KEEP_OUTPUT=true vitest run --config ./vitest.terminal-bench.config.ts --root ./integration-tests -t 'oracle'",
"test:terminal-bench:qwen": "cross-env VERBOSE=true KEEP_OUTPUT=true vitest run --config ./vitest.terminal-bench.config.ts --root ./integration-tests -t 'qwen'",
"lint": "eslint . --ext .ts,.tsx && eslint integration-tests",
"lint:fix": "eslint . --fix && eslint integration-tests --fix",
"lint:ci": "eslint . --ext .ts,.tsx --max-warnings 0 && eslint integration-tests --max-warnings 0",
"lint:sdk:python": "python3 -m ruff check --config packages/sdk-python/pyproject.toml packages/sdk-python",
"lint:all": "node scripts/lint.js",
"audit:runtime:critical": "node scripts/audit-runtime-critical.js",
"format": "prettier --experimental-cli --write .",
"typecheck": "npm run typecheck --workspaces --if-present && npm run typecheck:integration",
"typecheck:integration": "tsc -p integration-tests/tsconfig.json --pretty false",
"typecheck:sdk:python": "python3 -m mypy --config-file packages/sdk-python/pyproject.toml packages/sdk-python/src",
"smoke:sdk:python": "python3 packages/sdk-python/scripts/smoke_real.py",
"build:sdk:python": "python3 -m build packages/sdk-python",
"check-i18n": "npm run check-i18n --workspace=packages/cli",
"preflight": "npm run clean && corepack pnpm install --frozen-lockfile && npm run format && npm run lint:ci && npm run build && npm run typecheck && npm run test:ci && npm run check:serve-fast-path-bundle",
"postinstall": "patch-package",
"prepare": "node scripts/prepare.js",
"prepare:package": "node scripts/prepare-package.js",
"package:hosted-installation": "node scripts/build-hosted-installation-assets.js",
"package:standalone": "node scripts/create-standalone-package.js",
"package:managed-runtime": "node scripts/create-managed-runtime-package.js",
"package:standalone:release": "node scripts/build-standalone-release.js",
"verify:installation-release": "node scripts/verify-installation-release.js",
"release:version": "node scripts/version.js",
"changelog": "node scripts/generate-changelog.js",
"telemetry": "node scripts/telemetry.js",
"check:lockfile": "node scripts/check-lockfile.js",
"check:desktop-isolation": "node scripts/check-desktop-isolation.js",
"check:tui-dep-direction": "node scripts/check-tui-dep-direction.mjs",
"check:core-subpath-exports": "node scripts/check-core-subpath-exports.mjs",
"check:serve-fast-path-bundle": "node scripts/clean-package-build-artifacts.js && npm run build -- --cli-only && cross-env DEV=true npm run bundle && node scripts/check-serve-fast-path-bundle.js",
"clean": "node scripts/clean.js",
"pre-commit": "node scripts/pre-commit.js"
},
"overrides": {
"brace-expansion@1": "1.1.21",
"brace-expansion@2": "2.1.7",
"ansi-regex": "6.2.2",
"cliui": {
"wrap-ansi": "7.0.0"
},
"baseline-browser-mapping": "^2.9.19",
"normalize-package-data": "^7.0.1",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"@types/react": "^19.2.0",
"@types/react-dom": "^19.2.0",
"axios": "^1.19.0",
"react-markdown": "^9.0.0"
},
"bin": {
"qwen": "scripts/cli-entry.js"
},
"files": [
"dist/",
"scripts/cli-entry.js",
"README.md",
"LICENSE"
],
"devDependencies": {
"@emnapi/core": "1.11.3",
"@emnapi/runtime": "1.11.3",
"@qwen-code/acp-bridge": "file:packages/acp-bridge",
"@qwen-code/channel-base": "file:packages/channels/base",
"@qwen-code/qwen-code": "file:packages/cli",
"@qwen-code/qwen-code-core": "file:packages/core",
"@qwen-code/sdk": "file:packages/sdk-typescript",
"@qwen-code/web-shell": "file:packages/web-shell",
"@qwen-code/web-templates": "file:packages/web-templates",
"@types/chrome": "^0.1.32",
"@types/jsdom": "^28.0.3",
"@types/marked": "^5.0.2",
"@types/mime-types": "^3.0.1",
"@types/minimatch": "^5.1.2",
"@types/mock-fs": "^4.13.4",
"@types/node": "20.19.1",
"@types/proper-lockfile": "^4.1.4",
"@types/shell-quote": "^1.7.5",
"@types/uuid": "^10.0.0",
"@vitest/coverage-v8": "^3.1.1",
"@vitest/eslint-plugin": "^1.3.4",
"@xterm/addon-unicode11": "0.9.0",
"@xterm/headless": "^5.5.0",
"@xterm/xterm": "^6.0.0",
"cross-env": "^7.0.3",
"esbuild": "^0.25.0",
"esbuild-plugin-wasm": "^1.1.0",
"eslint": "^9.24.0",
"eslint-config-prettier": "^10.1.2",
"eslint-plugin-check-file": "^3.3.1",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-license-header": "^0.8.0",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^5.2.0",
"glob": "^10.5.0",
"globals": "^16.0.0",
"husky": "^9.1.7",
"jsdom": "^26.1.0",
"json": "^11.0.0",
"lint-staged": "^16.1.6",
"memfs": "^4.42.0",
"mnemonist": "^0.40.3",
"mock-fs": "^5.5.0",
"msw": "^2.10.4",
"npm-run-all": "^4.1.5",
"patch-package": "^8.0.1",
"playwright": "1.61.1",
"prettier": "^3.5.3",
"react-devtools-core": "^6.1.5",
"semver": "^7.7.2",
"sharp": "^0.35.4",
"strip-ansi": "^7.1.2",
"tsx": "^4.20.3",
"typescript-eslint": "^8.30.1",
"vitest": "^3.2.4",
"yaml": "^2.8.1",
"yargs": "^17.7.2",
"zod": "3.25.76"
},
"dependencies": {
"@testing-library/dom": "^10.4.1",
"ink": "7.0.3",
"simple-git": "^3.36.0"
},
"optionalDependencies": {
"@lydell/node-pty": "1.2.0-beta.10",
"@lydell/node-pty-darwin-arm64": "1.2.0-beta.10",
"@lydell/node-pty-darwin-x64": "1.2.0-beta.10",
"@lydell/node-pty-linux-arm64": "1.2.0-beta.10",
"@lydell/node-pty-linux-x64": "1.2.0-beta.10",
"@lydell/node-pty-win32-arm64": "1.2.0-beta.10",
"@lydell/node-pty-win32-x64": "1.2.0-beta.10"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"prettier --write",
"eslint --fix --max-warnings 0 --no-warn-ignored"
],
"*.{mjs,cjs,json,md,yml,yaml,css,html}": [
"prettier --write"
]
}
}