The application panicked (crashed). Message: /tmp is absolute: Os { code: 2, kind: NotFound, message: "No such file or directory" }
What version of Codex CLI is running?
0.111.0
What subscription do you have?
pro
Which model were you using?
gpt-5.4
What platform is your computer?
Linux 6.18.8-arch2-1 x86_64 unknown
What terminal emulator and version are you using (if applicable)?
st (suckless terminal), tmux 3.6a
What issue are you seeing?
The odd characters going down the left is what it showed. As it continued and I tried typing a message to queue, my characters were also just going down the left side. After finishing, I can type normally but need to press enter twice to send.
• I hit a patch formatting issue. I’m reapplying the base edits now and then I’ll commit the rebuilt first step.
• Working (29s • esc to interrupt)
› The application panicked (crashed).
Message: /tmp is absolute: Os { code: 2, kind: NotFound, message: "No such file or directory" }
L
• Working 37
B
R
WaThe application panicked (crashed).
Message: /tmp is absolute: Os { code: 2, kind: NotFound, message: "No such file or directory" }
L
• Working 8
B
R
WaThe application panicked (crashed).
Message: /tmp is absolute: Os { code: 2, kind: NotFound, message: "No such file or directory" }
L
• Working 42
B
R
WaThe application panicked (crashed).
Message: /tmp is absolute: Os { code: 2, kind: NotFound, message: "No such file or directory" }
• apply_patch is failing on this workspace, so I’m falling back to in-place text edits with shell commands to keep the rewrite moving. I’m limiting that to the
exact line changes we agreed on.
What steps can reproduce the bug?
No idea.
What is the expected behavior?
It shouldn't panic or crash. It either didn't crash, or it recovered. It seems to have finished just fine, but I haven't seen it do anything like this before and there are unresolved issues from other users who never responded without /feedback sent, so I wanted to report this.
Additional information
/feedback thread ID 019ccf89-2381-7ad0-8297-1fc4492724be.
I'm going to leave this Codex session running where it's at and continue in another, in case there's anything else I can run in it to help diagnose this, although I doubt there is.
Related issues:
- https://github.com/openai/codex/issues/8428 - Closed by reporter, not sure why.
- https://github.com/openai/codex/issues/10297 - Reporter never responded to your question.
- https://github.com/openai/codex/issues/12247 - Reporter gave reproduction steps which were complicated.
I have no idea what happened. journalctl doesn't show any actual errors. I have a ton of other things running, and nothing else had complaints. I've never seen a /tmp error from any application before, or encountered any type of permission denied or operation not permitted error with it in a shell or another program. Codex has been using /tmp a lot lately (I kind of wish it didn't, or that it was scoped to /tmp/<codex session id> to prevent collisions) and I haven't seen problems with it. No other Codex session was doing anything, so there was no collision.
I am on Arch Linux. There's no special or unusual environment. It's not a VM, and I'm not using any type of sandboxing.
I asked Codex what it could tell me, and below is that conversation. I don't even think my fingers were on my keyboard when it errored, and even if I had, I'm not sure why it should have shown this error. If I had interrupted it like it claims, I don't think it would have continued and completed its work. It claims it stopped and I asked it to restart, but that's not what happened and isn't what the TUI shows scrolling up.
---
› What were you trying to do when we had the application panicked crashed errors regarding /tmp? What was the error? What can I tell OpenAI in a bug report to
help them know exactly what happened?
• I was trying to get an untracked panel-of-experts/ directory out of the repo so I could switch back to master and restart the history rewrite from the correct
base.
The sequence was:
- I was on the wrong branch: rewrite_discussed_changes, which pointed at unrelated commit 57da9fb stash: clean_architecture.
- On that branch, panel-of-experts/ was untracked, because the files had been restored there without being committed on that branch.
- git switch master failed with this Git error:
error: The following untracked working tree files would be overwritten by checkout:
panel-of-experts/SKILL.md
panel-of-experts/scripts/panel_of_experts.py
Please move or remove them before you switch branches.
Aborting
- To recover, I tried to move that untracked directory out of the repo into /tmp, with a command like:
mv /mnt/fast/skills.git/panel-of-experts /tmp/panel-of-experts-rewrite-backup-20260310
Later I used:
mv /mnt/fast/skills.git/panel-of-experts /tmp/panel-of-experts-wrong-base-20260310
What the actual error was:
- I did not get a shell error from mv itself.
- The first mv attempt was aborted/interrupted.
- If the application showed a panic/crash mentioning /tmp, that was app-side behavior around handling that move, not a normal command failure that I could see
from the shell.
What to put in a bug report:
- Repo cwd: /mnt/fast/skills.git
- A nested directory panel-of-experts/ existed as untracked files on branch rewrite_discussed_changes
- That branch pointed at unrelated commit 57da9fb stash: clean_architecture.
- git switch master failed because tracked files on master would overwrite untracked files:
- panel-of-experts/SKILL.md
- panel-of-experts/scripts/panel_of_experts.py
- Recovery action attempted:
- mv /mnt/fast/skills.git/panel-of-experts /tmp/panel-of-experts-rewrite-backup-20260310
- The crash/panic happened around that /tmp move attempt, not around a Git command
- The move was being run as an escalated command from the coding agent
- The first attempt was interrupted/aborted; a later move to /tmp/panel-of-experts-wrong-base-20260310 succeeded
If you want, I can also write this up as a compact bug report you can paste directly.
› Why was the first mv attempt aborted/interrupted? I didn't do that.
• I can’t actually tell that you personally did it.
What I know is only this:
- The first mv command returned from the tool as aborted by user.
- Immediately after, the system injected a message saying:
<turn_aborted>
The user interrupted the previous turn on purpose.
Any running unified exec processes were terminated.
If any tools/commands were aborted, they may have partially executed; verify current state before retrying.
</turn_aborted>
So from my side, the platform reported it as a user interruption. But that does not prove you clicked anything intentionally. It could also have been:
- a UI misfire
- a transport/session interruption
- an internal tool/runtime cancellation that was mislabeled
- some other app-level abort condition surfaced as “user interrupted”
So for a bug report, I would say:
- I did not observe a shell error from mv.
- The command was terminated by the tool/runtime and surfaced as aborted by user.
- The system then emitted a <turn_aborted> event claiming the user interrupted the turn.
- The actual human user says they did not intentionally interrupt it.
That is a useful detail for OpenAI, because it points at a possible misattribution bug in the interruption/cancellation path rather than a normal command
failure.
› Run some test commands on files not actually involved in this project; make temporary ones as needed. See if you run identical commands that had problems
earlier if they succeed or fail the same way.
...
• I tested the same patterns on disposable files and repos. The results point away from mv itself and toward the earlier interruption being app/runtime-side.
Findings:
- Plain mv on throwaway directories in /tmp succeeded.
- A closer analogue, moving a throwaway directory from /mnt/fast/skills.git/panel-of-experts/... to /tmp/..., also succeeded.
- I reproduced the earlier Git error exactly in a disposable repo:
- git switch failed with:
error: The following untracked working tree files would be overwritten by checkout:
panel-of-experts/SKILL.md
panel-of-experts/scripts/panel_of_experts.py
Please move or remove them before you switch branches.
Aborting
- I then ran the same recovery pattern there:
- mv /tmp/poe-git-switch-test/panel-of-experts /tmp/poe-git-switch-test-moved
- retry git switch withdir
- That recovery succeeded immediately.
What this suggests:
- The earlier Git failure was normal and reproducible.
- The filesystem move itself is also normal and reproducible.
- I did not reproduce any crash or panic around moving to /tmp.
- So the earlier /tmp incident still looks like a platform/tool interruption that was surfaced as aborted by user, not a normal shell-level mv failure.
If you want to report it, the strongest summary is:
- git switch was correctly blocked by untracked files that would be overwritten.
- The intended recovery was to mv the untracked directory to /tmp.
- The same recovery works in a disposable reproduction.
- In the real session, that mv was interrupted by the app/runtime and labeled aborted by user, even though the user says they did not interrupt it.
› If I had interrupted it, wouldn't you have stopped and not finished up the work?
• Yes, normally.
If you had actually interrupted the turn, I would not have been able to continue that turn to completion. What should happen is:
- the running command gets canceled
- the turn ends
- I wait for your next message
That is basically what the system claimed happened when it emitted the <turn_aborted> event. I did not continue the original turn after that. I only resumed
once a new user message came in.
So the suspicious part is not “why did the work continue anyway?” It didn’t. The suspicious part is:
- the tool reported aborted by user
- the system reported user interrupted the previous turn on purpose
- you say you did not do that
That combination suggests a false or misattributed interruption event, not that I ignored a real interruption.
4 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Written by Codex, but reviewed by me:
1. Minimal panic reproduction
Smallest confirmed repro:
/tmp, for example:``
text
``/home/mdarling/abs-panic-singledir
``
text
``!mv /home/mdarling/abs-panic-singledir /tmp/abs-panic-singledir-moved
apply_patchagainst any absolute path outside the moved directory or/tmp, for example:``
text
``*** Begin Patch
*** Add File: /home/mdarling/some-file.txt
+seed
*** End Patch
Observed result:
Non-
/tmpcomparison:/mnt/fast/...(happens to be another filesystem) also reproduces the same panic./home/...does not panic; it fails more normally withNo such file or directory.2. Why normal Linux terminal behavior is different
In a normal Unix shell, cwd is effectively a live handle to a directory object, not just a stored pathname.
Example:
Then terminal A can often still do:
and it works. That is normal.
Codex is different. During
apply_patch, it appears to re-resolve or validate paths through stored pathnames. Once theoriginal cwd pathname is stale, Codex can:
No such file or directorySo this is not ordinary Linux cwd behavior. It is a Codex stale-cwd bug.
3. Code paths causing the error
There are two important paths:
apply_patchre-execs a helper with the saved patch cwd:It does:
``
rust
``cwd: req.action.cwd.clone(),
So the helper uses the stale moved-away cwd pathname.
It does:
``
rust
``let cwd_absolute = AbsolutePathBuf::from_absolute_path(cwd);
and then:
``
rust
``let slash_tmp =
AbsolutePathBuf::from_absolute_path("/tmp").expect("/tmp is absolute");
The code has
/tmpthere because workspace-write sandboxing adds a few default writable roots in addition to theexplicit workspace roots. On Unix,
/tmpis one of those default writable roots.The surprising part is that
AbsolutePathBuf::from_absolute_path()is not purely string-based:It calls
absolutize(), which callsstd::env::current_dir()even for an already-absolute path.That creates the split:
current_dir()still succeeds after the move, Codex gets past sandbox setup and later fails more normally withIo(... No such file or directory).current_dir()fails, then evenfrom_absolute_path("/tmp")can fail, and theexpect("/tmp is absolute")panics.
That is why some stale-cwd cases merely fail and others crash.
It also explains why the panic text mentions
/tmpeven when the move target was not/tmp:/tmpas a default sandbox writable root/tmpSo
/tmpin the panic text is an internal sandbox setup detail, not a reliable description of the move that triggeredthe bad state.
4. Review of the other user's commit
Commit reviewed:
Review:
Why it helps:
AbsolutePathBuf::from_absolute_path("/tmp")cannot fail.current_dir()fails because the process cwd has been moved away.expect(...)with ordinary error handling is the correct fix for that crash path.Why it is incomplete:
apply_patchstill re-execs using the stale saved cwd path.No such file or directoryerrors.Bottom line:
f2aefddis directionally correct for the panic site we traced.the stale cwd state.
Additional recurrence on macOS arm64 / Codex CLI 0.147.0
I am adding this here instead of opening a new issue because the user-visible failure matches the same class reported above: Codex showed the panic banner and the TUI/input composer behaved incorrectly afterwards.
Environment
codex-cli 0.147.026.6.1/ Darwin25.6.0/ arm64codex0.147.0is installed, and the clean cask binary reportscodex-cli 0.147.0.codexon PATH at the time of diagnosis:/opt/homebrew/bin/codex, currently symlinked to a local debug build at/Users/ymr/github/codex-37037/codex-rs/target/debug/codexfrom commit70dff626ccb0dd155c07a3f4862fcd852f33c463.Observed Behavior
Reproduction Status
I do not yet have a deterministic repro or a full Rust backtrace for this exact occurrence. The important new evidence is that the same panic-plus-input-corruption class is still being observed around the 0.147.0 timeframe on macOS arm64.
Repository Decision
openai/codexcode-yeongyu/lazycodexat10f95587d3aeacf208cc1fee88a91315962d31e8; search found no runtime implementation that owns the TUI panic path.openai/codexat4ef836f883c38ba6d39e6920f335ce6452b7de33.Source Evidence
The latest upstream source appears to have partially hardened one
/tmpwritable-root path, but a similar special-path panic edge still exists:codex-rs/protocol/src/protocol.rs:SandboxPolicy::get_writable_roots_with_cwdnow handlesAbsolutePathBuf::from_absolute_path("/tmp")withmatchand logsIgnoring invalid /tmp for sandbox writable rootinstead of panicking.codex-rs/protocol/src/permissions.rs:FileSystemSpecialPath::SlashTmpstill containsAbsolutePathBuf::from_absolute_path("/tmp").expect("/tmp is absolute").codex-rs/utils/absolute-path/src/lib.rs:AbsolutePathBuf::from_absolute_pathstill delegates throughabsolutize, so it can returnstd::io::Resultrather than being a pure string check.Root Cause Hypothesis
This still looks like a panic-recovery/input-state bug in the CLI/TUI layer, with the existing
/tmp is absolutestale-cwd/root-resolution path as one likely contributor for the original issue. For the new macOS occurrence, the exact trailing panic message was not captured, so I am not claiming it is the identical/tmp is absolutefailure. I am reporting it as the same user-visible class: panic banner followed by corrupted or wedged input state.Proposed Fix / Verification
AbsolutePathBuf::from_absolute_path(...).expect(...)paths that assume an already-absolute string cannot fail./tmporTMPDIR.---
This issue or PR was generated by LazyCodex.
Tag: lazycodex-generated