Skip to content

config: switch tend's own harness back to claude - #556

Merged
max-sixty merged 1 commit into
mainfrom
codex-token
May 17, 2026
Merged

max-sixty merged 1 commit into
mainfrom
codex-token

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Switches tend's own CI harness from Codex back to Claude.

Codex subscription auth (CODEX_AUTH_JSON) cannot work as a static CI secret. OpenAI's ChatGPT auth uses single-use, rotating refresh tokens: the first run's token refresh mints a new refresh token and invalidates the one baked into the secret, so every subsequent run fails with refresh_token_reused / token_invalidated 401s (observed across recent tend-notifications, tend-mention, and review-reviewers runs). The nightly codex-auth-refresh.yaml workaround loses the race under concurrent tend-* workflows and so doesn't hold the secret valid.

This flips harness: codex → claude in .config/tend.yaml and regenerates the eight tend-* workflows via uvx tend@latest init. The action ref tracks the latest published release (max-sixty/[email protected]); the prior committed workflows were a release behind, which widens the diff slightly beyond the harness flip. CLAUDE_CODE_OAUTH_TOKEN is already present in repo secrets, so auth works on merge.

The CODEX_AUTH_JSON secret, the secrets.allowed block, and codex-auth-refresh.yaml are intentionally left in place pending a real fix — likely cutting the Codex action over to a static OPENAI_API_KEY, which doesn't rotate.

Codex subscription auth (CODEX_AUTH_JSON) does not survive unattended CI.
OpenAI's ChatGPT auth uses single-use rotating refresh tokens: the first
run's token refresh invalidates the refresh token baked into the static
secret, so every subsequent run fails with `refresh_token_reused` /
`token_invalidated` 401s. The nightly codex-auth-refresh.yaml workaround
loses the race under concurrent tend-* workflows.

Flip harness: codex -> claude and regenerate the eight tend-* workflows
via `uvx tend@latest init` (action ref tracks the latest release, 0.0.24).
CLAUDE_CODE_OAUTH_TOKEN is already present in repo secrets. The
CODEX_AUTH_JSON secret, secrets.allowed block, and codex-auth-refresh.yaml
are left in place pending a real fix (likely cutting over to a static
OPENAI_API_KEY).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit b092dcd into main May 17, 2026
3 of 4 checks passed
@max-sixty
max-sixty deleted the codex-token branch May 17, 2026 20:53
max-sixty added a commit that referenced this pull request May 17, 2026
…resh to reference (#557)

Follows #556, which switched tend's own harness back to Claude but only
regenerated the eight generated `tend-*` workflows.
`review-reviewers.yaml` is a hand-maintained custom workflow, so it
stayed on Codex and kept failing every hour with the `token_invalidated`
/ `refresh_token_reused` 401s #556 documented — a static
`CODEX_AUTH_JSON` secret can't survive OpenAI's single-use refresh-token
rotation. Most recent failing run:
https://github.com/max-sixty/tend/actions/runs/26002741398

**`review-reviewers.yaml` → Claude.** `max-sixty/tend/[email protected]` →
`max-sixty/[email protected]`, `codex_auth_json` → `claude_code_oauth_token` +
`anthropic_api_key`, `model: gpt-5.5` → `opus`, prompt
`$review-reviewers` → `/tend-ci-runner:review-reviewers`. Identical
input/model/ref shape to the #556-regenerated workflows.

**`codex-auth-refresh.yaml` → dispatch-only reference.** Nothing on tend
consumes `CODEX_AUTH_JSON` anymore, but this file is the reference
implementation `security-model.md` links for adopters to copy, and Codex
is still a shipped harness option. So instead of deleting it, the
`schedule:` trigger is commented out (not removed) — tend itself stops
running it nightly and failing, while adopters still see the cron they
need. Header reframed as the canonical example.

**`.config/tend.yaml`.** `CODEX_AUTH_JSON` stays in `secrets.allowed`:
the repo secret is intentionally retained for now, and dropping the
allowlist entry while the secret still exists would trip tend's own
`check_repo_secret_allowlist` audit. The comment now explains that
coupling — the entry and the secret get removed together when the Codex
dogfood path is fully retired.

Deferred deliberately: the `CODEX_AUTH_JSON` / `CODEX_REFRESH_PAT`
secrets and the `codex-auth-refresh` environment on this repo are left
in place pending a decision on the Codex direction.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
@max-sixty max-sixty mentioned this pull request May 19, 2026
3 tasks
max-sixty added a commit that referenced this pull request May 19, 2026
## Summary

Release 0.0.25. 8 PRs since 0.0.24:

- #566 review: push fixes to bot PRs by default, even when the fix needs
a judgment call
- #563 skills(running-tend): drop stale session-log count
- #562 skills: drop dollar-amount cost asides corrupted by arg
substitution
- #526 fix(list-recent-runs): anchor completion window to the intended
cron tick
- #559 fix(skills): hard-code /tmp instead of $TMPDIR in worktree
recipes
- #560 fix(enrich-tend-outage-issues): batch into one comment per issue
- #557 config: switch review-reviewers back to claude, demote
codex-auth-refresh to reference
- #556 config: switch tend's own harness back to claude

#566 is the reason for cutting now: it flips the bot-PR review default
from "push only mechanical fixes" to "push the fix whenever the review
can articulate it, defer only when no defensible default exists." The
behavior is release-gated, so it only reaches tend's own dogfooded
workflows (and adopters like PRQL) once 0.0.25 is published and the
nightly regen repins the action ref.

No new breaking changes since 0.0.24.

## Test plan

- [ ] CI green (test, test-worker, lint)
- [ ] After merge: tag `0.0.25`, PyPI publish (`pypi-release.yaml` on
the tag push), `uvx [email protected] --help` works
- [ ] Regenerate tend's own workflows to `@0.0.25` (separate `chore:
regenerate` PR, after the tag exists)

Co-authored-by: Claude <[email protected]>
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.

1 participant