Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(ci): bound tinymold subprocess calls with timeouts

Steven Enamakel184b5c44fd9e
diff --git a/scripts/ci/self-hosted/lanes-plan.mjs b/scripts/ci/self-hosted/lanes-plan.mjs
index 5d91f87051..40a04ac38b 100644
--- a/scripts/ci/self-hosted/lanes-plan.mjs
+++ b/scripts/ci/self-hosted/lanes-plan.mjs
@@ -208,7 +208,11 @@ export function buildPlan({
{
name: "static",
checks: [
- { name: "rust-fmt", when: rust, run: "cargo fmt --manifest-path Cargo.toml --package openhuman --package openhuman-cli --package openhuman-embed --package openhuman-modules-linked --package openhuman-rpc --package openhuman-tinyhumans --package openhuman-tui -- --check" },
+ {
+ name: "rust-fmt",
+ when: rust,
+ run: "cargo fmt --manifest-path Cargo.toml --package openhuman --package openhuman-cli --package openhuman-embed --package openhuman-modules-linked --package openhuman-rpc --package openhuman-tinyhumans --package openhuman-tui -- --check",
+ },
{
name: "rust-layout",
when: core,
diff --git a/scripts/ci/self-hosted/lanes.mjs b/scripts/ci/self-hosted/lanes.mjs
index 5711ba85ec..f9e78ec5ab 100644
--- a/scripts/ci/self-hosted/lanes.mjs
+++ b/scripts/ci/self-hosted/lanes.mjs
@@ -256,8 +256,15 @@ export function tinymoldOnPath(run = spawnSync) {
* Run a tinymold subcommand and capture its output. Never throws: the cache
* is an accelerator, so its failures are reported, not fatal.
*/
-export function runTinymold(args, { run = spawnSync, env = process.env } = {}) {
- const r = run("tinymold", args, { encoding: "utf8", env });
+export function runTinymold(
+ args,
+ { run = spawnSync, env = process.env, timeoutMs = 60_000 } = {},
+) {
+ const r = run("tinymold", args, {
+ encoding: "utf8",
+ env,
+ timeout: timeoutMs,
+ });
const output = `${r.stdout ?? ""}${r.stderr ?? ""}`.trim();
return {
ok: !r.error && r.status === 0,
@@ -272,10 +279,17 @@ export function runTinymold(args, { run = spawnSync, env = process.env } = {}) {
* sound as a passing one's) and read the wrapper log's stats. A failed push
* never fails the job; the summary step turns it into a warning.
*/
-export function finishTinymold({ log, since, run = spawnSync, env = process.env }) {
+export function finishTinymold({
+ log,
+ since,
+ run = spawnSync,
+ env = process.env,
+}) {
+ // Bounded: an unreachable server must not hold the job to its timeout.
const push = runTinymold(["remote", "push", "--since", String(since)], {
run,
env,
+ timeoutMs: 10 * 60_000,
});
const stats = runTinymold(["stats", "--log", log], { run, env });
return { log, push, stats: stats.ok ? stats.output : null };