Dotnet build execution takes indefinite amount of time without success
What version of Codex is running?
0.50.0
What subscription do you have?
Plus
Which model were you using?
gpt-5-codex
What platform is your computer?
Darwin 24.6.0 arm64 arm
What issue are you seeing?
Asked the agent to run dotnet build and fix errors from the output (it made some while implementing changes in previous session). The build of the solution takes around 4 seconds when ran from IDE, while in CLI it was reportedly running for a minute and didn't yield any results. The previous session i waited around 10 minutes with same conclusion
What steps can reproduce the bug?
Uploaded thread: 019a32fc-5bc6-7d50-a33b-0dd10e2a7031
What is the expected behavior?
dotnet build command is executed ok
Additional information
Observed in some previous sessions that it also didn't succeed in build and responded with guidance for me to run it
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
- #4915
- #4847
- #5931
- #5905
- #4814
Powered by Codex Action
For comparison ran same prompt in copilot cli which successfully built the solution and retrieved the output of build command
Seeing the same thing with a dotnet project.
Codex version 0.55 OpenAI Codex (v0.55.0)
Model gpt-5-codex
MacBookPro - Apple M3 Max
Mac OS Sequoia Version 15.7.1 (24G231)
After no progress, I stopped codex, manually ran a restore, then instructed codex to try a build with the no-restore flag. No additional progress.
Ran dotnet build --no-restore my-solution.sln
└ (no output)
• It looks like the build is timing out after 120 seconds. I’m thinking about extending the timeout_ms to something more significant—like 600,000 milliseconds. I’ll also use --no-restore to help with this issue. Getting more time might allow the build to succeed,
so let’s fetch any errors and gather more information on this!
• Ran dotnet build --no-restore my-solution.sln
└
Build FAILED.
… +2 lines
Time Elapsed 00:05:00.86
• It seems the build output indicates a failure without any errors reported. This could be due to output truncation or not capturing earlier logs. I think I'll try to run the command with tee to save the logs and also consider using dotnet msbuild for more details.
Narrowing the build process might help isolate any hidden compile errors, especially related to the Microsoft Graph upgrade. Starting with the key project could streamline getting clarity on what's going wrong!
• Ran dotnet build --no-restore src/Project/API/GatewayService.csproj
└ (no output)
• I’m exploring ways to expedite the build process, especially since it times out at 5 minutes. I’m considering using dotnet build ... -v minimal or -maxcpucount:1 to potentially speed things up, though I know it might still take around 5 minutes. It seems like
producing an msbuild binary log could help gather error information. I also think about extending the timeout to 15 minutes, which might be necessary given the size of the solution. My main goal is to streamline things while capturing any errors efficiently.
• Running dotnet build --no-restore my-solution.sln
• Optimizing build process (21m 48s • esc to interrupt)
@MattCosturos, you're running a relatively old version of the CLI. Please update to the latest (0.61.0 or newer).
@etraut-openai it still occurs on the latest OpenAI Codex (v0.63.0)
Same problem, keeps wasting tokens
Just confirming that this is still an issue on 0.64.0 with following observed
dotnet restore
/opt/homebrew/Library/Homebrew/cmd/shellenv.sh: line 18: /bin/ps: Operation not permitted
• I’m looking into the restore command failing with exit code 124, which likely means a timeout rather than a permission
issue. The error mentions problems with the ps command, possibly due to sandbox or macOS restrictions. It seems the
restore might still be running quietly or stuck. I’m considering retrying with a longer timeout (like 300 seconds)
without escalation first to see if that resolves the issue. Requesting approval before escalating permissions also seems
prudent since it might not be needed. Let's try a careful, extended rerun.
Uploaded a thread jic 019ae1ec-8086-73b3-8c60-f5ddcf38d2e6
I've had success on 0.64.0, the gotcha was that it requires /approvals Agent (full access)
@mattxo that was always the case, or alternatively as shared here https://github.com/openai/codex/issues/3269#issuecomment-3472055175 setting up custom instructions. But that's more of a "workaround" and changing approvals back and forth also isn't ideal
Today's 0.66.0 update that has the following feature https://github.com/openai/codex/pull/7033 makes life easier: after Codex remembers the "allow always" for dotnet commands the issues described in this ticket don't happen anymore