Doesn't timeout when trying to execute git remote, not possible to cancel using ctrl + c

Resolved 💬 3 comments Opened Aug 12, 2025 by QLiMBer Closed Nov 22, 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.20.0

Which model were you using?

GTP-5

What platform is your computer?

Microsoft Windows NT 10.0.26120.0 x64 -> WSL 2.6.1.0 - Ubuntu Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 x86_64

What steps can reproduce the bug?

  1. On Windows 11 + WSL2 (Ubuntu), set up Git with SSH key authentication for GitHub:

``bash
ssh-keygen -t ed25519 -C "your_email@example.com"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
``

Add the public key to GitHub and verify normal SSH Git access works:

``bash
git clone git@github.com:<user>/<repo>.git
cd <repo>
git status
``

This works fine, even with a passphrase-protected key.

  1. In the same terminal session (where Git SSH works), run a Codex task that triggers Git remote commands — for example, let Codex add a remote and check access:

``bash
git remote add origin https://github.com/<user>/<repo>.git
git ls-remote -h origin
git push --dry-run origin HEAD:refs/heads/codex-access-test
``

  1. Even if the SSH key has already been unlocked this session (e.g., via git status), Codex cannot use the existing SSH authentication. I understand Codex might just properly work with HTTPS configured git, I don't know, and it is not the crucial part of this bug. (Although it would be nice if Codex supports git SSH key setup)
  1. Critical: When the hang occurs, there is no timeout and Ctrl+C does not cancel the operation. The only way to exit is to close the terminal or kill the process manually.

The last line of such Codex CLI session: " • Workingse1961s • Ctrl C to interrupt) running command"

What is the expected behavior?

Cancel the running command after some timeout (ideally customizable), and provide user information.
Or - at least - let user interrupt the command using ctrl + c.

What do you see instead?

● Workingse2224s • Ctrl C to interrupt) running command

Additional information

_No response_

View original on GitHub ↗

3 Comments

QLiMBer · 1 year ago

When I manually change the remote URL of the particular repo:
git remote set-url origin git@github.com:username/repo.git
codex was able to work with git remote! So this likely only happens when remote URL not set (codex than set it to HTTPS by default) or already set to HTTPS.

QLiMBer · 1 year ago

Another tests done:
1) If git for project not initiated / configured, but codex provided with proper SSH URL (git@github.com:username/repo.git) in prompt, it can use git with no issues.

So the bug really is just no timeout and ctrl + c not working.

2) If SSH key password not provided before codex execution, codex kind of try to show request for password, but the text is corrupted:
En•eWorkinghr8se for key '/home/mirek/.ssh/id_ed25519':

And it is not possible to provide the password. However, codex correctly timeouts in this case.
Forwarding correct requests for inputs in this (and likely similar) cases seems to be topic for another issue.

etraut-openai contributor · 9 months ago

I think this bug is no longer relevant, so closing. If you are seeing similar behavior with the latest versions of codex, please open a new bug.