Skip to content

Report delegated runner outages as infrastructure failures - #1752

Draft
eowca wants to merge 1 commit into
mainfrom
lean178/1179-runner-infrastructure-exit
Draft

eowca wants to merge 1 commit into
mainfrom
lean178/1179-runner-infrastructure-exit

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Report delegated runner outages as infrastructure failures

Context and goal

  • Goal: Return the retryable infrastructure exit when the delegated check runner is unavailable.
  • Problem: Runner process exits and timeouts currently look like failed stages and can replace the previous receipt.
  • Context: Keep the distinction between a failed runner and a validated frame reporting a failed stage. Keep local fallback restricted to a validated not-started frame.

Closes #1179

Acceptance

  • Process exit 75, exit 124, termination by signal, and an actual runner timeout return exit 2 with a retryable diagnostic.
  • A prior receipt is preserved and no failed stage is published for an outage.
  • A validated failed stage and a validated not-started frame preserve their existing behavior.
  • Describe the distinction in the architecture guide.

Base

Base: aa563c2

Notes

Carries the reviewed distinction from #1422. Keep delegated receipt checkpoints in memory until the outcome is known so an outage preserves disk state.

Validation

(no loopzero check run recorded)


Run Proof
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Review

  • primary, claude, 4f29f74, approve

Co-Authored-By: Codex <noreply@openai.com>

@loopzero-feder-positronics loopzero-feder-positronics Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loopzero primary review by claude on 4f29f74f756483ac3d88b1ebc073e858c11456bd, 50.8s: approve (0 critical, 0 important, 2 suggestion)

Settings per native call (launch configuration and CLI claims, not backend attestation):

  • Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)

Native Claude output is retained in the restricted local review receipt.

Comment thread src/loopzero/sandbox.py
@@ -641,8 +658,9 @@ def _dispatch_one(
return CheckResult(command, frame["exit_code"], frame["duration_s"],
_check_tail(frame["tail"]))
except _proc.ProcTimeout as exc:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Git probe timeouts are reported as runner timeouts

The except _proc.ProcTimeout handler wraps the whole _dispatch_one body, so it also catches more than the runner's own timeout. It catches a timeout from the _git calls in _stage_unchanged at lines 622, 646 and 651. It also catches a timeout from the _git calls inside the nested local-fallback run_checks (lines 96–105 and 158–159). All of these are bounded by GIT_TIMEOUT, not the stage timeout. Each one now raises SandboxUnavailable("Stage runner timed out after {timeout:g}s ..."), which names the wrong component and the wrong limit, for example "timed out after 3600s (60.00s elapsed)". The task scopes this path to an actual runner timeout. Exit 2 is still reasonable for a git timeout, so the misleading diagnostic is the only defect. The same overly broad catch existed before this change, but this change makes it user-facing as an infrastructure outage. Smallest fix: wrap only the _proc.run(argv, ...) call at line 639 in try/except _proc.ProcTimeout. Let any other ProcTimeout propagate, or convert it to SandboxUnavailable with a git-specific message.

Comment thread tests/test_cli.py


@pytest.mark.parametrize("prior_receipt", [False, True])
def test_check_runner_outage_preserves_receipt(wt, gh, monkeypatch, capsys, prior_receipt):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: CLI test does not cover a validated failed stage keeping its receipt and publish behaviour

The new CLI test checks only the outage path, with exit 75. The acceptance criteria also require that a validated failed-stage frame keeps its existing behaviour: it writes the receipt and reports FAIL. That path now runs through _defer_runner_checkpoint, which drops pending checkpoints on normal return and relies on cmd_check saving the final report. Nothing at the CLI level checks this. To guard against a regression, add one parametrized case where the runner returns a valid frame with exit_code=7. Assert that the command exits 1, the receipt is rewritten and contains the failed stage, and stdout shows FAIL.

@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

waits for test headroom after #1663

This branch has not been deployed

No deployments
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.

Report delegated runner outages as infrastructure failures

1 participant