Commit Graph

2463 Commits

Author SHA1 Message Date
Michael Bolin
a26b47800f Merge 66a5929082 into sapling-pr-archive-bolinfest 2025-08-06 00:07:56 -07:00
Michael Bolin
66a5929082 fix: try to reduce public API of crates to speed up incremental builds 2025-08-06 00:07:45 -07:00
Michael Bolin
dc97ad8ec1 Merge 966480e4af into sapling-pr-archive-bolinfest 2025-08-05 23:59:06 -07:00
Michael Bolin
966480e4af fix: try to reduce public API of crates to speed up incremental builds 2025-08-05 23:58:26 -07:00
Michael Bolin
7b3ab968a0 docs: add more detail to the codex-rust-review (#1875)
This PR attempts to break `codex-rust-review.md` into sections so that
it is easier to consume.

It also adds a healthy new section on "Assertions in Tests" that has
been on my mind for awhile.
2025-08-06 06:36:10 +00:00
Michael Bolin
02e7965228 fix: add stricter checks and better error messages to create_github_release.sh (#1874)
This script attempts to verify that:

- You have no local, uncommitted changes.
- You are on `main`
- The commit you are on exists on `main` also exists on the origin
`https://github.com/openai/codex`, i.e., it is not just a commit you
have pushed to your local version of `main`

As part of this, try to print better error message if/when these
conditions are violated.
2025-08-05 23:33:21 -07:00
Michael Bolin
e80dce44db Merge 12e5cf9f2f into sapling-pr-archive-bolinfest 2025-08-05 23:31:07 -07:00
Michael Bolin
12e5cf9f2f docs: add more detail to the codex-rust-review 2025-08-05 23:30:49 -07:00
Michael Bolin
0332fcb71c merge commit for archive created by Sapling 2025-08-05 23:25:10 -07:00
Michael Bolin
3bbb30f986 fix: provide better error messages in create_github_release.sh 2025-08-05 23:24:30 -07:00
Michael Bolin
d47bc2382c Merge e7e24c019a into sapling-pr-archive-bolinfest 2025-08-05 23:21:50 -07:00
Michael Bolin
e7e24c019a fix: provide better error messages in create_github_release.sh 2025-08-05 23:21:24 -07:00
Michael Bolin
493e4c9463 fix: only tag as prerelease when the version has an -alpha or -beta suffix (#1872)
Hardcoding to `prerelease: true` is a holdover from before we had
migrated to the Rust CLI for releases and decided on how we were doing
version numbers.

To date, I have had to change the release status from "prerelease" to
"actual release" manually through the GitHub Releases web page. This is
a semi-serious problem because I've discovered that it messes up
Homebrew's automation if the version number _looks_ like a real release
but turns out to be a prerelease. The release potentially gets skipped
from being published on Homebrew, so it's important to set the value
correctly from the start.

I verified that `steps.release_name.outputs.name` does not include the
`rust-v` prefix from the tag name.
2025-08-05 23:11:29 -07:00
ae
1f7003b476 tweak comment (#1871)
Belatedly address CR feedback about a comment.

------
https://chatgpt.com/codex/tasks/task_i_6892e8070be4832cba379f2955f5b8bc
2025-08-05 23:02:00 -07:00
Michael Bolin
64bc520a9e Merge 65567df852 into sapling-pr-archive-bolinfest 2025-08-05 23:01:08 -07:00
Michael Bolin
65567df852 fix: only tag as prerelease when the version has an -alpha or -beta suffix 2025-08-05 23:00:48 -07:00
Michael Bolin
eaf2fb5b4f fix: fully enumerate EventMsg in chatwidget.rs (#1866)
https://github.com/openai/codex/pull/1868 is a related fix that was in
flight simultaenously, but after talking to @easong-openai, this:

- logs instead of renders for `BackgroundEvent`
- logs for `TurnDiff`
- renders for `PatchApplyEnd`
2025-08-05 22:44:27 -07:00
Michael Bolin
bb522022b7 merge commit for archive created by Sapling 2025-08-05 22:39:09 -07:00
Michael Bolin
b2b1cdbec4 fix: fully enumerate EventMsg in chatwidget.rs 2025-08-05 22:38:53 -07:00
easong-openai
f8d70d67b6 Add OSS model info (#1860)
Add somewhat arbitrarily chosen context window/output limit.
2025-08-05 22:35:00 -07:00
easong-openai
966d957faf fixes no git repo warning (#1863)
Fix broken git warning

<img width="797" height="482" alt="broken-screen"
src="https://github.com/user-attachments/assets/9c52ed9b-13d8-4f1d-bb37-7c51acac615d"
/>
2025-08-05 22:34:14 -07:00
Michael Bolin
09ea2141a6 merge commit for archive created by Sapling 2025-08-05 22:31:45 -07:00
Michael Bolin
5f1906eb81 fix: fully enumerate EventMsg in chatwidget.rs 2025-08-05 22:31:19 -07:00
ae
b90c15abc4 clear terminal on launch (#1870) 2025-08-05 22:01:34 -07:00
aibrahim-oai
31dcae67db Remove Turndiff and Apply patch from the render (#1868)
Make the tui more specific on what to render. Apply patch End and Turn
diff needs special handling.

Avoiding this issue:

<img width="503" height="138" alt="image"
src="https://github.com/user-attachments/assets/4c010ea8-701e-46d2-aa49-88b37fe0e5d9"
/>
2025-08-05 21:32:03 -07:00
Dylan
725dd6be6a [approval_policy] Add OnRequest approval_policy (#1865)
## Summary
A split-up PR of #1763 , stacked on top of a tools refactor #1858 to
make the change clearer. From the previous summary:

> Let's try something new: tell the model about the sandbox, and let it
decide when it will need to break the sandbox. Some local testing
suggests that it works pretty well with zero iteration on the prompt!

## Testing
- [x] Added unit tests
- [x] Tested locally and it appears to work smoothly!
2025-08-05 20:44:20 -07:00
Michael Bolin
d7b5cb12d9 Merge eb200ca913 into sapling-pr-archive-bolinfest 2025-08-05 19:57:21 -07:00
Michael Bolin
eb200ca913 fix: fully enumerate EventMsg in chatwidget.rs 2025-08-05 19:57:05 -07:00
Dylan
aff97ed7dd [core] Separate tools config from openai client (#1858)
## Summary
In an effort to make tools easier to work with and more configurable,
I'm introducing `ToolConfig` and updating `Prompt` to take in a general
list of Tools. I think this is simpler and better for a few reasons:
- We can easily assemble tools from various sources (our own harness,
mcp servers, etc.) and we can consolidate the logic for constructing the
logic in one place that is separate from serialization.
- client.rs no longer needs arbitrary config values, it just takes in a
list of tools to serialize

A hefty portion of the PR is now updating our conversion of
`mcp_types::Tool` to `OpenAITool`, but considering that @bolinfest
accurately called this out as a TODO long ago, I think it's time we
tackled it.

## Testing
- [x] Experimented locally, no changes, as expected
- [x] Added additional unit tests
- [x] Responded to rust-review
2025-08-05 19:27:52 -07:00
Michael Bolin
afa8f0d617 fix: exit cleanly when ShutdownComplete is received (#1864)
Previous to this PR, `ShutdownComplete` was not being handled correctly
in `codex exec`, so it always ended up printing the following to stderr:

```
ERROR codex_exec: Error receiving event: InternalAgentDied
```

Because we were not breaking out of the loop for `ShutdownComplete`,
inevitably `codex.next_event()` would get called again and
`rx_event.recv()` would fail and the error would get mapped to
`InternalAgentDied`:


ea7d3f27bd/codex-rs/core/src/codex.rs (L190-L197)

For reference, https://github.com/openai/codex/pull/1647 introduced the
`ShutdownComplete` variant.
2025-08-05 19:19:36 -07:00
Michael Bolin
d2cb167943 Merge de81606a39 into sapling-pr-archive-bolinfest 2025-08-05 18:44:17 -07:00
Michael Bolin
de81606a39 fix: exit cleanly when ShutdownComplete is received 2025-08-05 18:43:59 -07:00
Dylan
ea7d3f27bd [core] Stop escalating timeouts (#1853)
## Summary
Escalating out of sandbox is (almost always) not going to fix
long-running commands timing out - therefore we should just pass the
failure back to the model instead of asking the user to re-run a command
that took a long time anyway.

## Testing
- [x] Ran locally with a timeout and confirmed this worked as expected
2025-08-05 17:52:25 -07:00
ae
f6c8d1117c [feat] make approval key matching case insensitive (#1862) 2025-08-05 15:50:06 -07:00
Michael Bolin
42bd73e150 chore: remove unnecessary default_ prefix (#1854)
This prefix is not inline with the other fields on the `ConfigOverrides`
struct.
2025-08-05 14:42:49 -07:00
Michael Bolin
03ced80d9a Merge 9ff7306219 into sapling-pr-archive-bolinfest 2025-08-05 13:58:28 -07:00
Michael Bolin
9ff7306219 chore: remove unnecessary default_ prefix 2025-08-05 13:58:08 -07:00
Michael Bolin
d365cae077 fix: when using --oss, ensure correct configuration is threaded through correctly (#1859)
This PR started as an investigation with the goal of eliminating the use
of `unsafe { std::env::set_var() }` in `ollama/src/client.rs`, as
setting environment variables in a multithreaded context is indeed
unsafe and these tests were observed to be flaky, as a result.

Though as I dug deeper into the issue, I discovered that the logic for
instantiating `OllamaClient` under test scenarios was not quite right.
In this PR, I aimed to:

- share more code between the two creation codepaths,
`try_from_oss_provider()` and `try_from_provider_with_base_url()`
- use the values from `Config` when setting up Ollama, as we have
various mechanisms for overriding config values, so we should be sure
that we are always using the ultimate `Config` for things such as the
`ModelProviderInfo` associated with the `oss` id

Once this was in place,
`OllamaClient::try_from_provider_with_base_url()` could be used in unit
tests for `OllamaClient` so it was possible to create a properly
configured client without having to set environment variables.
2025-08-05 13:55:32 -07:00
Michael Bolin
359bd892dc merge commit for archive created by Sapling 2025-08-05 13:30:32 -07:00
Michael Bolin
3779c2ddd1 fix: remove unsafe blocks and use of set_var(), as it is unsafe 2025-08-05 13:30:17 -07:00
Michael Bolin
aebf4d3b73 merge commit for archive created by Sapling 2025-08-05 13:25:19 -07:00
Michael Bolin
b9c7dd430e fix: remove unsafe blocks and use of set_var(), as it is unsafe 2025-08-05 13:25:05 -07:00
Michael Bolin
bc511deb3f merge commit for archive created by Sapling 2025-08-05 13:21:37 -07:00
Michael Bolin
8ea22920b0 fix: remove unsafe blocks and use of set_var(), as it is unsafe 2025-08-05 13:21:19 -07:00
Michael Bolin
f1d45a9315 merge commit for archive created by Sapling 2025-08-05 13:17:43 -07:00
Michael Bolin
3270011a6c fix: remove unsafe blocks and use of set_var(), as it is unsafe 2025-08-05 13:17:25 -07:00
Michael Bolin
63701e4987 Merge 51108b909b into sapling-pr-archive-bolinfest 2025-08-05 12:34:41 -07:00
Michael Bolin
51108b909b fix: remove unsafe blocks and use of set_var(), as it is unsafe 2025-08-05 12:34:26 -07:00
Michael Bolin
810e89c376 Merge 33d8732694 into sapling-pr-archive-bolinfest 2025-08-05 11:48:59 -07:00
Michael Bolin
33d8732694 chore: remove unnecessary default_ prefix 2025-08-05 11:48:41 -07:00