# ci-triage-minimax-run ## Quick reference ``` ci-triage-minimax-run --repo --run [--job ] [--out ] [--tail 2000] [--max-turns 25] [--timeout 300] [--dryrun|-n] ``` Exit: 0 triage written · 1 usage/gac-usage · 2 gac auth-API-notfound / MiniMax failed / timeout · 3 gate failure. Spec: `small-scripts/specs/ci-triage-minimax-run.spec.md`. ## How it works Fetches `gac inspect --run --logs --json --tail ` (token discovery entirely inside gac) into a scratch dir; redacts credential patterns in place; extracts `failed_step`/`sliced` from the NDJSON envelope to steer the prompt (null → contract demands literal `UNKNOWN`); runs the same locked-down `ask-minimax-run` shape as review-minimax-run (no Bash/Edit, Write for the triage file only); gates on `## Failing step` present + non-blank `## Probable cause`; retry-once semantics, rc 124 never retried. The gac fetch happens once and is reused across both attempts. Test seams: `CI_TRIAGE_FAKE_LOGS` (bypass gac), `CI_TRIAGE_FAKE_JSON` (canned envelope), `CI_TRIAGE_FAKE_TRIAGE` (plays the Write) — `tests/test-ci-triage-minimax-run.sh` covers exits 0/1/2/3 and the null-failed_step path offline. ## Gotchas - gac exit mapping is deliberate: 2→1 (fix invocation), 3→2 (transient-capable — auth, API, run-not-found) so callers retry/fall back instead of giving up. - Redaction is sed-in-place on the NDJSON; patterns stop at quotes/whitespace so the JSON stays parseable. - Dryrun runs *before* any fetch — it shows the gac command it would run, with a `` placeholder. - gac v0.0.2.10 does NOT auto-discover the secrets-path token (despite the root CLAUDE.md description); the wrapper exports `GITEA_TOKEN_FILE=~/dev/claude/secrets/gitea/ai_admin/token` (path only) when no token env is set. Note the secret is `ai_admin/token`, a file inside a directory — pointing GITEA_TOKEN_FILE at the directory errors.