Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix(ci): unitShards names the signal that killed a dry-run listing

garrytanc220d5c70fd8
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a1166e1e0a..1165a71e03 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,20 @@ credits are retained; no result has been reassigned to another provider. Origina
identifiers and attribution are available in the pre-removal Git revision
`6040075c6cb95be5881cc2e1b76ef7d71f4e5d29` (retained on 2026-09-23).
+## [Unreleased]
+
+**The Heavy nightly's Codex plugin door test checks the plugin's MCP surface against `PLUGIN_SURFACE`, the surface the plugin's `mcp.json` actually serves, instead of `REGISTRATION_SURFACE`. A unit-shard listing that dies on a signal now names the signal instead of an empty error.**
+
+The plugin ships `serve --surface PLUGIN_SURFACE --source-guard`, so the door test's launcher-args check and its `tools/list` oracle compared against the wrong surface and failed every Heavy nightly (#6049).
+
+`unitShards()` in `scripts/sharding.ts` threw `scripts/test-shard.sh --dry-run-list 26 28 failed: ` with nothing after it when a plain `bun test test/scripts/unit-shard-budget.test.ts` hit Bun's 5 s default test timeout. Bun ignores bunfig's `timeout`, the 28 listings take about 5.5 s, and the timeout kills the child, so the status is null and stderr is empty. The error now reads `killed by SIGTERM`. CI was never affected: `scripts/test-shard.sh` passes `--timeout=60000`.
+
+### Itemized changes
+
+- `test/e2e/codex-plugin-install-real.serial.test.ts`: assert `PLUGIN_SURFACE`.
+- `scripts/sharding.ts`: `unitShards()` names the signal that killed a listing.
+- `test/scripts/sharding.test.ts`: a listing killed by SIGTERM reports it.
+
## [0.60.519.0] - 2026-10-30
**The unit lane now runs 28 shards instead of 22, on shard weights refreshed from the Oct 30 nightly. With the fresh weights, every one of 22 shards would be planned at 624.4 s against the 600 s per-shard budget; at 28 shards the largest is 490.6 s.**
diff --git a/scripts/sharding.ts b/scripts/sharding.ts
index bd285da7cb..290c406293 100644
--- a/scripts/sharding.ts
+++ b/scripts/sharding.ts
@@ -73,7 +73,7 @@ export const UNIT_SHARD_BUDGET_MS = (UNIT_JOB_TIMEOUT_MS - UNIT_SETUP_ALLOWANCE_
export function unitShards(root: string, n: number = UNIT_SHARDS): string[][] {
return Array.from({ length: n }, (_, i) => {
const r = spawnSync("bash", [join(root, "scripts/test-shard.sh"), "--dry-run-list", String(i + 1), String(n)], { cwd: root, encoding: "utf8" });
- if (r.status !== 0) throw new Error(`scripts/test-shard.sh --dry-run-list ${i + 1} ${n} failed: ${r.stderr}`);
+ if (r.status !== 0) throw new Error(`scripts/test-shard.sh --dry-run-list ${i + 1} ${n} ${r.signal ? `killed by ${r.signal}` : "failed"}: ${r.stderr}`);
return r.stdout.split("\n").filter(Boolean);
});
}
diff --git a/test/scripts/sharding.test.ts b/test/scripts/sharding.test.ts
index 7eb4b7741c..98799b65c5 100644
--- a/test/scripts/sharding.test.ts
+++ b/test/scripts/sharding.test.ts
@@ -13,10 +13,11 @@ import {
loadWeights,
partition,
predictedWeight,
+ unitShards,
WeightsLoadError,
type WeightMap,
} from "../../scripts/sharding.ts";
-import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
+import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
@@ -393,3 +394,16 @@ describe("predictedWeight / --sum", () => {
}
});
});
+
+describe("unitShards", () => {
+ it("names the signal when scripts/test-shard.sh is killed, as a bun test timeout does", () => {
+ const root = mkdtempSync(join(tmpdir(), "unit-shards-test-"));
+ try {
+ mkdirSync(join(root, "scripts"));
+ writeFileSync(join(root, "scripts", "test-shard.sh"), "kill -TERM $$\n");
+ expect(() => unitShards(root, 1)).toThrow("scripts/test-shard.sh --dry-run-list 1 1 killed by SIGTERM: ");
+ } finally {
+ rmSync(root, { recursive: true, force: true });
+ }
+ });
+});