qwen-code/scripts
易良 93e1597b7e
test: stop millisecond budgets from measuring the shared pool (#10870)
* test: stop millisecond budgets from measuring the shared pool

A budget written on a developer machine measures the code. On the shared
ECS pool it measures the neighbours: the same third of the same suite runs
in 6.7 or 36 minutes there depending only on which host it lands on, and at
that spread every one of these bounds is a coin flip.

Route the eleven wall-clock assertions through a helper that skips them
when the workflow marks the run as pool-hosted. They still run locally and
on the GitHub-hosted lanes, which is where the number means something.

Claude-Session: https://claude.ai/code/session_01MCE9CXnMVrX4fUxHpQoUr8

* test: cover the inline wall-clock budgets too

The first pass matched only `expect(elapsed).toBeLessThan(N)`, which is
under a third of the family. Twenty-three more write the measurement
inline — `expect(Date.now() - started).toBeLessThan(N)` — including two in
acp-http/transport.test.ts, the file that flaked on #10842's CI run.

Two sites stay as they are: NativeLspService's bound runs under fake
timers, and hook-runner.process.test.ts belongs to #10842.

Claude-Session: https://claude.ai/code/session_01MCE9CXnMVrX4fUxHpQoUr8

* ci: move the latency gate to the end of the env block

Three CI PRs were extending the same anchor after NO_COLOR, so whichever
landed second had to resolve a conflict that carried no disagreement.

Claude-Session: https://claude.ai/code/session_01MCE9CXnMVrX4fUxHpQoUr8

* test: keep a relaxed bound where the duration is the property

Five of the quarantined cases have no other expect(): a complexity bound
or a no-zombie guarantee is the whole test, so skipping on the pool would
leave them running and checking nothing — greener than before and worth
less. They now keep a bound 20x wide there: far beyond the ~5x contention
this fleet shows, far under what a quadratic regression costs.

Claude-Session: https://claude.ai/code/session_01MCE9CXnMVrX4fUxHpQoUr8

* test(review): stamp the ledger entries when the test runs, not when it loads

The three entries were stamped from a `Date.now()` evaluated in the
describe body — at collection — while `beforeEach` writes the plan file at
execution. Entries are fenced against that file's mtime with 2s of slack, so
the stamps go stale by however long collection took and the fence drops them
as a previous run's.

Reproduced against the real module: at a 0ms and 1.5s gap the count reads 2,
at 3s it reads 1, past a minute it reads 0 — the same 1/0/0 the three
attempts of release run 33713579913 read after collecting for 2260s.

Claude-Session: https://claude.ai/code/session_01MCE9CXnMVrX4fUxHpQoUr8

* ci: restore the latency gate dropped by the previous commit

The previous commit swept in a stale copy of ci.yml left in the worktree
and deleted this branch's own env key. Nothing about the gate changed.

Claude-Session: https://claude.ai/code/session_01MCE9CXnMVrX4fUxHpQoUr8

* test: move the ledger stamp fix to its own PR

That change is a defect — a stamp taken at collection, fenced against a
file written at execution — while this PR is a tradeoff about where
wall-clock budgets are worth asserting. They review differently, so they
ship separately. See #10878.

Claude-Session: https://claude.ai/code/session_01MCE9CXnMVrX4fUxHpQoUr8

* test: make the pool-lane bounds able to fail again

The relaxed poolMultiplier bounds could never fire: the transport
zombie tests' own 3s safety abort capped elapsed far below 1500x20, and
the serve close bound (5500x20) sat above both the 5s force-close timer
and the pool's 60s testTimeout, so vitest decided the outcome first.
Assert what the lanes can actually observe: the zombie tests record
whether the safety abort fired (a zombie ends only via that abort) and
drop the multiplier; the close bound uses a 10x multiple that stays
under testTimeout while a real stall still fails it.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-closeout/jmtl54lfvf2

* test: parse QWEN_SKIP_LATENCY_BUDGETS as a boolean

'0' and 'false' are truthy strings, so the raw truthiness gate skipped
every budget for them — the opposite of what exporting =0 to re-enable
budgets intends. Parse '1'/'true'/'yes' as skip; anything else
enforces. Both byte-identical copies updated in lockstep; helper suites
pin the gate both ways, including that poolMultiplier must not relax the
bound when the switch is unset.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-closeout/jmtl54lfvf2

* test: pin that poolMultiplier never relaxes the bound off the pool

Add a case to both latency-budget test copies proving that with
QWEN_SKIP_LATENCY_BUDGETS unset, poolMultiplier must not move the
bound: the probe (1500 vs a 100 ms budget, x20) throws off the pool
while the same call keeps the relaxed bound on it. The
unconditional-multiplier mutant now fails this case in both
packages.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-closeout/jmtl79r9if7

* test: pin the QWEN_SKIP_LATENCY_BUDGETS wiring in ci.yml

Extend the ECS-predicate pin case so the new skip line is nailed
verbatim beside its four VITEST_* siblings. Without the pin, an
edit that alters the predicate or renders '1' on every lane
silently disables every millisecond budget while the helper tests
stay green; the pin goes red on that mutant.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-closeout/jmtl79r9if7

* test: keep the overall-cap bound asserting on the pool lane

Give the wall-clock cap case poolMultiplier 5 so the pool lane
keeps an upper bound at 4000ms: still under the ~5000ms drain a
broken cap drains sequentially, but above a ~100ms firing under
the fleet's ~5x contention. Without it the pool lane kept only
the trivially-true lower bound, so the cap regression this test
exists to catch shipped green there; the default x20 multiple
would clear the drain too.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-closeout/jmtl79r9if7

* test(ci): raise the scripts suite timeout where the suite actually reads it

30s was the quiet-host figure. Release run 33725742855 lost its Quality
Checks (Scripts) job to two files at once — qwen-autofix-workflow, whose
heaviest case measures ~14s idle, and acp-serve-boundary-guard, which
nothing here touches — neither of them slow, both past 30s on a contended
host.

An earlier attempt put `vi.setConfig({ testTimeout: 90_000 })` at the top of
one of those files. It is still on main and it does not work: these cases
register their timeout at collection, before a runtime call can move it, and
the same file timed out at 30000ms with that line in place. Remove it and
set the value where the suite reads it, behind an env knob so the pool can
be retuned without a PR.

Claude-Session: https://claude.ai/code/session_01MCE9CXnMVrX4fUxHpQoUr8

* test(agent-view): give the ready wait the product's own budget

Four cases capped the worker-ready wait at 1s while the product allows
15s (DEFAULT_WORKER_READY_TIMEOUT_MS). None of them asserts anything about
that deadline — it is scaffolding for the state they do assert. On the
shared pool a worker takes longer than a second to report ready, so they
failed three times each, with --retry=2 already on, in release run
33713579913.

The two cases that DO assert the timeout keep their 1ms.

Claude-Session: https://claude.ai/code/session_01MCE9CXnMVrX4fUxHpQoUr8

* test(serve): give the archive waits the room the shared host needs

`vi.waitFor` defaults to a 1000ms deadline — a developer-machine figure,
hardcoded in Vitest with no global knob. On the shared pool the archive
install and its settle take longer than that, and release run 33713579913
lost both of these cases with --retry=2 already on.

Only the five waits inside those two cases move. The deadline is
scaffolding for the state they assert, never the thing under test.

Claude-Session: https://claude.ai/code/session_01MCE9CXnMVrX4fUxHpQoUr8

* test: keep the complexity bounds asserting on the pool lane

Fourteen sites are ReDoS and complexity guards — 'stays linear on
pathological inputs', 'collapses an exponentially branching $ref type tree',
'does not catastrophically backtrack', 'runs in bounded time'. Skipping them
outright leaves assertions that a quadratic regression satisfies, on the one
lane every PR runs: ci-bot's witness is a 1.5s busy-spin in
budgetGapDisclosures, green on the pool and red under the strict bound.

The earlier pass only caught the sites with no other expect() at all. That
judgement was too narrow — what matters is whether the remaining assertions
survive the regression the bound exists to catch.

Multipliers land the relaxed bound near 20s, a third of the pool's 60s
testTimeout, so Vitest never decides first. review-footer's refusing-run
case carries its own 20s timeout, so it takes x5.

Claude-Session: https://claude.ai/code/session_01MCE9CXnMVrX4fUxHpQoUr8

* ci: quarantine latency budgets in autofix gates

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* test(ci): let autofix upsert use the suite timeout

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

---------

Co-authored-by: yiliang114 <jinjing.zzj@gmail.com>
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-09-03 09:50:34 +00:00
..
codemod feat(opentui): bundle assets, CI matrix and parity tooling (Batch 7) (#10770) 2026-09-02 08:36:20 +00:00
installation feat(release): add gated bun/OpenTUI preview flavor to standalone releases (#10814) 2026-09-02 12:01:56 +00:00
lib feat(core): support QWEN_HOME env var to customize config directory (#2953) 2026-05-09 15:51:52 +08:00
tests test: stop millisecond budgets from measuring the shared pool (#10870) 2026-09-03 09:50:34 +00:00
tui-parity fix(cli): Align OpenTUI mid-turn submit and exit with ink (#10883) 2026-09-03 09:31:05 +00:00
acp-http-smoke.mjs feat(daemon): merge daemon-mode feature batch into main (#4490) 2026-06-12 00:34:49 +08:00
audit-runtime-critical.js ci: keep the critical-audit gate honest when npm cannot answer (#7743) 2026-07-26 06:59:13 +00:00
benchmark-api-latency.mjs feat(cli): add API preconnect to reduce first-call latency (#3318) 2026-04-27 06:54:55 +08:00
build-hosted-installation-assets.js fix(installer): auto-detect SYSTEM account and default PATH scope to machine (#4903) 2026-06-10 21:02:10 +08:00
build-standalone-release.js feat(release): add gated bun/OpenTUI preview flavor to standalone releases (#10814) 2026-09-02 12:01:56 +00:00
build.js feat(qwen-live): standalone voice daemon package — M1 + M2 (#10367) 2026-09-01 06:37:23 +00:00
build_package.js fix(build): clean stale outputs before tsc --build to prevent TS5055 (#4453) 2026-05-23 23:06:31 +08:00
build_sandbox.js fix(release): stop hiding sandbox build failures and check the prepared package early (#10784) 2026-09-02 11:38:33 +00:00
build_vscode_companion.js Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
check-build-status.js fix(cli): scope startup warnings to dev sessions (#8456) 2026-08-29 13:22:34 +00:00
check-desktop-isolation.js fix(live): restore Live Host after desktop removal (#9994) 2026-08-25 12:32:31 +00:00
check-i18n.ts fix(cli): localize approval mode UI labels (#6592) 2026-07-11 00:07:03 +00:00
check-lockfile.js Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
check-serve-fast-path-bundle.js refactor(core,cli): rename generic Gemini identifiers to Llm (#10124) 2026-08-28 03:05:49 +00:00
check-tui-dep-direction.mjs feat(cli): OpenTUI migration infra batch — locked deps, dependency-direction arch check, framework-neutral streaming model (#10134) 2026-08-28 02:44:46 +00:00
clean-package-build-artifacts.js feat(channels): add DingTalk Workspace channel (#9394) 2026-08-25 06:40:47 +00:00
clean.js feat(desktop): Add desktop app package with Qwen ACP SDK integration (#3778) 2026-06-11 21:57:20 +08:00
cli-entry.js fix(cli): preserve Qwen Review startup version in footers (#8431) 2026-08-04 14:58:56 +00:00
copy_bundle_assets.js feat(opentui): bundle assets, CI matrix and parity tooling (Batch 7) (#10770) 2026-09-02 08:36:20 +00:00
copy_files.js refactor(core): move review skill incident narratives to DESIGN.md (#8499) 2026-08-04 12:41:18 +00:00
create-standalone-package.js feat(release): add gated bun/OpenTUI preview flavor to standalone releases (#10814) 2026-09-02 12:01:56 +00:00
create_alias.sh fix: ambiguous literals (#461) 2025-08-27 15:23:21 +08:00
daemon-dev.js fix(scripts): allow multiple dev:daemon instances by probing Vite port (#7212) 2026-07-19 12:49:47 +00:00
dev.js fix(review): report what the transcripts prove; build the roster in one call (#7033) 2026-07-18 00:43:57 +00:00
esbuild-shims.js perf(cli): code-split lowlight to cut startup V8 parse cost (#4070) 2026-05-15 17:26:18 +08:00
generate-changelog.js feat(release): user-facing bilingual digest for release notes (#9216) 2026-08-17 00:12:04 +00:00
generate-git-commit-info.js # 🚀 Sync Gemini CLI v0.2.1 - Major Feature Update (#483) 2025-09-01 14:48:55 +08:00
generate-release-notes.js feat(release): user-facing bilingual digest for release notes (#9216) 2026-08-17 00:12:04 +00:00
generate-settings-schema.ts revert: remove local PR verification gate (#7031) 2026-07-16 11:24:38 +00:00
get-release-version.js feat(external-context): Publish the Mem0 Extension package (#10653) 2026-09-01 22:12:00 +00:00
lint.js fix(ci): cache downloaded linters on ECS runners (#9001) 2026-08-13 05:13:23 +00:00
local_telemetry.js Merge tag 'v0.3.0' into chore/sync-gemini-cli-v0.3.0 2025-09-11 16:26:56 +08:00
measure-flicker.mjs fix(cli): bound SubAgent display by visual height to prevent flicker (#3721) 2026-04-29 22:34:55 +08:00
pre-commit.js Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
prepare-package.js feat(opentui): bundle assets, CI matrix and parity tooling (Batch 7) (#10770) 2026-09-02 08:36:20 +00:00
prepare.js feat(web-shell): git status chip, visual working-tree diff, and sidebar git status (#7054) 2026-07-18 10:06:07 +00:00
pty-e2e.sh feat(opentui): bundle assets, CI matrix and parity tooling (Batch 7) (#10770) 2026-09-02 08:36:20 +00:00
release-script-utils.js feat(installer): add standalone hosted install and uninstall flow (#3828) 2026-05-21 11:57:10 +08:00
review-audit-layers.mts feat(review): cover modeled-system defect layers in the reverse audit (#8956) 2026-08-12 18:15:11 +00:00
run-java-daemon-sdk-e2e.ts ci: reduce SDK Java runner queueing (#8441) 2026-08-03 16:21:05 +00:00
sandbox_command.js fix(scripts): avoid shell injection in sandbox command detection (#6108) 2026-07-01 16:20:40 +08:00
sdk-node-exporter-stub.js chore(deps): Clear high-severity CVE baseline and harden the security gate (#9584) 2026-08-21 07:43:32 +00:00
sign-release.sh feat(cli): add standalone auto-update support (#4629) 2026-06-04 22:53:12 +08:00
start.js fix(cli): scope startup warnings to dev sessions (#8456) 2026-08-29 13:22:34 +00:00
telemetry.js feat(core): support QWEN_HOME env var to customize config directory (#2953) 2026-05-09 15:51:52 +08:00
telemetry_gcp.js fix(mcp): update OAuth client names and improve MCP commands 2026-02-08 10:46:48 +08:00
telemetry_utils.js feat(core): support QWEN_HOME env var to customize config directory (#2953) 2026-05-09 15:51:52 +08:00
test-rewind-e2e.sh fix(test): update rewind E2E Test 1 assertion after isRealUserTurn fix (#3622) 2026-04-26 06:49:42 +08:00
test-windows-paths.js chore: consistently import node modules with prefix (#3013) 2025-08-25 20:11:27 +00:00
tmux-compare.sh feat(opentui): bundle assets, CI matrix and parity tooling (Batch 7) (#10770) 2026-09-02 08:36:20 +00:00
unused-keys-only-in-locales.json feat: add /diff command and git diff statistics utility (#3491) 2026-05-10 11:15:59 +08:00
upload-aliyun-oss-assets.js ci: host PR evidence outside Git (#9985) 2026-08-29 04:36:57 +00:00
verify-capture.mjs fix(ci): avoid verify capture color conflict (#8236) 2026-07-31 14:15:40 +00:00
verify-installation-release.js feat(release): add gated bun/OpenTUI preview flavor to standalone releases (#10814) 2026-09-02 12:01:56 +00:00
version.js feat(external-context): Publish the Mem0 Extension package (#10653) 2026-09-01 22:12:00 +00:00
vitest-global-setup.js feat(channels): add DingTalk Workspace channel (#9394) 2026-08-25 06:40:47 +00:00
workspaces.js feat(desktop): Add desktop app package with Qwen ACP SDK integration (#3778) 2026-06-11 21:57:20 +08:00