keychain errors when running /review

Resolved 💬 3 comments Opened Dec 16, 2025 by getaaron Closed Dec 16, 2025
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.73.0

What subscription do you have?

AzureAI

Which model were you using?

gpt-5.1-codex-max high

What platform is your computer?

Linux 6.14.0-35-generic x86_64 x86_64

What issue are you seeing?

When I try to run /review and then select a review type (e.g. uncommitted changes) i get some cryptic keychain error and the model spins until giving up saying it can't complete the review due to a keychain error. When I ask codex for help it usually says it's something wrong with a macOS keychain but this is a linux machine.

I believe but am not sure that this started upgrading after an older version (0.65 maybe?)

$ codex --dangerously-bypass-approvals-and-sandbox
╭──────────────────────────────────────────────────────╮
│ >_ OpenAI Codex (v0.73.0)                            │
│                                                      │
│ model:     gpt-5.1-codex-max high   /model to change │
│ directory: ~/src/git/foo                             │
╰──────────────────────────────────────────────────────╯

  Tip: You can run any shell command from Codex using ! (e.g. !ls)

>> Code review started: current changes <<

• Ran cd /home/someone/src/git/foo && git status --short
  └ /usr/bin/keychain: 362: cannot create /home/someone/.keychain/hostname-lockf.737071: Permission denied

• I’m considering that the keychain should be non-login and non-interactive. Maybe it got triggered from .bashrc
  before for non-interactive sessions? I'm not entirely sure if the earlier call defaulted to true for login. Wait, I
  might need to explicitly set "login": false and try again. It's a bit of a puzzle, but I'm determined to get it
  right!

What steps can reproduce the bug?

  • Install codex
  • Have a .keychain directory in home directory
  • Run codex in a git repo
  • /review and request a review against current changes

What is the expected behavior?

A code review.

Additional information

If I rename the .keychain directory when I run the review I get

  └ mkdir: cannot create directory '/home/someone/.keychain': Permission denied
     * Error: can't create /home/someone/.keychain

instead.

I am really unsure why codex even needs to look at the .keychain directory to conduct a code review!

View original on GitHub ↗

3 Comments

getaaron · 8 months ago

I think the issue was introuced in https://github.com/openai/codex/pull/7786 which introduced shell_command and hard‑coded use_login_shell = true when building the exec args (bash -lc/zsh -lc), so every tool call runs as a login shell even when non‑interactive. That causes login rc files to run and trigger /usr/bin/keychain, which then fails to create ~/.keychain/....

Later changes

If I run this from another machine…

ssh someone@hostname 'bash -lc "cd /home/someone/src/git/foo && git status --short"'

… I see the git status fine. So I think it has something to do with the new sandboxing feature.

I am not following this feature too closely but it seems like a bug that this is happening when I pass --dangerously-bypass-approvals-and-sandbox!

CC @dylan-hurd-oai @jif-oai @bolinfest @pakrym-oai

etraut-openai contributor · 8 months ago

Thanks for the bug report. I think this is more likely related to #7593. This change was intended to prevent the model from making any code changes during /review, which it occasionally attempts. However, this change has had a number of unintended side effects, so we've decided to revert it.

getaaron · 8 months ago

@etraut-openai Thanks, that makes more sense. Would it be possible to cut a 0.74.0 release including the revert?