Skip to content

github_auth_probe classifies a missing GH_TOKEN as unreachable, so an unset token still buys Co-Ordinator cycles indefinitely

Id: TD-PPagop-26082306 · Status: resolved · Filed: 2026-08-23 · Resolved: 2026-08-25 · Ref: https://github.com/Poetic-Poems/agent-ops/pull/797

Noticed while approving PR #699 (requirement 2.0b, agent-ops#691).

github_auth_probe (lib/github-limit.sh) classifies a credential fault only when GitHub itself answers HTTP 401: the grep is HTTP 401|Bad credentials over gh’s stderr. When GH_TOKEN is unset or empty, gh api rate_limit fails locally before any request is made, with a ‘no authentication token / gh auth login’ message that matches neither pattern — so the probe reports unreachable, requirement 2.0b falls through, and the cycle proceeds to a full Co-Ordinator engagement whose every claim then fails with cause ‘unreachable’, exactly the indefinite ~$0.21/cycle burn issue #691 was filed about, in a different failure mode of the same fault (token deleted or dropped from the environment rather than expired).

Where: github_auth_probe in lib/github-limit.sh (the stderr classification), and requirement 2.0b in docs/IMPLEMENTATION-PIPELINE-SPEC.md, whose ‘permanent, never self-heals’ rationale applies equally to an absent token.

Suggested fix: extend the probe’s classification to recognise gh’s own no-credentials errors (e.g. matching ‘authentication token’ / ‘gh auth login’ in stderr, or checking GH_TOKEN/GITHUB_TOKEN emptiness before calling gh) and report them as unauthorized — with the detail naming ‘no token present’ rather than ‘HTTP 401’ so the stand-down reason and escalation body stay accurate — plus a unit case in test/github-limit.test.sh alongside the existing three modes. The wiring in agent-cycle.sh needs no change; only the classification does.

Noticed while the Approver was judging https://github.com/Poetic-Poems/agent-ops/pull/699.