Commit Graph

270 Commits

Author SHA1 Message Date
oai-ragona
5b6224dd1b Merge branch 'main' into codex-rs-session 2025-04-28 09:53:28 -07:00
Thibault Sottiaux
fa5fa8effc fix: only allow running without sandbox if explicitly marked in safe container (#699)
Signed-off-by: Thibault Sottiaux <tibo@openai.com>
2025-04-28 07:48:38 -07:00
Michael Bolin
4eda4dd772 feat: load defaults into Config and introduce ConfigOverrides (#677)
This changes how instantiating `Config` works and also adds
`approval_policy` and `sandbox_policy` as fields. The idea is:

* All fields of `Config` have appropriate default values.
* `Config` is initially loaded from `~/.codex/config.toml`, so values in
`config.toml` will override those defaults.
* Clients must instantiate `Config` via
`Config::load_with_overrides(ConfigOverrides)` where `ConfigOverrides`
has optional overrides that are expected to be settable based on CLI
flags.

The `Config` should be defined early in the program and then passed
down. Now functions like `init_codex()` take fewer individual parameters
because they can just take a `Config`.

Also, `Config::load()` used to fail silently if `~/.codex/config.toml`
had a parse error and fell back to the default config. This seemed
really bad because it wasn't clear why the values in my `config.toml`
weren't getting picked up. I changed things so that
`load_with_overrides()` returns `Result<Config>` and verified that the
various CLIs print a reasonable error if `config.toml` is malformed.

Finally, I also updated the TUI to show which **sandbox** value is being
used, as we do for other key values like **model** and **approval**.
This was also a reminder that the various values of `--sandbox` are
honored on Linux but not macOS today, so I added some TODOs about fixing
that.
2025-04-27 21:47:50 -07:00
Thibault Sottiaux
e9d16d3c2b fix: check if sandbox-exec is available (#696)
- Introduce `isSandboxExecAvailable()` helper and tidy import ordering
in `handle-exec-command.ts`.
- Add runtime check for the `sandbox-exec` binary on macOS; fall back to
`SandboxType.NONE` with a warning if it’s missing, preventing crashes.

---------

Signed-off-by: Thibault Sottiaux <tibo@openai.com>
Co-authored-by: Fouad Matin <fouad@openai.com>
2025-04-27 17:04:47 -07:00
Ryan Ragona
798364e86b remove unused platform method 2025-04-27 15:34:19 -07:00
Ryan Ragona
34e849a89a windows build cleanup 2025-04-27 14:56:16 -07:00
Ryan Ragona
c7596debb1 cleanup 2025-04-27 12:56:35 -07:00
Ryan Ragona
ffe7e2277f artial, broken 2025-04-27 12:42:27 -07:00
Ryan Ragona
b344757fb0 first pass at get 2025-04-27 09:00:37 -07:00
Ryan Ragona
0fbe5f2069 cleanup 2025-04-27 08:46:45 -07:00
Ryan Ragona
aef7f25302 cleanup 2025-04-27 08:43:44 -07:00
Ryan Ragona
66a2e970f7 humansize 2025-04-27 08:35:21 -07:00
Ryan Ragona
e96055be36 move to_args closer to args 2025-04-27 08:12:09 -07:00
Ryan Ragona
359a09cd8d fmt 2025-04-27 07:50:12 -07:00
Ryan Ragona
8c672d5442 cuter job names 2025-04-27 07:49:59 -07:00
Ryan Ragona
4d26c773b9 drop ascii art 2025-04-26 16:34:03 -07:00
Ryan Ragona
026990fcc0 fmt 2025-04-26 16:31:47 -07:00
Ryan Ragona
ee51ffc130 fmt 2025-04-26 16:25:17 -07:00
Ryan Ragona
a4197ec97a truncate 2025-04-26 16:25:02 -07:00
Ryan Ragona
56e609d481 cleanup on clap args 2025-04-26 16:19:15 -07:00
Ryan Ragona
2b55e5a8f2 remove overcomments 2025-04-26 16:03:43 -07:00
Ryan Ragona
2420a6a898 clippy 2025-04-26 15:57:49 -07:00
Ryan Ragona
8ed2704191 in progress cleanup 2025-04-26 15:45:09 -07:00
Ryan Ragona
07911ddc3e cleanup pass 2025-04-26 15:34:08 -07:00
Ryan Ragona
f1c6625bf2 shorten timestamp 2025-04-26 14:38:17 -07:00
Ryan Ragona
337164738a fmt 2025-04-26 14:25:35 -07:00
Ryan Ragona
96d8d2a37a save session metadata 2025-04-26 14:25:26 -07:00
Fouad Matin
523996b5cb fix: /diff should include untracked files (#686) 2025-04-26 12:43:51 -07:00
Ryan Ragona
e782378176 gate on windows 2025-04-26 12:20:27 -07:00
Ryan Ragona
d3b69e98bd fmt 2025-04-26 12:13:24 -07:00
Ryan Ragona
3d9ce18299 fix for tail 2025-04-26 12:13:17 -07:00
Ryan Ragona
1e2983d612 cleanup on failure 2025-04-26 12:09:04 -07:00
Ryan Ragona
a7a8fa1753 session validation 2025-04-26 11:48:42 -07:00
Ryan Ragona
6f0e4a5733 tail 2025-04-26 11:42:50 -07:00
Ryan Ragona
a09be2144e stdout tailing 2025-04-26 11:36:48 -07:00
Ryan Ragona
d0e8aa5233 impl kill 2025-04-26 11:20:46 -07:00
Tomas Cupr
bc500d3009 feat: user config api key (#569)
Adds support for reading OPENAI_API_KEY (and other variables) from a
user‑wide dotenv file (~/.codex.config). Precedence order is now:
  1. explicit environment variable
  2. project‑local .env (loaded earlier)
  3. ~/.codex.config

Also adds a regression test that ensures the multiline editor correctly
handles cases where printable text and the CSI‑u Shift+Enter sequence
arrive in the same input chunk.

House‑kept with Prettier; removed stray temp.json artifact.
2025-04-26 10:13:30 -07:00
Ryan Ragona
dab7b1734d fmt 2025-04-26 10:03:34 -07:00
Ryan Ragona
9f10ec53b6 remove tui socket stuff 2025-04-26 10:03:24 -07:00
Ryan Ragona
786c81d706 draft still broken 2025-04-26 09:44:50 -07:00
Ryan Ragona
1d0d725494 draft broken 2025-04-26 09:41:06 -07:00
moppywhip
9b0ccf9aeb fix: duplicate messages in quiet mode (#680)
Addressing #600 and #664 (partially)

## Bug
Codex was staging duplicate items in output running when the same
response item appeared in both the streaming events. Specifically:

1. Items would be staged once when received as a
`response.output_item.done` event
2. The same items would be staged again when included in the final
`response.completed` payload

This duplication would result in each message being sent several times
in the quiet mode output.

## Changes
- Added a Set (`alreadyStagedItemIds`) to track items that have already
been staged
- Modified the `stageItem` function to check if an item's ID is already
in this set before staging it
- Added a regression test (`agent-dedupe-items.test.ts`) that verifies
items with the same ID are only staged once

## Testing
Like other tests, the included test creates a mock OpenAI stream that
emits the same message twice (once as an incremental event and once in
the final response) and verifies the item is only passed to `onItem`
once.
2025-04-26 09:14:50 -07:00
Ryan Ragona
f2b7b14284 draft of tui sock 2025-04-26 09:13:57 -07:00
Ryan Ragona
63ec18989a display kind 2025-04-26 08:27:26 -07:00
Ryan Ragona
2aa7f42dc9 fmt 2025-04-26 08:11:04 -07:00
Ryan Ragona
8f8479fd80 add repl subcommand 2025-04-26 08:10:46 -07:00
Ryan Ragona
9aaa947828 numeric prefix 2025-04-26 07:32:26 -07:00
Ryan Ragona
342ac711ca use dot dir 2025-04-26 07:06:20 -07:00
Ryan Ragona
b41f26f484 metadata 2025-04-26 07:05:19 -07:00
Ryan Ragona
abf0198a49 progress 2025-04-26 06:53:03 -07:00