Codex gets stuck in a deadlock

Open 💬 2 comments Opened Feb 28, 2026 by valderimedeiros
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

codex-cli 0.106.0

What subscription do you have?

Plus

Which model were you using?

gpt-5.3-codex

What platform is your computer?

Microsoft Windows NT 10.0.22631.0 x64

What terminal emulator and version are you using (if applicable)?

PowerShell and VSCode

What issue are you seeing?

Even with very simple tasks, the codex gets stuck in a deadlock and continues planning or working indefinitely.

I'm just trying Codex after successfully using Claude Code; my experience is the worst ever.

Thread ID 019ca206-b1b7-77c2-a25e-2577039108a

<img width="1449" height="112" alt="Image" src="https://github.com/user-attachments/assets/8b24ee69-806d-40ad-a90b-7acb5f08acc1" />

What steps can reproduce the bug?

Just use it in a Flutter project.

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 6 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #12161
  • #11738
  • #12852
  • #12777

Powered by Codex Action

fxha · 5 months ago

I ran into the same problem with Flutter. The problem seems to be that running flutter --version on Windows uses git and attempts to write files to the Flutter SDK directory. This causes the Git process to hang indefinitely, which causes Codex to hang as well until the Flutter/Git process is manually terminated.

I have found two workarounds:

  1. For simple Flutter/Dart tasks: add the Dart MCP and ask the agent to use the MCP instead of Flutter commands once per session.
  2. For more complex tasks or chained tool calls: add the Flutter SDK path to the Codex sandbox whitelist in config.toml:
[sandbox_workspace_write]
writable_roots = ["E:\\SDK\\flutter"]

While this prevents the Git process from hanging indefinitely, it leads to a follow-up issue with the Codex sandbox. The sandbox user lacks write permissions for the Flutter SDK directory, causing the Git process to be terminated due to Windows filesystem/user permissions. Codex will then ask if the command (e.g. cargo check) should be executed without the sandbox. This provides at least a way to complete Flutter tasks without having to disable the sandbox entirely or kill the process and run the steps manually.

I guess a hacky way to resolve this issue is by giving the Codex sandbox user access to the Flutter SDK folder. But I'm not familiar with the Codex sandbox and don't want to make any system changes. The second workaround works well for me.

See also https://github.com/openai/codex/issues/13914.