Commit Graph

8634 Commits

Author SHA1 Message Date
Michael Bolin
dcddea1188 Merge f921c6e772 into sapling-pr-archive-bolinfest 2025-06-26 22:56:32 -07:00
Michael Bolin
f921c6e772 feat: add support for @ to do file search 2025-06-26 22:56:18 -07:00
Michael Bolin
e8b8ed8750 fix: add tiebreaker logic for paths when scores are equal 2025-06-26 22:56:18 -07:00
Michael Bolin
fbf1da9800 merge commit for archive created by Sapling 2025-06-26 22:47:51 -07:00
Michael Bolin
a46b3bacb0 feat: add support for @ to do file search 2025-06-26 22:47:40 -07:00
Michael Bolin
27c4edd69f fix: add tiebreaker logic for paths when scores are equal 2025-06-26 22:47:40 -07:00
Michael Bolin
1fffe586ac Merge 83d11b9cd4 into sapling-pr-archive-bolinfest 2025-06-26 22:41:55 -07:00
Michael Bolin
83d11b9cd4 feat: add support for @ to do file search 2025-06-26 22:41:32 -07:00
Michael Bolin
1af8c43aba fix: add tiebreaker logic for paths when scores are equal 2025-06-26 22:38:44 -07:00
Michael Bolin
fa0e17f83a feat: add support for /diff command (#1389)
Adds support for a `/diff` command comparable to the one available in
the TypeScript CLI.

<img width="1103" alt="Screenshot 2025-06-26 at 12 31 33 PM"
src="https://github.com/user-attachments/assets/5dc646ca-301f-41ff-92a7-595c68db64b6"
/>

While here, changed the `SlashCommand` enum so the declared variant
order is the order the commands appear in the popup menu. This way,
`/toggle-mouse-mode` is listed last, as it is the least likely to be
used.

Fixes https://github.com/openai/codex/issues/1253.
codex-rs-6a8a936f75ea44faf05ff4fab0c6a36fc970428d-1-rust-v0.0.2506261603
2025-06-26 13:03:31 -07:00
Michael Bolin
6efff9f9d9 merge commit for archive created by Sapling 2025-06-26 12:34:06 -07:00
Michael Bolin
b154a5e7f3 feat: add support for /diff command 2025-06-26 12:34:00 -07:00
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