Skip to content

feat(repo): issue and register the Codex review token - #401

Merged
furedea merged 2 commits into
mainfrom
feat/register-the-codex-review-token
Nov 6, 2026
Merged

furedea merged 2 commits into
mainfrom
feat/register-the-codex-review-token

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

概要

repo review-token rotate で Codex レビュー用の PAT(CODEX_REVIEW_TOKEN)も発行・保存・登録できるようにします.codex-review workflow(furedea/reusable-workflows#8)が @codex review をオーナー名義で投稿するために使います.

コマンド 変更前 変更後
repo review-token rotate Claude の token だけ Claude → Codex の順に両方
repo review-token rotate claude なし Claude だけ(claude setup-token)
repo review-token rotate codex なし fine-grained PAT の作り方を表示し,貼られた PAT を保存して全 repo に登録
repo configure CLAUDE_CODE_OAUTH_TOKEN を登録 保存済みの token をそれぞれ登録.無いものだけ警告

確認

  • 1Password と Keychain で,token ごとに別の項目へ保存する(互いに上書きしない)
  • 各 token は stdin だけで渡し,引数や出力に出さない
  • 未知の種類は usage を返し,何も実行しない
  • ruff,ruff format,ty,pytest(155 件)

Refs furedea/reusable-workflows#7

🤖 Generated with Claude Code

The codex-review workflow posts `@codex review` with the owner's
fine-grained token. `repo review-token rotate [claude|codex]` now stores
each token under its own item and registers it as its own Actions secret;
without a kind it rotates both, and `configure` registers every stored one.

Refs furedea/reusable-workflows#7

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread github/repo.py Fixed
Comment thread github/repo.py Fixed
Comment thread github/repo.py Fixed
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Automated review: no blocking issues found.

I checked:

  • Backward compatibility. Claude's Keychain account (CLAUDE_CODE_OAUTH_TOKEN), its service (claude-review-token) and its 1Password title are unchanged, so tokens stored before this change are still found.
  • Separate storage. Each token gets its own 1Password item and its own Keychain service, and the new tests confirm they don't overwrite each other.
  • Secret handling. Token values reach op, security -i and gh secret set only on stdin. github_pat_… values pass the KEYCHAIN_SAFE_TOKEN check.
  • Argument dispatch. An unknown kind or an extra argument prints usage before uses_one_password() or any other command runs. When no kind is given, both tokens are rotated in order and the exit code is the max of the two results.
  • Configure. repo configure registers each stored token and warns only about the ones that are missing.

Tests cover the codex-only rotation, separate 1Password items, rotating both from stdin in order, an unknown kind, and configure with one or both tokens stored.

🤖 Generated with Claude Code

CodeQL treats names containing token or secret as secrets and flagged
log lines that print only the kind and the Actions entry name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Review summary

No blocking issues found. Checked:

  • Backward compatibility: the Claude reviewer keeps the old 1Password title (Claude review token), Keychain service (claude-review-token) and account (CLAUDE_CODE_OAUTH_TOKEN), so tokens that are already stored can still be read.
  • Separate storage: Claude and Codex each get their own 1Password item and Keychain service, so neither overwrites the other. Tests cover this for both backends.
  • Secret handling: tokens still travel only on stdin (gh secret set, op item, security -i). github_pat_… tokens match KEYCHAIN_SAFE_TOKEN.
  • Argument checks: unknown kinds and extra arguments return usage before op whoami or any other side effect runs.
  • Full rotation: a partial registration failure on Claude still continues to Codex, and max() gives the combined exit code. An exception during the Claude step (for example, claude setup-token failing) stops before Codex, which seems reasonable.
  • configure: registers each stored token and warns only about the missing one. Tests cover this.

Optional, not blocking: there is no test for the default rotation when the Claude step has a partial registration failure (exit code 1 with Codex still rotated).

@furedea
furedea merged commit d1ca723 into main Nov 6, 2026
14 checks passed
@furedea
furedea deleted the feat/register-the-codex-review-token branch November 6, 2026 16:27
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.

2 participants