Skip to content

fix: report a failed step ahead of the harness to the outage tracker - #1749

Merged
max-sixty merged 3 commits into
mainfrom
fix/report-setup-runtime-failure
Nov 27, 2026
Merged

max-sixty merged 3 commits into
mainfrom
fix/report-setup-runtime-failure

Conversation

@tend-agent

@tend-agent tend-agent commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

When a step ahead of the harness action fails, such as setup-runtime, checkout or a consumer setup: step, the run now files a tend-outage row that names the failed step. Before this, the failure skipped the harness and its Report failure step along with it, and nothing was recorded. This restores #857's guarantee, which #1608 lost when setup-runtime became its own step.

  • New action, max-sixty/tend/report-failure (report-failure/action.yaml). It runs the existing report_failure module from the action's own source as /usr/bin/python3 -I report-failure/report.py. That needs no uv and no installed runtime, so it still works when setup-runtime is the step that failed. report_failure and its imports were already stdlib-only apart from tend.workflows.release, which this moves into a new stdlib-only module, tend/releases.py.
  • Generator: every harness step now gets id: harness and is followed by report-failure with if: failure() && steps.harness.outcome == 'skipped'. A harness that ran and failed still reports through its own step, so the security-preflight exclusion holds and the run gets no second row.
  • Naming the step: with name_failed_step=True, the reporter reads runs/{id}/attempts/{n}/jobs, takes the in-progress job whose runner_name matches RUNNER_NAME (matrix siblings share the run id), and adds Failed before the harness action ran, at `<step>`. below the row. That read is best-effort: if it fails, the row is still filed. I checked against this session's own run that the jobs API reports completed step conclusions while the job is still running.

Tests: the full Python suite passes, apart from the two test_refresh_consumers tests that need DNS. New tests cover the generated step's placement and condition for both harnesses, the step-naming read (including a matrix sibling and an earlier job on the same runner), a failed jobs read that still files the row, and a probe that the standalone entry point imports no third-party module. Pre-commit is clean. Regtest snapshots are regenerated.

What this doesn't cover: jobs with no harness step, such as mention's verify and triage's select. If setup-runtime fails there, the agent job that depends on it is skipped, and nothing is reported. The new step also makes a red notifications pre-check file a row on each failing poll, as the request asked for any step ahead of the agent.

Closes #1663

A failed setup-runtime (or checkout, or setup: step) skips the harness
action and its Report failure step, so the run went red with no
tend-outage row. Generated agent jobs now follow the harness with
max-sixty/tend/report-failure, gated on the harness being skipped by a
failure. It runs report_failure from the action's own source under
/usr/bin/python3 -I, so it needs no installed runtime, and names the
job's failed step from the jobs API.

Closes #1663

@tend-agent tend-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The standalone reporter still fails before it files any row on an ubuntu-22.04 runner. That runner's /usr/bin/python3 is 3.10. report_failure.main() calls _issue.row() first, and row() stamps the time through _common.utcnow(), which returns datetime.datetime.now(datetime.UTC). datetime.UTC only exists from Python 3.11 on, so the step raises AttributeError and the failure it was supposed to report goes unrecorded. Generated jobs default to ubuntu-24.04 (3.12), but runs-on: ubuntu-22.04-large is the job override example in AGENTS.md, so consumers can land on 3.10. test_the_standalone_entry_point_needs_no_installed_runtime doesn't catch this because it probes third-party imports under the test interpreter, not the stdlib surface of an older Python.

datetime.timezone.utc has the same meaning and works on 3.10. That line is outside this diff, so I'm pushing it as a follow-up commit.

report-failure runs the reporter under the runner's system Python, which is
3.10 on ubuntu-22.04, where datetime.UTC does not exist.
@max-sixty
max-sixty merged commit 0fd1e99 into main Nov 27, 2026
12 checks passed
@max-sixty
max-sixty deleted the fix/report-setup-runtime-failure branch November 27, 2026 20:38
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.

A failed setup-runtime step skips the claude action's Report failure, so the outage goes unrecorded

2 participants