Skip to content

Commit 9ff9aac

Browse files
authored
fix(ci): isolate built TUI PTY fixture (#119339)
Run the built local TUI PTY lane after the other artifact checks so its real Gateway fixture has exclusive process and event-loop capacity. Punchcard-Session: cobalt-brook-meadow-m9
1 parent fb81d03 commit 9ff9aac

3 files changed

Lines changed: 28 additions & 13 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,15 +1276,6 @@ jobs:
12761276
node scripts/run-vitest.mjs run --config test/vitest/vitest.full-core-support-boundary.config.ts
12771277
fi
12781278
1279-
if [ "$RUN_TUI_PTY" = "true" ]; then
1280-
start_check "tui-pty" env \
1281-
NODE_OPTIONS=--max-old-space-size=8192 \
1282-
OPENCLAW_TUI_PTY_INCLUDE_LOCAL=1 \
1283-
OPENCLAW_TUI_PTY_USE_BUILT_CLI=1 \
1284-
OPENCLAW_VITEST_MAX_WORKERS=2 \
1285-
node scripts/run-vitest.mjs run --config test/vitest/vitest.tui-pty.config.ts
1286-
fi
1287-
12881279
if [ "$RUN_GATEWAY_WATCH" = "true" ] && [ "$PARALLEL_GATEWAY_WATCH" = "true" ]; then
12891280
start_check "gateway-watch" \
12901281
node scripts/check-gateway-watch-regression.mjs --skip-build
@@ -1300,6 +1291,18 @@ jobs:
13001291
wait_checks
13011292
fi
13021293
1294+
# The built local TUI lane owns a real Gateway fixture. Keep it
1295+
# exclusive so sibling artifact shards cannot starve its requests.
1296+
if [ "$RUN_TUI_PTY" = "true" ]; then
1297+
start_check "tui-pty" env \
1298+
NODE_OPTIONS=--max-old-space-size=8192 \
1299+
OPENCLAW_TUI_PTY_INCLUDE_LOCAL=1 \
1300+
OPENCLAW_TUI_PTY_USE_BUILT_CLI=1 \
1301+
OPENCLAW_VITEST_MAX_WORKERS=2 \
1302+
node scripts/run-vitest.mjs run --config test/vitest/vitest.tui-pty.config.ts
1303+
wait_checks
1304+
fi
1305+
13031306
for name in channels core-support-boundary gateway-watch tui-pty; do
13041307
echo "${name}-result=${results[$name]}" >> "$GITHUB_OUTPUT"
13051308
done

‎docs/ci.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Separate iOS and macOS Periphery workflows enforce a zero-findings dead-code pol
101101
- **CI workflow edits** validate the Node CI graph, workflow linting, and the Windows lane (`ci.yml` executes it), but do not force iOS, Android, or macOS native builds by themselves; those platform lanes stay scoped to platform source changes.
102102
- **Workflow Sanity** runs `actionlint`, `zizmor` over all workflow YAML files, the composite-action interpolation guard, and the conflict-marker guard. The PR-scoped `security-fast` job also runs `zizmor` over changed workflow files so workflow security findings fail early in the main CI graph.
103103
- **Docs on `main` pushes** are checked by the standalone `Docs` workflow with the same ClawHub docs mirror used by CI, so mixed code+docs pushes do not also queue the CI `check-docs` shard. Pull requests and manual CI still run `check-docs` from CI when docs changed.
104-
- **TUI PTY** splits by runtime ownership. The Linux Node shard runs the deterministic source-level `TuiBackend` fixture lane. The `build-artifacts` job reruns `test/vitest/vitest.tui-pty.config.ts` with `OPENCLAW_TUI_PTY_INCLUDE_LOCAL=1` and `OPENCLAW_TUI_PTY_USE_BUILT_CLI=1`, so the slower `tui --local` smoke exercises the exact-head built CLI while mocking only the external model endpoint.
104+
- **TUI PTY** splits by runtime ownership. The Linux Node shard runs the deterministic source-level `TuiBackend` fixture lane. The `build-artifacts` job reruns `test/vitest/vitest.tui-pty.config.ts` with `OPENCLAW_TUI_PTY_INCLUDE_LOCAL=1` and `OPENCLAW_TUI_PTY_USE_BUILT_CLI=1`, so the slower `tui --local` smoke exercises the exact-head built CLI while mocking only the external model endpoint. That built local lane runs after the other artifact checks because it owns a real Gateway fixture whose request deadlines must not compete with sibling shards.
105105
- **CI routing-only edits, the small set of core-test fixtures the fast task runs directly, and narrow plugin contract helper edits** use a fast Node-only manifest path: `preflight`, `security-fast`, and only the fast lanes the change touches — a single `checks-fast-core` CI-routing task, the two plugin contract shards, or both. That path skips build artifacts, Node 22 compatibility, channel contracts, full core shards, bundled-plugin shards, and additional guard matrices.
106106
- **Windows Node checks** are scoped to Windows-specific process/path wrappers, npm/pnpm/UI runner helpers, package manager config, and the CI workflow surfaces that execute that lane; unrelated source, plugin, install-smoke, and test-only changes stay on the Linux Node lanes.
107107

@@ -121,7 +121,7 @@ The slowest Node test families are split or balanced so each job stays small wit
121121
- The build-artifact job also persists content-fingerprinted `build-all` step outputs. CI's self-built plugin SDK declarations hash the complete repository-owned TypeScript/JSON source graph, exclude installed and generated directories, and restore both flat declarations and package bridges after `tsdown` clears `dist`. Documentation, workflow, plugin, and other changes outside that graph can reuse the declaration snapshot; source changes rebuild it before the export gate runs.
122122
- Full declaration builds split `tsdown` into AI, workspace-package, and unified groups. Each group caches declarations only, then still rebuilds runtime JavaScript before restoring those declarations. Core or plugin changes therefore invalidate only the large unified graph, while workspace-package changes conservatively invalidate every dependent declaration group. Public full builds generally use an immutable Actions cache; coarse restore keys seed partial changes, per-group content fingerprints reject stale data, and GitHub's cache quota evicts old generations. The weekly Node 22 lane instead publishes a 14-day artifact after successful `main` runs and restores only artifacts whose immutable producer identity resolves to that workflow on `main`, avoiding quota churn without allowing PR code to write a shared cache. Private-QA declarations are never persisted in Actions caches because cache namespaces are not confidentiality boundaries.
123123
- `check-additional-*` stripes the supplemental boundary guard list (`scripts/run-additional-boundary-checks.mjs`) into one prompt-heavy shard (`check-additional-boundaries-a`, which includes the Codex prompt snapshot drift check) and one combined shard for the remaining stripes (`check-additional-boundaries-bcd`), each running independent guards concurrently and printing per-check timings. Package-boundary compile/canary work stays together, and runtime topology architecture runs separately from the gateway watch coverage embedded in `build-artifacts`.
124-
- On the 32-vCPU self-hosted build runner, Gateway watch, channel tests, and the core support-boundary shard start together inside `build-artifacts` after `dist/` and `dist-runtime/` are already built. GitHub-hosted fallback runs keep Gateway watch serial so low-core contention cannot consume its readiness deadline.
124+
- On the 32-vCPU self-hosted build runner, Gateway watch, channel tests, and the core support-boundary shard start together inside `build-artifacts` after `dist/` and `dist-runtime/` are already built. GitHub-hosted fallback runs keep Gateway watch serial so low-core contention cannot consume its readiness deadline. Both paths then run built local TUI PTY alone so its real Gateway fixture has exclusive process and event-loop capacity.
125125

126126
Once admitted, canonical Linux CI permits up to 28 concurrent Node test jobs and
127127
12 for the smaller fast/check lanes; Windows and Android stay at two because

‎test/scripts/ci-workflow-guards.test.ts‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4778,7 +4778,7 @@ printf '%s\n' "\${CURL_SUCCESS_IP:-203.0.113.7}"
47784778
expect(saveStep.with.key).toContain("dist-build-v2-");
47794779
});
47804780

