Commit Graph
1220 Commits
Author SHA1 Message Date
Michael Bolin 72109de30d merge commit for archive created by Sapling 2025-05-14 23:56:35 -07:00
Michael Bolin cf63787d9a chore: expose codex_home via Config 2025-05-14 23:56:30 -07:00
Michael Bolin 9f4eba52fb merge commit for archive created by Sapling 2025-05-14 23:53:10 -07:00
Michael Bolin 499d7e1443 chore: expose codex_home via Config 2025-05-14 23:53:04 -07:00
Michael Bolin 5c65b7364f Merge f38b3b31eb into sapling-pr-archive-bolinfest 2025-05-14 23:51:28 -07:00
Michael Bolin f38b3b31eb chore: expose codex_home via Config 2025-05-14 23:51:24 -07:00
Michael Bolin 93eaf02fae merge commit for archive created by Sapling 2025-05-14 23:51:16 -07:00
Michael Bolin 5fb7d700e9 chore: expose codex_home via Config 2025-05-14 23:51:09 -07:00
Michael Bolin e7666e0af9 merge commit for archive created by Sapling 2025-05-14 23:11:35 -07:00
Michael Bolin 09c93d5453 chore: expose codex_home via Config 2025-05-14 23:11:25 -07:00
Michael Bolin 48781cbfe4 merge commit for archive created by Sapling 2025-05-14 22:14:33 -07:00
Michael Bolin e93540a32a chore: expose codex_home via Config 2025-05-14 22:14:28 -07:00
Michael Bolin bbca9be417 merge commit for archive created by Sapling 2025-05-14 22:02:27 -07:00
Michael Bolin da6fb2842c chore: expose codex_home via Config 2025-05-14 22:02:23 -07:00
Michael Bolin 0019079e45 Merge a238877fcc into sapling-pr-archive-bolinfest 2025-05-14 22:01:20 -07:00
Michael Bolin a238877fcc chore: expose codex_home via Config 2025-05-14 22:00:46 -07:00
Michael Bolin 2beab253ec Merge 623eec23c4 into sapling-pr-archive-bolinfest 2025-05-14 18:03:31 -07:00
Michael Bolin 623eec23c4 feat: record messages from user in ~/.codex/history.jsonl 2025-05-14 18:02:07 -07:00
Michael Bolin 0b9ef93da5 fix: properly wrap lines in the Rust TUI (#937)
As discussed on
https://github.com/openai/codex/commit/699ec5a87f09796d17c0202cd92a1dd4d8b4f3f5#commitcomment-156776835,
to properly support scrolling long content in Ratatui for a sequence of
cells, we need to:

* take the `Vec<Line>` for each cell
* using the wrapping logic we want to use at render time, compute the
_effective line count_ using `Paragraph::line_count()` (see
`wrapped_line_count_for_cell()` in this PR)
* sum up the effective line count to compute the height of the area
being scrolled
* given a `scroll_position: usize`, index into the list of "effective
lines" and accumulate the appropriate `Vec<Line>` for the cells that
should be displayed
* take that `Vec<Line>` to create a `Paragraph` and use the same
line-wrapping policy that was used in `wrapped_line_count_for_cell()`
* display the resulting `Paragraph` and use the accounting to display a
scrollbar with the appropriate thumb size and offset without having to
render the `Vec<Line>` for the full history

With this change, lines wrap as I expect and everything appears to
redraw correctly as I resize my terminal!
codex-rs-cb19037ca3822e9b19b51417392f8afc046be607-1-rust-v0.0.2505141652
2025-05-14 16:51:41 -07:00
Michael Bolin 60e16f4c88 merge commit for archive created by Sapling 2025-05-14 16:33:01 -07:00
Michael Bolin 90b2852e40 fix: wrap lines in the TUI 2025-05-14 16:32:56 -07:00
Michael Bolin f74680305f merge commit for archive created by Sapling 2025-05-14 16:22:04 -07:00
Michael Bolin d423414fda fix: wrap lines in the TUI 2025-05-14 16:21:59 -07:00
Michael Bolin 61a86215ed merge commit for archive created by Sapling 2025-05-14 16:09:52 -07:00
Michael Bolin c864c95e68 fix: wrap lines in the TUI 2025-05-14 16:09:46 -07:00
Michael Bolin b333996afa merge commit for archive created by Sapling 2025-05-14 15:53:32 -07:00
Michael Bolin 798da3b257 fix: wrap lines in the TUI 2025-05-14 15:53:27 -07:00
Michael Bolin 95db224292 merge commit for archive created by Sapling 2025-05-14 15:46:01 -07:00
Michael Bolin f09d714d79 fix: wrap lines in the TUI 2025-05-14 15:45:56 -07:00
Michael Bolin 4be52164c4 merge commit for archive created by Sapling 2025-05-14 15:42:19 -07:00
Michael Bolin f221a9c077 fix: wrap lines in the TUI 2025-05-14 15:42:12 -07:00
Michael Bolin 6139fa2912 merge commit for archive created by Sapling 2025-05-14 15:21:57 -07:00
Michael Bolin 341f143f5b fix: wrap lines in the TUI 2025-05-14 15:21:52 -07:00
Michael Bolin 38214bf6ec Merge 8b37e89317 into sapling-pr-archive-bolinfest 2025-05-14 15:20:35 -07:00
Michael Bolin 8b37e89317 fix: wrap lines in the TUI 2025-05-14 15:20:25 -07:00
Michael Bolin 34aa1991f1 chore: handle all cases for EventMsg (#936)
For now, this removes the `#[non_exhaustive]` directive on `EventMsg` so
that we are forced to handle all `EventMsg` by default. (We may revisit
this if/when we publish `core/` as a `lib` crate.) For now, it is
helpful to have this as a forcing function because we have effectively
two UIs (`tui` and `exec`) and usually when we add a new variant to
`EventMsg`, we want to be sure that we update both.
codex-rs-3a70a0bc280734d09448cb08ec05b5c44f7c798e-1-rust-v0.0.2505141337
2025-05-14 13:36:43 -07:00
Michael Bolin 0c01bc18aa Merge aa315e8ef4 into sapling-pr-archive-bolinfest 2025-05-14 13:24:03 -07:00
Michael Bolin aa315e8ef4 chore: handle all cases for EventMsg 2025-05-14 13:23:46 -07:00
Michael Bolin 497c5396c0 feat: add mcp subcommand to CLI to run Codex as an MCP server (#934)
Previously, running Codex as an MCP server required a standalone binary
in our Cargo workspace, but this PR makes it available as a subcommand
(`mcp`) of the main CLI.

Ran this with:

```
RUST_LOG=debug npx @modelcontextprotocol/inspector cargo run --bin codex -- mcp
```

and verified it worked as expected in the inspector at
`http://127.0.0.1:6274/`.
2025-05-14 13:15:41 -07:00
Michael Bolin 08c492bc05 Merge 837612a134 into sapling-pr-archive-bolinfest 2025-05-14 13:04:52 -07:00
Michael Bolin 837612a134 feat: add mcp subcommand to CLI to run Codex as an MCP server 2025-05-14 13:04:45 -07:00
Michael Bolin 162ed06816 Merge 776c86b217 into sapling-pr-archive-bolinfest 2025-05-14 13:01:05 -07:00
Michael Bolin 776c86b217 feat: add mcp subcommand to CLI to run Codex as an MCP server 2025-05-14 12:59:59 -07:00
Michael Bolin a12e4b0b31 feat: add support for commands in the Rust TUI (#935)
Introduces support for slash commands like in the TypeScript CLI. We do
not support the full set of commands yet, but the core abstraction is
there now.

In particular, we have a `SlashCommand` enum and due to thoughtful use
of the [strum](https://crates.io/crates/strum) crate, it requires
minimal boilerplate to add a new command to the list.

The key new piece of UI is `CommandPopup`, though the keyboard events
are still handled by `ChatComposer`. The behavior is roughly as follows:

* if the first character in the composer is `/`, the command popup is
displayed (if you really want to send a message to Codex that starts
with a `/`, simply put a space before the `/`)
* while the popup is displayed, up/down can be used to change the
selection of the popup
* if there is a selection, hitting tab completes the command, but does
not send it
* if there is a selection, hitting enter sends the command
* if the prefix of the composer matches a command, the command will be
visible in the popup so the user can see the description (commands could
take arguments, so additional text may appear after the command name
itself)


https://github.com/user-attachments/assets/39c3e6ee-eeb7-4ef7-a911-466d8184975f

Incidentally, Codex wrote almost all the code for this PR!
2025-05-14 12:55:49 -07:00
Michael Bolin 8b30683505 merge commit for archive created by Sapling 2025-05-14 12:37:30 -07:00
Michael Bolin 58feb623ee feat: add support for commands in the Rust TUI 2025-05-14 12:37:25 -07:00
Michael Bolin 59a648d6c3 merge commit for archive created by Sapling 2025-05-14 12:33:23 -07:00
Michael Bolin b9b493058e feat: add support for commands in the Rust TUI 2025-05-14 12:33:18 -07:00
Michael Bolin 7bd4981950 merge commit for archive created by Sapling 2025-05-14 12:21:17 -07:00
Michael Bolin dd4fd9edfc feat: add support for commands in the Rust TUI 2025-05-14 12:21:09 -07:00