diff --git a/package.json b/package.json index f44b348ae4a..77c3461d51d 100644 --- a/package.json +++ b/package.json @@ -1596,7 +1596,7 @@ "@types/node": "25.6.0", "@types/qrcode-terminal": "^0.12.2", "@types/ws": "^8.18.1", - "@typescript/native-preview": "7.0.0-dev.20260422.1", + "@typescript/native-preview": "7.0.0-dev.20260423.1", "@vitest/coverage-v8": "^4.1.4", "jscpd": "4.0.9", "jsdom": "^29.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b5c9c31cb4d..cbfd973dbfb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -203,8 +203,8 @@ importers: specifier: ^8.18.1 version: 8.18.1 '@typescript/native-preview': - specifier: 7.0.0-dev.20260422.1 - version: 7.0.0-dev.20260422.1 + specifier: 7.0.0-dev.20260423.1 + version: 7.0.0-dev.20260423.1 '@vitest/coverage-v8': specifier: ^4.1.4 version: 4.1.4(@vitest/browser@4.1.4)(vitest@4.1.4) @@ -231,7 +231,7 @@ importers: version: 0.21.1(signal-polyfill@0.2.2) tsdown: specifier: 0.21.9 - version: 0.21.9(@typescript/native-preview@7.0.0-dev.20260422.1)(typescript@6.0.3) + version: 0.21.9(@typescript/native-preview@7.0.0-dev.20260423.1)(typescript@6.0.3) tsx: specifier: ^4.21.0 version: 4.21.0 @@ -4233,43 +4233,51 @@ packages: '@types/yauzl@2.10.3': resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} - '@typescript/native-preview-darwin-arm64@7.0.0-dev.20260422.1': - resolution: {integrity: sha512-W/lGgoEfbdI/QWYqcNP0fSa4DHQKKEMLzDPsE6fA64zmfCNsTO9M7ttK0acKiLsGB16pr0lubuMDRNN5kXyQ8w==} + '@typescript/native-preview-darwin-arm64@7.0.0-dev.20260423.1': + resolution: {integrity: sha512-wbLr6o5fROaCYt6cOpFhbe92FJAOdhAHwm/s8I/IyN5HbL1ULgel/wHaZiR+ws+27rgruNUiCENzTUg9vSz2bA==} + engines: {node: '>=16.20.0'} cpu: [arm64] os: [darwin] - '@typescript/native-preview-darwin-x64@7.0.0-dev.20260422.1': - resolution: {integrity: sha512-6tZ2yAcKLBIghwKyC74vDqb/7rB99fTpERv9f64iA1tMh6l+WHIuQb6z3mIFVOYBIl2pN9CYasURLroKYtUz1w==} + '@typescript/native-preview-darwin-x64@7.0.0-dev.20260423.1': + resolution: {integrity: sha512-13MpNT+4MgkgrfiW2u03rnER5aB3yz9fA0bWEYh6IH3rIqA2AR3Dntp3QXW4sQrZf0SriXqHe2R7X3HCT5xmqA==} + engines: {node: '>=16.20.0'} cpu: [x64] os: [darwin] - '@typescript/native-preview-linux-arm64@7.0.0-dev.20260422.1': - resolution: {integrity: sha512-7HL4E7kP0ociYB8R4+QuIbzfT3pjdesNY+ax/q6fP3IMd3/QNAL/qsm/NaokjXke+I7uYxKqQ8Qo/t5MSv/r+A==} + '@typescript/native-preview-linux-arm64@7.0.0-dev.20260423.1': + resolution: {integrity: sha512-ICIkJDTqmn0R4Vs811+Ht2RYTk1OCrAhHCu0JthmhR216T1Tqgi5DWRoCprp3RL1qU6fLnxxrIpEbNlNN7XFYA==} + engines: {node: '>=16.20.0'} cpu: [arm64] os: [linux] - '@typescript/native-preview-linux-arm@7.0.0-dev.20260422.1': - resolution: {integrity: sha512-EWP1Jq2I8MMSkoF9D6ztXgRmnUy2KcaZfL9FYcdm3Am6ZYuI6/SCR3HVIVYbaixAJXe/qUh5MN3LzJbl/4hefQ==} + '@typescript/native-preview-linux-arm@7.0.0-dev.20260423.1': + resolution: {integrity: sha512-CxUA15qbPQRvz2nanBpiv1h4tgXTCJJwqOtgKMSdIuPkow8dyYW3ba5oLoH/jZhS4792XislX659hlFrfiU6CQ==} + engines: {node: '>=16.20.0'} cpu: [arm] os: [linux] - '@typescript/native-preview-linux-x64@7.0.0-dev.20260422.1': - resolution: {integrity: sha512-fDqkLf2Hv7X1Cy1B5OMcljPt/+8GpnTxFM9rDCFrYAPgOolIQJ9qwkb+xGfvAtxkkE5sZIvGPcqjP9PWQHt2qw==} + '@typescript/native-preview-linux-x64@7.0.0-dev.20260423.1': + resolution: {integrity: sha512-cWLFS4R8dOU1YuUJ/2VLeGMVIjgI3GGb/f9rRY5MbWHq5l3NNZh8y1QwAOrTh3+g3q6+znArfxVnD2hZHUz8Mw==} + engines: {node: '>=16.20.0'} cpu: [x64] os: [linux] - '@typescript/native-preview-win32-arm64@7.0.0-dev.20260422.1': - resolution: {integrity: sha512-l1tDnyNQSqxFkKz683dD8EORQtcQqZyWkTDnRtHmaPg2mTRxhxSekL/HcsHx/1/DoGTfl310O+CmXzd2mTq3pQ==} + '@typescript/native-preview-win32-arm64@7.0.0-dev.20260423.1': + resolution: {integrity: sha512-OWaGUI4+dHqYZv+k6sITx9Y27FNy3XzNFk4OrOiYtBkIO/xrb9TPMP4A5XI4n5zwRLIv3xne9g039xgRbaeyoQ==} + engines: {node: '>=16.20.0'} cpu: [arm64] os: [win32] - '@typescript/native-preview-win32-x64@7.0.0-dev.20260422.1': - resolution: {integrity: sha512-VQbDQlp1bjV5nnHagQLXQAhid3S48l1OToIBjvqlw18s0V0YSgoyNL6E/rE7FBdkGrTLf/rtKjo42IZnt3tvqA==} + '@typescript/native-preview-win32-x64@7.0.0-dev.20260423.1': + resolution: {integrity: sha512-5MQjO/qdLwXpjW7Dy/1lNv7Vtpvo6bhCkbjan4PoRN5/eeyqEqDWxdf8AGE4btLmHqyIjEHRuYf7kp2tlAr6lQ==} + engines: {node: '>=16.20.0'} cpu: [x64] os: [win32] - '@typescript/native-preview@7.0.0-dev.20260422.1': - resolution: {integrity: sha512-8CR8zHFlLpSL5OXY4Wbz2DmiDOoat1JBMkydZUHwQIS4cpoTN7SHjk2BN8i51XHUy0jMF5airL0TlY3GOfZmKg==} + '@typescript/native-preview@7.0.0-dev.20260423.1': + resolution: {integrity: sha512-9WD7TJJlGvt9PQqJI/+44dVP4oqGQFIkYrpXt7nlQ0WgNIErN52x/XhxmJ4nWft06qejgPiUbPo4aYRNOmIHXg==} + engines: {node: '>=16.20.0'} hasBin: true '@typespec/ts-http-runtime@0.3.5': @@ -11121,36 +11129,36 @@ snapshots: '@types/node': 25.6.0 optional: true - '@typescript/native-preview-darwin-arm64@7.0.0-dev.20260422.1': + '@typescript/native-preview-darwin-arm64@7.0.0-dev.20260423.1': optional: true - '@typescript/native-preview-darwin-x64@7.0.0-dev.20260422.1': + '@typescript/native-preview-darwin-x64@7.0.0-dev.20260423.1': optional: true - '@typescript/native-preview-linux-arm64@7.0.0-dev.20260422.1': + '@typescript/native-preview-linux-arm64@7.0.0-dev.20260423.1': optional: true - '@typescript/native-preview-linux-arm@7.0.0-dev.20260422.1': + '@typescript/native-preview-linux-arm@7.0.0-dev.20260423.1': optional: true - '@typescript/native-preview-linux-x64@7.0.0-dev.20260422.1': + '@typescript/native-preview-linux-x64@7.0.0-dev.20260423.1': optional: true - '@typescript/native-preview-win32-arm64@7.0.0-dev.20260422.1': + '@typescript/native-preview-win32-arm64@7.0.0-dev.20260423.1': optional: true - '@typescript/native-preview-win32-x64@7.0.0-dev.20260422.1': + '@typescript/native-preview-win32-x64@7.0.0-dev.20260423.1': optional: true - '@typescript/native-preview@7.0.0-dev.20260422.1': + '@typescript/native-preview@7.0.0-dev.20260423.1': optionalDependencies: - '@typescript/native-preview-darwin-arm64': 7.0.0-dev.20260422.1 - '@typescript/native-preview-darwin-x64': 7.0.0-dev.20260422.1 - '@typescript/native-preview-linux-arm': 7.0.0-dev.20260422.1 - '@typescript/native-preview-linux-arm64': 7.0.0-dev.20260422.1 - '@typescript/native-preview-linux-x64': 7.0.0-dev.20260422.1 - '@typescript/native-preview-win32-arm64': 7.0.0-dev.20260422.1 - '@typescript/native-preview-win32-x64': 7.0.0-dev.20260422.1 + '@typescript/native-preview-darwin-arm64': 7.0.0-dev.20260423.1 + '@typescript/native-preview-darwin-x64': 7.0.0-dev.20260423.1 + '@typescript/native-preview-linux-arm': 7.0.0-dev.20260423.1 + '@typescript/native-preview-linux-arm64': 7.0.0-dev.20260423.1 + '@typescript/native-preview-linux-x64': 7.0.0-dev.20260423.1 + '@typescript/native-preview-win32-arm64': 7.0.0-dev.20260423.1 + '@typescript/native-preview-win32-x64': 7.0.0-dev.20260423.1 '@typespec/ts-http-runtime@0.3.5': dependencies: @@ -14330,7 +14338,7 @@ snapshots: glob: 7.2.3 optional: true - rolldown-plugin-dts@0.23.2(@typescript/native-preview@7.0.0-dev.20260422.1)(rolldown@1.0.0-rc.16)(typescript@6.0.3): + rolldown-plugin-dts@0.23.2(@typescript/native-preview@7.0.0-dev.20260423.1)(rolldown@1.0.0-rc.16)(typescript@6.0.3): dependencies: '@babel/generator': 8.0.0-rc.3 '@babel/helper-validator-identifier': 8.0.0-rc.3 @@ -14344,7 +14352,7 @@ snapshots: picomatch: 4.0.4 rolldown: 1.0.0-rc.16 optionalDependencies: - '@typescript/native-preview': 7.0.0-dev.20260422.1 + '@typescript/native-preview': 7.0.0-dev.20260423.1 typescript: 6.0.3 transitivePeerDependencies: - oxc-resolver @@ -14855,7 +14863,7 @@ snapshots: ts-algebra@2.0.0: {} - tsdown@0.21.9(@typescript/native-preview@7.0.0-dev.20260422.1)(typescript@6.0.3): + tsdown@0.21.9(@typescript/native-preview@7.0.0-dev.20260423.1)(typescript@6.0.3): dependencies: ansis: 4.2.0 cac: 7.0.0 @@ -14866,7 +14874,7 @@ snapshots: obug: 2.1.1 picomatch: 4.0.4 rolldown: 1.0.0-rc.16 - rolldown-plugin-dts: 0.23.2(@typescript/native-preview@7.0.0-dev.20260422.1)(rolldown@1.0.0-rc.16)(typescript@6.0.3) + rolldown-plugin-dts: 0.23.2(@typescript/native-preview@7.0.0-dev.20260423.1)(rolldown@1.0.0-rc.16)(typescript@6.0.3) semver: 7.7.4 tinyexec: 1.1.1 tinyglobby: 0.2.16 diff --git a/scripts/lib/local-heavy-check-runtime.mjs b/scripts/lib/local-heavy-check-runtime.mjs index 74d68229059..9c77180a716 100644 --- a/scripts/lib/local-heavy-check-runtime.mjs +++ b/scripts/lib/local-heavy-check-runtime.mjs @@ -46,7 +46,7 @@ export function applyLocalTsgoPolicy(args, env, hostResources) { ); } - if (shouldThrottleLocalHeavyChecks(nextEnv, hostResources)) { + if (shouldThrottleLocalHeavyChecks(nextEnv, hostResources, "auto")) { insertBeforeSeparator(nextArgs, "--singleThreaded"); insertBeforeSeparator(nextArgs, "--checkers", "1"); @@ -145,12 +145,12 @@ export function shouldAcquireLocalHeavyCheckLockForTsgo(args, env = process.env) ); } -export function shouldThrottleLocalHeavyChecks(env, hostResources) { +export function shouldThrottleLocalHeavyChecks(env, hostResources, defaultMode = "throttled") { if (!isLocalCheckEnabled(env)) { return false; } - const mode = readLocalCheckMode(env); + const mode = readLocalCheckMode(env, defaultMode); if (mode === "throttled") { return true; } @@ -298,7 +298,7 @@ function insertBeforeSeparator(args, ...items) { args.splice(insertIndex, 0, ...items); } -function readLocalCheckMode(env) { +function readLocalCheckMode(env, defaultMode) { const raw = env.OPENCLAW_LOCAL_CHECK_MODE?.trim().toLowerCase(); if (raw === "throttled" || raw === "low-memory") { return "throttled"; @@ -306,9 +306,7 @@ function readLocalCheckMode(env) { if (raw === "full" || raw === "fast") { return "full"; } - // Keep local heavy checks conservative by default. Developers can still opt - // into full-speed runs explicitly with OPENCLAW_LOCAL_CHECK_MODE=full. - return "throttled"; + return defaultMode; } function resolveHostResources(hostResources) { diff --git a/test/scripts/local-heavy-check-runtime.test.ts b/test/scripts/local-heavy-check-runtime.test.ts index 4905211cd2d..e6ec79556c1 100644 --- a/test/scripts/local-heavy-check-runtime.test.ts +++ b/test/scripts/local-heavy-check-runtime.test.ts @@ -86,7 +86,7 @@ describe("local-heavy-check-runtime", () => { expect(shortFlag.args).toEqual(["-d"]); }); - it("defaults local tsgo to throttled mode on roomy hosts", () => { + it("defaults local tsgo to full-speed mode on roomy hosts", () => { const { args, env } = applyLocalTsgoPolicy([], makeEnv(), ROOMY_HOST); expect(args).toEqual([ @@ -95,12 +95,9 @@ describe("local-heavy-check-runtime", () => { "--incremental", "--tsBuildInfoFile", ".artifacts/tsgo-cache/root.tsbuildinfo", - "--singleThreaded", - "--checkers", - "1", ]); - expect(env.GOGC).toBe("30"); - expect(env.GOMEMLIMIT).toBe("3GiB"); + expect(env.GOGC).toBeUndefined(); + expect(env.GOMEMLIMIT).toBeUndefined(); }); it("uses the configured local tsgo build info file", () => {