Skip to content

feat: let matrix Jobs set PER_RUN_TIMEOUT_SEC - #143

Merged
cboettig merged 1 commit into
mainfrom
feat/per-run-timeout-passthrough
Sep 10, 2026
Merged

cboettig merged 1 commit into
mainfrom
feat/per-run-timeout-passthrough

Conversation

@cboettig

@cboettig cboettig commented Sep 9, 2026

Copy link
Copy Markdown
Member

Problem

PER_RUN_TIMEOUT_SEC has existed in headless/run_matrix.sh (default 900) for a
while, but run-matrix-k8s.sh never passed it into the Job: it was missing from
both the export list and the envsubst allowlist. A caller doing

PER_RUN_TIMEOUT_SEC=1800 ./headless/run-matrix-k8s.sh boettiger-lab/ca-30x30

silently got 900s. There is no error — the only symptom is run-timeout=900s/960s
in the Job log, which is easy to miss until several hours of cells have been
clipped.

Fix

Thread it through the export list, the envsubst allowlist, and the Job
template's env block. The 900s default is unchanged, so this is a no-op for every
existing caller.

Scope note — two different timeout chains

This is the per-cell cap. One cell is a whole agent session (many LLM calls),
not a single call. The per-call ceilings — UPSTREAM_TIMEOUT_SECONDS, the
ingress.yaml timeouts, --llm-timeout, all 1200s — are a separate chain and are
untouched here, so raising this does not require moving them in step (#136 applies
to that chain, not this knob).

Motivation

A full-tier qwen (DSE-nimbus) benchmark: 9 of 45 cells hit exactly 900s, while
completed cells had a median of 408s, p90 684s, and a max of 891s — three finished
within 9s of the cap. The distribution was being clipped, not converging.
Per-call latency over the same run peaked at 405s against the 1200s budget, so the
per-call chain has ample headroom and only the cell cap needed raising.

Test

  • bash -n headless/run-matrix-k8s.sh passes.
  • Rendered the template through envsubst with PER_RUN_TIMEOUT_SEC=1800 and
    confirmed both value: "1800" in the env block and
    PER_RUN_TIMEOUT_SEC="1800" on the run_matrix.sh invocation.
  • The in-pod run_matrix.sh already honors the variable, so no change is needed
    on that side.

The per-cell timeout was hardcoded at its 900s default for any run launched
through run-matrix-k8s.sh: PER_RUN_TIMEOUT_SEC was missing from both the export
list and the envsubst allowlist, so a caller setting it got 900 anyway, with no
error — the only symptom was 'run-timeout=900s' in the Job log.

Thread it through the export list, the envsubst allowlist and the Job template's
env block, keeping the 900s default.

This is the per-cell cap (a whole agent session, many LLM calls). The per-call
ceilings -- UPSTREAM_TIMEOUT_SECONDS, the ingress timeouts, --llm-timeout, all
1200s -- are a separate chain, unaffected by this.
@cboettig
cboettig merged commit ef7707d into main Sep 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant