Skip to main content

GitHub Action

thaghr/thaghr-action wraps pip install thaghr and thaghr run so you don't write the shell yourself. It fails the build when --fail-under isn't met.

Usage

- uses: thaghr/thaghr-action@v1
with:
example: examples/01-hello-agent
trials: 20
fault-rate: 0.2
fail-under: 0.8

Inputs

InputRequiredDefaultDescription
exampleyesPath to a directory containing agent.py
trialsno10Number of trials to run
fault-rateno0.2Probability an HTTP 429 fires per call, 0 disables fault injection
seedno0RNG seed
max-costno1.0Hard cost cap in USD
kno1k for the pass^k headline metric
fail-undernoFail the build if the primary metric is below this threshold. Omit to run informationally without gating.
thaghr-versionnolatestPin to a specific thaghr release, e.g. 0.1.1

Outputs

OutputDescription
results-csvPath to the CSV file of per-trial results

Example: gate pull requests, not main

A common pattern: run thaghr on every PR so a reliability regression blocks the merge, without re-running (and re-spending API budget on) every push to main:

name: Agent reliability
on: [pull_request]
jobs:
thaghr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: thaghr/thaghr-action@v1
with:
example: examples/01-hello-agent
trials: 30
fail-under: 0.85

Pinning a version

By default the Action installs whatever's latest on PyPI. If you want reproducible CI runs that don't change behavior out from under you on a new thaghr release, pin it:

- uses: thaghr/thaghr-action@v1
with:
example: examples/01-hello-agent
thaghr-version: "0.1.1"
fail-under: 0.8