lewtun HF Staff OpenAI Codex commited on
Commit
2fa5661
·
unverified ·
1 Parent(s): 048eafc

Document Codex gh auth retry (#306)

Browse files

Co-authored-by: OpenAI Codex <codex@openai.com>

Files changed (1) hide show
  1. AGENTS.md +1 -0
AGENTS.md CHANGED
@@ -30,6 +30,7 @@ Notes:
30
  - Always use the `gh` CLI for GitHub operations such as opening, editing, inspecting, or commenting on PRs and issues.
31
  - For multiline PR descriptions, prefer `gh pr edit <number> --body-file <file>` over inline `--body` so shell quoting, `$` env-var names, backticks, and newlines are preserved correctly.
32
  - If `gh` reports an invalid token or auth failure, retry the command with `GH_TOKEN` and `GITHUB_TOKEN` unset, for example `env -u GH_TOKEN -u GITHUB_TOKEN gh pr create ...`, so `gh` can use the stored login token instead of a stale environment token.
 
33
 
34
  ## GitHub PRs
35
 
 
30
  - Always use the `gh` CLI for GitHub operations such as opening, editing, inspecting, or commenting on PRs and issues.
31
  - For multiline PR descriptions, prefer `gh pr edit <number> --body-file <file>` over inline `--body` so shell quoting, `$` env-var names, backticks, and newlines are preserved correctly.
32
  - If `gh` reports an invalid token or auth failure, retry the command with `GH_TOKEN` and `GITHUB_TOKEN` unset, for example `env -u GH_TOKEN -u GITHUB_TOKEN gh pr create ...`, so `gh` can use the stored login token instead of a stale environment token.
33
+ - In Codex, sandboxed `gh` auth checks can report a valid keyring login as invalid when GitHub network access is restricted. Before telling the user to re-authenticate, retry with both env tokens unset and GitHub network access enabled.
34
 
35
  ## GitHub PRs
36