Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

CI: cache the incremental typecheck tsbuildinfo in the Linux and macOS verify jobs; the macOS verify pool runs two workers (#6056)

garrytan16ec6f2b93a0
diff --git a/.github/workflows/macos-validation.yml b/.github/workflows/macos-validation.yml
index 9f0eaf5dc5..5c410297b1 100644
--- a/.github/workflows/macos-validation.yml
+++ b/.github/workflows/macos-validation.yml
@@ -49,6 +49,16 @@ jobs:
with:
bun-version: 1.4.2
- run: bun install --frozen-lockfile --ignore-scripts
+ # #6056: the verify step's typecheck ran cold on every nightly and was
+ # killed at the 240 s cap. Restore the incremental tsbuildinfo from the
+ # newest earlier run with the same bun.lock + tsconfig.json (rolling
+ # key, saved under this run's SHA); same shape as test.yml's verify job.
+ - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
+ with:
+ path: node_modules/.cache/gbrain-typecheck.tsbuildinfo
+ key: tsbuildinfo-${{ runner.os }}-${{ hashFiles('bun.lock', 'tsconfig.json') }}-${{ github.sha }}
+ restore-keys: |
+ tsbuildinfo-${{ runner.os }}-${{ hashFiles('bun.lock', 'tsconfig.json') }}-
- name: Runner identity
run: |
sw_vers
@@ -97,8 +107,13 @@ jobs:
# runner (121-167 s inside verify), past the 120 s per-check cap that
# Linux keeps. Typecheck runs here too, so this runner's cap is 240 s
# (about 1.4x the slowest measured run); test.yml's Linux verify job
- # keeps the default 120 s.
+ # keeps the default 120 s. The cap is not raised further: the
+ # tsbuildinfo cache above makes the usual run incremental, and two
+ # workers (typecheck heads the CHECKS list, so it gets a core to
+ # itself with one other check beside it instead of sharing three
+ # cores with the whole pool) keep a cold run under it.
GBRAIN_VERIFY_TIMEOUT: '240'
+ GBRAIN_VERIFY_MAX_PARALLEL: '2'
# tsc peaks near 3.5 GB of heap; the typecheck script sets its own
# --max-old-space-size, so no NODE_OPTIONS here (it reached every node
# process verify spawns).
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 79f94d204a..42d29e3bd4 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -318,6 +318,19 @@ jobs:
test/fixtures/pglite-snapshot.version
key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/facts/fts-index.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/questions/schema.ts', 'src/core/questions/identity.ts', 'src/core/questions/auto-think-migration.ts', 'src/core/loops/loops-schema.ts', 'src/core/postgres-engine/schema-lock-timeout.ts') }}
- run: bun install --frozen-lockfile
+ # #6056: typecheck is the slowest verify check and ran cold on every
+ # job. `bun run typecheck` is incremental against this tsbuildinfo, so
+ # a restored one from an earlier run lets tsc recheck only what changed.
+ # Rolling key: every run saves under its own SHA and the next run
+ # restores the newest one for the same bun.lock + tsconfig.json
+ # (a dependency or compiler-option change starts cold). After
+ # `bun install`, which (re)creates node_modules.
+ - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
+ with:
+ path: node_modules/.cache/gbrain-typecheck.tsbuildinfo
+ key: tsbuildinfo-${{ runner.os }}-${{ hashFiles('bun.lock', 'tsconfig.json') }}-${{ github.sha }}
+ restore-keys: |
+ tsbuildinfo-${{ runner.os }}-${{ hashFiles('bun.lock', 'tsconfig.json') }}-
# check:schema-migration-order compares new schema migrations with
# origin/master's latest version; a depth-1 fetch of the ref is enough.
- run: git fetch --no-tags --depth=1 origin +refs/heads/master:refs/remotes/origin/master