4781-
it("parallelizes gateway watch only on the large self-hosted build runner", () => {
4781+
it("parallelizes gateway watch only on the large self-hosted runner and isolates TUI PTY", () => {
47824782
const workflow = readCiWorkflow();
47834783
const buildArtifactSteps = workflow.jobs["build-artifacts"].steps;
47844784
const builtArtifactChecks = buildArtifactSteps.find(
@@ -4798,8 +4798,20 @@ printf '%s\n' "\${CURL_SUCCESS_IP:-203.0.113.7}"
47984798
expect(run).toContain(
47994799
'if [ "$RUN_GATEWAY_WATCH" = "true" ] && [ "$PARALLEL_GATEWAY_WATCH" != "true" ]; then',
48004800
);
4801+
const firstWait = run.indexOf("\nwait_checks\n");
4802+
const hostedGatewayWatch = run.indexOf(
4803+
'if [ "$RUN_GATEWAY_WATCH" = "true" ] && [ "$PARALLEL_GATEWAY_WATCH" != "true" ]; then',
4804+
);
4805+
const tuiPty = run.indexOf('if [ "$RUN_TUI_PTY" = "true" ]; then');
4806+
const hostedGatewayWait = run.indexOf("\n wait_checks\n", hostedGatewayWatch);
4807+
const tuiPtyWait = run.indexOf("\n wait_checks\n", tuiPty);
4808+
expect(firstWait).toBeGreaterThan(run.indexOf('start_check "core-support-boundary"'));
4809+
expect(hostedGatewayWatch).toBeGreaterThan(firstWait);
4810+
expect(hostedGatewayWait).toBeGreaterThan(hostedGatewayWatch);
4811+
expect(tuiPty).toBeGreaterThan(hostedGatewayWait);
4812+
expect(tuiPtyWait).toBeGreaterThan(tuiPty);
48014813
expect(run).toContain("wait_checks()");
4802-
expect(run.match(/wait_checks$/gmu)).toHaveLength(2);
4814+
expect(run.match(/wait_checks$/gmu)).toHaveLength(3);
48034815
});
48044816

48054817
it("keeps docs i18n CI on the workflow-owned patched Go toolchain", () => {

0 commit comments

Comments
 (0)