Repository navigation
codex-auth-refresh: write CODEX_AUTH_JSON as a repo secret, not env-scoped - #514
Merged
Merged
Conversation
…coped #513 changed the refresher's `gh secret set` to `--env codex-auth-refresh`, scoping CODEX_AUTH_JSON to that environment. But CODEX_AUTH_JSON is the runtime auth every consumer workflow reads (review, mention, triage, nightly, review-runs); none of them declare that environment, so `${{ secrets.CODEX_AUTH_JSON }}` resolved to empty and codex failed its auth check on every consumer run. Only CODEX_REFRESH_PAT (the secrets-write credential) should be env-scoped. CODEX_AUTH_JSON must be a repo secret. Drop the `--env` flag and add a comment so it doesn't get re-scoped. The job keeps `environment: codex-auth-refresh` to read the env-scoped PAT; it reads CODEX_AUTH_JSON from repo scope (env-scoped jobs still see repo secrets) and writes it back at repo scope. Co-Authored-By: Claude <[email protected]>
tend-agent
approved these changes
May 15, 2026
max-sixty
added a commit
that referenced
this pull request
May 16, 2026
## Summary Flips tend's own CI from the Claude harness to the Codex harness by setting `harness: codex` in `.config/tend.yaml` and regenerating the eight `tend-*.yaml` workflows. Each now invokes `max-sixty/tend/[email protected]` with `CODEX_AUTH_JSON` instead of `max-sixty/tend@<v>` with `CLAUDE_CODE_OAUTH_TOKEN`. Motivation is cost: API billing scales per token; a flat-rate ChatGPT subscription funds unlimited runs. tend dogfoods its own setup, so it should run the harness we recommend for cost-sensitive adopters. The net diff is small — config (+ `harness: codex`, + `secrets.allowed: [CODEX_AUTH_JSON]`) and the regenerated workflow files (action ref, auth secret, model, skill-invocation syntax). Supporting infrastructure landed separately on main: - `codex-auth-refresh.yaml` + env-scoped `CODEX_REFRESH_PAT` rotation (#500, #510) - `CODEX_AUTH_JSON` as a repo secret, refresher writes it back at repo scope (#514) - Codex-on-GHA fixes, all in release 0.0.22: sandbox `danger-full-access` (#519), npm prebuilt install (#522), base64 `final_message` capture (#525) ## Validation The original "do not merge until…" prerequisite is **satisfied**: - `tend-review-runs` `workflow_dispatch` on this branch (pinned `[email protected]`) ran **green end-to-end** — codex authenticated, installed via npm, ran without the `bwrap` block, executed the full agent (real review-runs work: posted evidence to the tracking issue, commented on the outage issue), and the action exited 0. - Deterministic CI (`test`, `test-worker`, `lint`) green; `tend-review` (Claude harness via `pull_request_target`) approved. Each codex blocker found during stabilization was fixed and released: auth scoping → sandbox → install → output framing. The smoke test going green on 0.0.22 confirms convergence. ## Post-merge follow-up Watch the first unattended nightly `codex-auth-refresh` cron (`17 3 * * *`) succeed. Manual dispatches (incl. the post-#514 recovery) have all succeeded; this just confirms the scheduled path runs without a human. Failure degrades gracefully over the ~8-day refresh window, with manual rotation as fallback. --------- Co-authored-by: Claude <[email protected]>
max-sixty
added a commit
that referenced
this pull request
May 16, 2026
## Summary Flips tend's own CI from the Claude harness to the Codex harness by setting `harness: codex` in `.config/tend.yaml` and regenerating the eight `tend-*.yaml` workflows. Each now invokes `max-sixty/tend/[email protected]` with `CODEX_AUTH_JSON` instead of `max-sixty/tend@<v>` with `CLAUDE_CODE_OAUTH_TOKEN`. Motivation is cost: API billing scales per token; a flat-rate ChatGPT subscription funds unlimited runs. tend dogfoods its own setup, so it should run the harness we recommend for cost-sensitive adopters. The net diff is small — config (+ `harness: codex`, + `secrets.allowed: [CODEX_AUTH_JSON]`) and the regenerated workflow files (action ref, auth secret, model, skill-invocation syntax). Supporting infrastructure landed separately on main: - `codex-auth-refresh.yaml` + env-scoped `CODEX_REFRESH_PAT` rotation (#500, #510) - `CODEX_AUTH_JSON` as a repo secret, refresher writes it back at repo scope (#514) - Codex-on-GHA fixes, all in release 0.0.22: sandbox `danger-full-access` (#519), npm prebuilt install (#522), base64 `final_message` capture (#525) ## Validation The original "do not merge until…" prerequisite is **satisfied**: - `tend-review-runs` `workflow_dispatch` on this branch (pinned `[email protected]`) ran **green end-to-end** — codex authenticated, installed via npm, ran without the `bwrap` block, executed the full agent (real review-runs work: posted evidence to the tracking issue, commented on the outage issue), and the action exited 0. - Deterministic CI (`test`, `test-worker`, `lint`) green; `tend-review` (Claude harness via `pull_request_target`) approved. Each codex blocker found during stabilization was fixed and released: auth scoping → sandbox → install → output framing. The smoke test going green on 0.0.22 confirms convergence. ## Post-merge follow-up Watch the first unattended nightly `codex-auth-refresh` cron (`17 3 * * *`) succeed. Manual dispatches (incl. the post-#514 recovery) have all succeeded; this just confirms the scheduled path runs without a human. Failure degrades gracefully over the ~8-day refresh window, with manual rotation as fallback. --------- Co-authored-by: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#513 over-reached: while correctly moving
CLOUDFLARE_API_TOKENto thecloudflare-deployenvironment, it also changed the codex refresher'sgh secret setto--repo "$REPO" --env codex-auth-refresh, scopingCODEX_AUTH_JSONinto thecodex-auth-refreshenvironment.CODEX_AUTH_JSONis the runtime Codex auth that every consumer workflow reads (tend-review,tend-mention,tend-triage,tend-nightly,tend-review-runs). None of them declareenvironment: codex-auth-refresh, so${{ secrets.CODEX_AUTH_JSON }}resolved to an empty string and the codex action failed its auth preflight (No Codex auth configured) on every consumer run. Verified on aworkflow_dispatchoftend-review-runsagainst the codex-harness branch.Only
CODEX_REFRESH_PAT(the secrets-write credential) should be env-scoped. This drops the--envflag so the refresher writesCODEX_AUTH_JSONback at repo scope, and adds a comment so it doesn't regress. The job keepsenvironment: codex-auth-refreshto read the env-scoped PAT — env-scoped jobs still see repo secrets, so it reads/writesCODEX_AUTH_JSONat repo scope.The
worker-deploy→cloudflare-deployparts of #513 are correct and untouched.Test plan
codex-auth-refresh— it reads the still-env-scoped valid token, writes a repo-levelCODEX_AUTH_JSONCODEX_AUTH_JSONappears as a repo secretCODEX_AUTH_JSONtend-review-runson the codex branch — codex authenticates