Commit Graph

1822 Commits

Author SHA1 Message Date
Michael Bolin
0eee95cafe merge commit for archive created by Sapling 2025-06-26 12:28:29 -07:00
Michael Bolin
7fda3f97b6 feat: add support for /diff command 2025-06-26 12:27:44 -07:00
Michael Bolin
52b41573ca merge commit for archive created by Sapling 2025-06-26 12:25:35 -07:00
Michael Bolin
bf72aee504 feat: add support for /diff command 2025-06-26 12:25:27 -07:00
Michael Bolin
eac87e6ad3 Merge 5c3ff9fc10 into sapling-pr-archive-bolinfest 2025-06-26 12:10:57 -07:00
Michael Bolin
5c3ff9fc10 feat: add support for /diff command 2025-06-26 12:10:49 -07:00
Michael Bolin
1f64c97f89 merge commit for archive created by Sapling 2025-06-26 12:09:48 -07:00
Michael Bolin
d3026a2a55 feat: add support for /diff command 2025-06-26 12:09:41 -07:00
Gabriel Peal
a339a7bcce [Rust] Allow resuming a session that was killed with ctrl + c (#1387)
Previously, if you ctrl+c'd a conversation, all subsequent turns would
400 because the Responses API never got a response for one of its call
ids. This ensures that if we aren't sending a call id by hand, we
generate a synthetic aborted call.

Fixes #1244 


https://github.com/user-attachments/assets/5126354f-b970-45f5-8c65-f811bca8294a
2025-06-26 14:40:42 -04:00
Michael Bolin
9812f7978c Merge 217de68af6 into sapling-pr-archive-bolinfest 2025-06-26 09:03:38 -07:00
Michael Bolin
217de68af6 feat: add support for /diff command 2025-06-26 09:03:34 -07:00
Michael Bolin
fcfe43c7df feat: show number of tokens remaining in UI (#1388)
When using the OpenAI Responses API, we now record the `usage` field for
a `"response.completed"` event, which includes metrics about the number
of tokens consumed. We also introduce `openai_model_info.rs`, which
includes current data about the most common OpenAI models available via
the API (specifically `context_window` and `max_output_tokens`). If
Codex does not recognize the model, you can set `model_context_window`
and `model_max_output_tokens` explicitly in `config.toml`.

When then introduce a new event type to `protocol.rs`, `TokenCount`,
which includes the `TokenUsage` for the most recent turn.

Finally, we update the TUI to record the running sum of tokens used so
the percentage of available context window remaining can be reported via
the placeholder text for the composer:

![Screenshot 2025-06-25 at 11 20
55 PM](https://github.com/user-attachments/assets/6fd6982f-7247-4f14-84b2-2e600cb1fd49)

We could certainly get much fancier with this (such as reporting the
estimated cost of the conversation), but for now, we are just trying to
achieve feature parity with the TypeScript CLI.

Though arguably this improves upon the TypeScript CLI, as the TypeScript
CLI uses heuristics to estimate the number of tokens used rather than
using the `usage` information directly:


296996d74e/codex-cli/src/utils/approximate-tokens-used.ts (L3-L16)

Fixes https://github.com/openai/codex/issues/1242
2025-06-25 23:31:11 -07:00
Michael Bolin
02d8b5bea4 merge commit for archive created by Sapling 2025-06-25 23:27:18 -07:00
Michael Bolin
e74657bbdd feat: show number of tokens remaining in UI 2025-06-25 23:27:12 -07:00
Michael Bolin
cb7121367d merge commit for archive created by Sapling 2025-06-25 23:10:21 -07:00
Michael Bolin
683cdf9cec feat: show number of tokens remaining in UI 2025-06-25 23:10:16 -07:00
Michael Bolin
ece4ebf640 Merge e7f62d9d67 into sapling-pr-archive-bolinfest 2025-06-25 23:08:18 -07:00
Michael Bolin
e7f62d9d67 feat: show number of tokens remaining in UI 2025-06-25 23:07:01 -07:00
Michael Bolin
14e644ba91 merge commit for archive created by Sapling 2025-06-25 16:41:22 -07:00
Michael Bolin
81e6823428 feat: add support for /diff command 2025-06-25 16:41:15 -07:00
Michael Bolin
4b09784d3a Merge 03fe6a9826 into sapling-pr-archive-bolinfest 2025-06-25 16:38:39 -07:00
Michael Bolin
03fe6a9826 feat: add support for /diff command 2025-06-25 16:36:50 -07:00
Michael Bolin
b42f8459c3 Merge 715aac0c00 into sapling-pr-archive-bolinfest 2025-06-25 16:33:35 -07:00
Michael Bolin
715aac0c00 feat: show number of tokens remaining in UI 2025-06-25 16:33:04 -07:00
Michael Bolin
296996d74e feat: standalone file search CLI (#1386)
Standalone fuzzy filename search library that should be helpful in
addressing https://github.com/openai/codex/issues/1261.
2025-06-25 13:29:03 -07:00
Michael Bolin
4e9f95d800 Merge aadfed064f into sapling-pr-archive-bolinfest 2025-06-25 13:15:55 -07:00
Michael Bolin
aadfed064f feat: standalone file search CLI 2025-06-25 13:15:45 -07:00
Michael Bolin
50924101d2 feat: add --dangerously-bypass-approvals-and-sandbox (#1384)
This PR reworks `assess_command_safety()` so that the combination of
`AskForApproval::Never` and `SandboxPolicy::DangerFullAccess` ensures
that commands are run without _any_ sandbox and the user should never be
prompted. In turn, it adds support for a new
`--dangerously-bypass-approvals-and-sandbox` flag (that cannot be used
with `--approval-policy` or `--full-auto`) that sets both of those
options.

Fixes https://github.com/openai/codex/issues/1254
2025-06-25 12:36:10 -07:00
Michael Bolin
3bcda29a24 Merge d8765eecc8 into sapling-pr-archive-bolinfest 2025-06-25 12:27:41 -07:00
Michael Bolin
d8765eecc8 feat: add --dangerously-bypass-approvals-and-sandbox 2025-06-25 12:26:22 -07:00
Michael Bolin
72082164c1 chore: rename AskForApproval::UnlessAllowListed to AskForApproval::UnlessTrusted (#1385)
We could just rename to `Untrusted` instead of `UnlessTrusted`, but I
think `AskForApproval::UnlessTrusted` reads a bit better.
2025-06-25 12:26:13 -07:00
Michael Bolin
61806fc5f5 Merge a66f27bc9d into sapling-pr-archive-bolinfest 2025-06-25 12:09:47 -07:00
Michael Bolin
a66f27bc9d feat: add --dangerously-bypass-approvals-and-sandbox 2025-06-25 12:09:36 -07:00
Michael Bolin
0235df863a chore: rename AskForApproval::UnlessAllowListed to AskForApproval::UnlessTrusted 2025-06-25 12:09:27 -07:00
Michael Bolin
c640e59dcd merge commit for archive created by Sapling 2025-06-25 12:07:16 -07:00
Michael Bolin
24e051c466 feat: add --dangerously-bypass-approvals-and-sandbox 2025-06-25 12:07:09 -07:00
Michael Bolin
2c621b3860 merge commit for archive created by Sapling 2025-06-25 11:33:43 -07:00
Michael Bolin
552b404626 feat: add --dangerously-bypass-approvals-and-sandbox 2025-06-25 11:33:37 -07:00
Michael Bolin
4610c998a1 Merge 1b1611b891 into sapling-pr-archive-bolinfest 2025-06-25 11:32:16 -07:00
Michael Bolin
1b1611b891 feat: add --dangerously-bypass-approvals-and-sandbox 2025-06-25 11:32:11 -07:00
Michael Bolin
66c6ad7801 Merge 1420d2458c into sapling-pr-archive-bolinfest 2025-06-25 11:21:37 -07:00
Michael Bolin
1420d2458c feat: add --dangerously-bypass-approvals-and-sandbox 2025-06-25 11:21:09 -07:00
Michael Bolin
e09691337d chore: improve docstring for --full-auto (#1379)
Reference `-c sandbox.mode=workspace-write` in the docstring and users
can read the config docs for `sandbox` for more information.
2025-06-25 09:13:36 -07:00
Michael Bolin
887a7467f6 Merge 9e144a71d0 into sapling-pr-archive-bolinfest 2025-06-24 22:19:32 -07:00
Michael Bolin
9e144a71d0 chore: improve docstring for --full-auto 2025-06-24 22:19:26 -07:00
Michael Bolin
86d5a9d80d chore: rename unless-allow-listed to untrusted (#1378)
For the `approval_policy` config option, renames `unless-allow-listed`
to `untrusted`. In general, when it comes to exec'ing commands, I think
"trusted" is a more accurate term than "safe."

Also drops the `AskForApproval::AutoEdit` variant, as we were not really
making use of it, anyway.

Fixes https://github.com/openai/codex/issues/1250.


---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/1378).
* #1379
* __->__ #1378
2025-06-24 22:19:21 -07:00
Michael Bolin
c6e562aedd merge commit for archive created by Sapling 2025-06-24 22:15:59 -07:00
Michael Bolin
63af91e70d chore: improve docstring for --full-auto 2025-06-24 22:15:47 -07:00
Michael Bolin
4c8514a636 chore: rename unless-allow-listed to untrusted 2025-06-24 22:15:47 -07:00
Michael Bolin
8cd306f8d8 Merge 989afe9e7a into sapling-pr-archive-bolinfest 2025-06-24 22:11:10 -07:00