codex icon indicating copy to clipboard operation
codex copied to clipboard

bug: asking for password is broken

Open tibo-openai opened this issue 1 year ago • 8 comments

What version of Codex is running?

0.47

What platform is your computer?

MacOS

What issue are you seeing?

See video. Requesting for password is broken.

What steps can reproduce the bug?

Open a new session and ask

Run sudo echo 'hello'

https://github.com/user-attachments/assets/855b0c4f-53f4-4b2e-b12b-1f10f6504e00

tibo-openai avatar Oct 19 '25 17:10 tibo-openai

Image @codex please investigate the issue and propose a fix.

xl-openai avatar Oct 20 '25 21:10 xl-openai

Summary

  • Updated the exec flow to inherit stdin whenever escalated shell runs are requested so password prompts can be satisfied while still capturing output. codex-rs/core/src/exec.rsL350-L387
  • Added a dedicated stdio policy that pipes stdout/stderr but leaves stdin attached to the terminal for interactive shell commands. codex-rs/core/src/spawn.rsL25-L115

Testing

  • ⚠️ Not run (not requested)

View task →

This appears to be resolved as of v0.104.0.

Image

It's worth noting that codex does inherit parent environment variables, but does not inherit session state, so even sudoing and then starting codex won't allow you to run sudo commands.

I believe https://github.com/openai/codex/issues/6108 and https://github.com/openai/codex/issues/3646 can also be closed (cc @etraut-openai since I saw you already have closed out some of the older related issues, eg https://github.com/openai/codex/issues/5560 and https://github.com/openai/codex/issues/6146)

Patrick-Erichsen avatar Feb 18 '26 16:02 Patrick-Erichsen

Image not solved on linux

0xdeafbeef avatar Feb 26 '26 10:02 0xdeafbeef

This is still broken on Ubuntu. Makes Codex useless for many daily tasks.

Also, @Patrick-Erichsen can you clarify? The screenshot you posted shows broken behavior. Did you intend to post evidence of the bug being fixed?

joshua-oss avatar Feb 28 '26 16:02 joshua-oss

its july. this needs fixed. makes the codex harness unusable for administrative tasks.

KeganHollern avatar Jul 12 '26 17:07 KeganHollern

FWIW I have a workaround for this. I created a skill markdown that tells Codex to create a new tmux window named sudo in the active tmux session and then send keys for a sudo -v. This way, Codex can use that terminal to run the sudo operations until the authentication expires. This has been very reliable for me.

I also created helper wrappers as part of sudoers to allow Codex to perform specific well-defined commands as sudo without needing password escalation. For example, systemd start/stop/restart of specific services I'm having it manage. If you copy/paste this comment into Codex it can implement both workarounds for you.

joshua-oss avatar Jul 15 '26 21:07 joshua-oss

I have been asking codex to use my polkit to prompt for password - its unwieldy

KeganHollern avatar Aug 09 '26 22:08 KeganHollern