Commit Graph

893 Commits

Author SHA1 Message Date
Michael Bolin
3bea5e1fd3 merge commit for archive created by Sapling 2025-05-08 11:46:53 -07:00
Michael Bolin
13fb820612 feat: support the chat completions API in the Rust CLI 2025-05-08 11:46:46 -07:00
Michael Bolin
bb793643fd merge commit for archive created by Sapling 2025-05-08 11:29:23 -07:00
Michael Bolin
046d8ca49f feat: support the chat completions API in the Rust CLI 2025-05-08 11:29:17 -07:00
Michael Bolin
738c6f9884 Merge f4400df0f8 into sapling-pr-archive-bolinfest 2025-05-08 11:08:26 -07:00
Michael Bolin
f4400df0f8 feat: support the chat completions API in the Rust CLI 2025-05-08 11:08:22 -07:00
Michael Bolin
7d63895d93 merge commit for archive created by Sapling 2025-05-08 11:02:53 -07:00
Michael Bolin
b09190e842 feat: support the chat completions API in the Rust CLI 2025-05-08 11:02:48 -07:00
Michael Bolin
59c61b1a14 Merge ffda803fb7 into sapling-pr-archive-bolinfest 2025-05-08 10:49:41 -07:00
Michael Bolin
ffda803fb7 feat: support the chat completions API in the Rust CLI 2025-05-08 10:49:35 -07:00
Michael Bolin
24ecca3530 merge commit for archive created by Sapling 2025-05-08 10:49:10 -07:00
Michael Bolin
f27d589de6 feat: support the chat completions API in the Rust CLI 2025-05-08 10:49:01 -07:00
Michael Bolin
6df57d9b86 Merge ab33ddb9a6 into sapling-pr-archive-bolinfest 2025-05-07 23:14:08 -07:00
Michael Bolin
ab33ddb9a6 feat: support the chat completions API in the Rust CLI 2025-05-07 23:13:52 -07:00
Michael Bolin
457feb4996 Merge 245e11f0f0 into sapling-pr-archive-bolinfest 2025-05-07 23:08:06 -07:00
Michael Bolin
245e11f0f0 feat: support the chat completions API in the Rust CLI 2025-05-07 23:07:57 -07:00
Michael Bolin
9fdf2fa066 fix: remove clap dependency from core crate (#860) 2025-05-07 19:33:09 -07:00
Michael Bolin
7b68d83e29 Merge b9d167899a into sapling-pr-archive-bolinfest 2025-05-07 17:41:07 -07:00
Michael Bolin
b9d167899a fix: remove clap dependency from core crate 2025-05-07 17:41:00 -07:00
Michael Bolin
650715131f Merge 82454db972 into sapling-pr-archive-bolinfest 2025-05-07 17:40:57 -07:00
Michael Bolin
82454db972 fix: remove clap dependency from core crate 2025-05-07 17:40:49 -07:00
Michael Bolin
86022f097e feat: read model_provider and model_providers from config.toml (#853)
This is the first step in supporting other model providers in the Rust
CLI. Specifically, this PR adds support for the new entries in `Config`
and `ConfigOverrides` to specify a `ModelProviderInfo`, which is the
basic config needed for an LLM provider. This PR does not get us all the
way there yet because `client.rs` still categorically appends
`/responses` to the URL and expects the endpoint to support the OpenAI
Responses API. Will fix that next!
2025-05-07 17:38:28 -07:00
Michael Bolin
5cae49f08c merge commit for archive created by Sapling 2025-05-07 17:09:45 -07:00
Michael Bolin
403e88cacf feat: support map of alternative providers like in TypeScript CLI 2025-05-07 17:09:07 -07:00
Michael Bolin
4511a668f3 Merge 7c21aa3e16 into sapling-pr-archive-bolinfest 2025-05-07 16:59:19 -07:00
Michael Bolin
7c21aa3e16 feat: support map of alternative providers like in TypeScript CLI 2025-05-07 16:59:11 -07:00
Michael Bolin
955584c4ab merge commit for archive created by Sapling 2025-05-07 16:58:29 -07:00
Michael Bolin
60b522f4ee feat: support map of alternative providers like in TypeScript CLI 2025-05-07 16:58:21 -07:00
Michael Bolin
86ff8a1714 merge commit for archive created by Sapling 2025-05-07 16:44:46 -07:00
Michael Bolin
d13b807980 feat: support map of alternative providers like in TypeScript CLI 2025-05-07 16:44:31 -07:00
Michael Bolin
cfe50c7107 fix: creating an instance of Codex requires a Config (#859)
I discovered that I accidentally introduced a change in
https://github.com/openai/codex/pull/829 where we load a fresh `Config`
in the middle of `codex.rs`:


c3e10e180a/codex-rs/core/src/codex.rs (L515-L522)

This is not good because the `Config` could differ from the one that has
the user's overrides specified from the CLI. Also, in unit tests, it
means the `Config` was picking up my personal settings as opposed to
using a vanilla config, which was problematic.

This PR cleans things up by moving the common case where
`Op::ConfigureSession` is derived from `Config` (originally done in
`codex_wrapper.rs`) and making it the standard way to initialize `Codex`
by putting it in `Codex::spawn()`. Note this also eliminates quite a bit
of boilerplate from the tests and relieves the caller of the
responsibility of minting out unique IDs when invoking `submit()`.
2025-05-07 16:33:28 -07:00
Michael Bolin
3a019d4220 merge commit for archive created by Sapling 2025-05-07 16:16:23 -07:00
Michael Bolin
0b42a4aef0 fix: creating an instance of Codex requires a Config 2025-05-07 16:16:17 -07:00
Michael Bolin
c6c05788e2 merge commit for archive created by Sapling 2025-05-07 16:12:14 -07:00
Michael Bolin
6783203c20 fix: creating an instance of Codex requires a Config 2025-05-07 16:11:58 -07:00
Michael Bolin
c3e10e180a fix: remove CodexBuilder and Recorder (#858)
These abstractions were originally created exclusively for the REPL,
which was removed in https://github.com/openai/codex/pull/754.
Currently, the create some unnecessary Tokio tasks, so we are better off
without them. (We can always bring this back if we have a new use case.)
2025-05-07 16:11:42 -07:00
Michael Bolin
1b7b2183e4 Merge 37683450dd into sapling-pr-archive-bolinfest 2025-05-07 15:58:33 -07:00
Michael Bolin
37683450dd fix: remove CodexBuilder and Recorder 2025-05-07 15:58:26 -07:00
Michael Bolin
a04d707d4a merge commit for archive created by Sapling 2025-05-07 14:41:03 -07:00
Michael Bolin
e2a5c000a0 feat: support map of alternative providers like in TypeScript CLI 2025-05-07 14:40:50 -07:00
Michael Bolin
42617f8726 feat: save session transcripts when using Rust CLI (#845)
This adds support for saving transcripts when using the Rust CLI. Like
the TypeScript CLI, it saves the transcript to `~/.codex/sessions`,
though it uses JSONL for the file format (and `.jsonl` for the file
extension) so that even if Codex crashes, what was written to the
`.jsonl` file should generally still be valid JSONL content.
2025-05-07 13:49:15 -07:00
Michael Bolin
ac451d13bf merge commit for archive created by Sapling 2025-05-07 12:58:09 -07:00
Michael Bolin
5b87df89b4 fix: make McpConnectionManager tolerant of MCPs that fail to start 2025-05-07 12:57:59 -07:00
Michael Bolin
9da6ebef3f fix: add optional timeout to McpClient::send_request() (#852)
We now impose a 10s timeout on the initial `tools/list` request to an
MCP server. We do not apply a timeout for other types of requests yet,
but we should start enforcing those, as well.
2025-05-07 12:56:38 -07:00
Michael Bolin
4170c74be5 Merge 8111a04d3e into sapling-pr-archive-bolinfest 2025-05-07 12:55:36 -07:00
Michael Bolin
8111a04d3e feat: save rollouts in Rust CLI 2025-05-07 12:55:31 -07:00
Michael Bolin
7499042ed3 merge commit for archive created by Sapling 2025-05-07 12:55:01 -07:00
Michael Bolin
5743c170e5 feat: support map of alternative providers like in TypeScript CLI 2025-05-07 12:54:56 -07:00
Michael Bolin
e74f213cc9 Merge ea13757d3f into sapling-pr-archive-bolinfest 2025-05-07 12:52:58 -07:00
Michael Bolin
ea13757d3f fix: add optional timeout to McpClient::send_request() 2025-05-07 12:52:11 -07:00