Four memory docs (2 skills, 2 wrapper scripts) + MEMORY.md index lines; ask-minimax-usage.md gains both delegation targets. Records the gac v0.0.2.10 token-discovery gap (needs GITEA_TOKEN_FILE pointed at ai_admin/token; the wrapper defaults it). Claude-Session: https://claude.ai/code/session_01Ku87DDWwbJkTx6SuV3sQDc
1.9 KiB
ci-triage-minimax-run
Quick reference
ci-triage-minimax-run --repo <owner/repo> --run <N> [--job <name|id>]
[--out <file>] [--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 <repo> --run <N> --logs --json --tail <n> (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
<run-logs not fetched in dryrun>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 isai_admin/token, a file inside a directory — pointing GITEA_TOKEN_FILE at the directory errors.