Commit Graph
14 Commits
Author SHA1 Message Date
jif-oai ffd4bd345c feat: tie shell snapshot to cwd (#11231)
Fix for this: https://github.com/openai/codex/issues/11223

Basically we tie the shell snapshot to a `cwd` to handle `cwd`-based env
setups
2026-02-09 22:14:39 +00:00
jif-oai 4971e96a98 nit: shell snapshot retention to 3 days (#10382) 2026-02-02 12:52:45 +00:00
Skylar GraikaandSkylar Graika 9008a0eff9 core: prevent shell_snapshot from inheriting stdin (#9735)
Fixes #9559.

When `shell_snapshot` runs, it may execute user startup files (e.g.
`.bashrc`). If those files read from stdin (or if stdin is an
interactive TTY under job control), the snapshot subprocess can block or
receive `SIGTTIN` (as reported over SSH).

This change explicitly sets `stdin` to `Stdio::null()` for the snapshot
subprocess, so it can't read from the terminal.

Regression test added that would hang/timeout without this change.
Tests: `ulimit -n 4096 && cargo test -p codex-core`.

cc @dongdongbh @etraut-openai

---------

Co-authored-by: Skylar Graika <sgraika127@gmail.com>
2026-01-30 13:47:10 -08:00
jif-oai 89c5f3c4d4 feat: adding thread ID to logs + filter in the client (#10150) 2026-01-29 16:53:30 +01:00
gt-oai fdc69df454 Fix flakey shell snapshot test (#9919)
Sometimes fails with:

```
failures:

  ---- shell_snapshot::tests::timed_out_snapshot_shell_is_terminated stdout ----

  thread 'shell_snapshot::tests::timed_out_snapshot_shell_is_terminated' panicked at codex-rs/core/src/shell_snapshot.rs:588:9:
  expected timeout error, got Failed to execute sh

  Caused by:
      Text file busy (os error 26)


  failures:
      shell_snapshot::tests::timed_out_snapshot_shell_is_terminated

  test result: FAILED. 815 passed; 1 failed; 4 ignored; 0 measured; 0 filtered out; finished in 18.00s
```
2026-01-26 18:05:30 +00:00
jif-oai afa08570f2 nit: exclude PWD for rc sourcing (#9753) 2026-01-23 13:35:48 +01:00
jif-oai 3355adad1d chore: defensive shell snapshot (#9609)
This PR adds 2 defensive mechanisms for shell snapshotting:
* Filter out invalid env variables (containing `-` for example) without
dropping the whole snapshot
* Validate the snapshot before considering it as valid by running a mock
command with a shell snapshot
2026-01-21 18:41:58 +00:00
jif-oai b75024c465 feat: async shell snapshot (#9600) 2026-01-21 10:41:13 +00:00
jif-oai dc1b62acbd feat: detach non-tty childs (#9477)
Thanks to the investigations made by
* @frantic-openai https://github.com/openai/codex/pull/9403
* @kfiramar https://github.com/openai/codex/pull/9388
2026-01-19 11:35:34 +00:00
jif-oai 6fbb89e858 fix: shell snapshot clean-up (#9155)
Clean all shell snapshot files corresponding to sessions that have not
been updated in 7 days
Those files should never leak. The only known cases were it can leak are
during non graceful interrupt of the process (`kill -9, `panic`, OS
crash, ...)
2026-01-14 09:05:46 +00:00
jif-oai 258fc4b401 feat: add sourcing of rc files to shell snapshot (#9150) 2026-01-14 08:58:10 +00:00
jif-oai 29381ba5c2 feat: add shell snapshot for shell command (#7786) 2025-12-11 13:46:43 +00:00
jif-oai 463249eff3 fix: flaky test 2 (#7818) 2025-12-10 16:35:28 +00:00
jif-oai 7836aeddae feat: shell snapshotting (#7641) 2025-12-09 18:36:58 +00:00