Commit Graph

8634 Commits

Author SHA1 Message Date
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
Michael Bolin
5b20a3930b merge commit for archive created by Sapling 2025-05-14 12:13:09 -07:00
Michael Bolin
0673a56351 feat: add support for commands in the Rust TUI 2025-05-14 12:13:04 -07:00
Michael Bolin
618686141a merge commit for archive created by Sapling 2025-05-14 12:11:26 -07:00
Michael Bolin
42cd07527c feat: add support for commands in the Rust TUI 2025-05-14 12:10:27 -07:00
Michael Bolin
d889960200 merge commit for archive created by Sapling 2025-05-14 11:55:24 -07:00
Michael Bolin
739345d1f6 feat: add support for commands in the Rust TUI 2025-05-14 11:55:19 -07:00
Michael Bolin
06c3847b7c Merge 29d10d55a3 into sapling-pr-archive-bolinfest 2025-05-14 11:44:15 -07:00
Michael Bolin
29d10d55a3 feat: add support for commands in the Rust TUI 2025-05-14 11:43:28 -07:00
Michael Bolin
d48f39caf7 Merge 7c34ec776d into sapling-pr-archive-bolinfest 2025-05-14 10:54:45 -07:00
Michael Bolin
7c34ec776d feat: add mcp subcommand to CLI to run Codex as an MCP server 2025-05-14 10:54:37 -07:00
Michael Bolin
0402aef126 chore: move each view used in BottomPane into its own file (#928)
`BottomPane` was getting a bit unwieldy because it maintained a
`PaneState` enum with three variants and many of its methods had `match`
statements to handle each variant. To replace the enum, this PR:

* Introduces a `trait BottomPaneView` that has two implementations:
`StatusIndicatorView` and `ApprovalModalView`.
* Migrates `PaneState::TextInput` into its own struct, `ChatComposer`,
that does **not** implement `BottomPaneView`.
* Updates `BottomPane` so it has `composer: ChatComposer` and
`active_view: Option<Box<dyn BottomPaneView<'a> + 'a>>`. The idea is
that `active_view` takes priority and is displayed when it is `Some`;
otherwise, `ChatComposer` is displayed.
* While methods of `BottomPane` often have to check whether
`active_view` is present to decide which component to delegate to, the
code is more straightforward than before and introducing new
implementations of `BottomPaneView` should be less painful.

Because we want to retain the `TextArea` owned by `ChatComposer` even
when another view is displayed, to keep the ownership logic simple, it
seemed best to keep `ChatComposer` distinct from `BottomPaneView`.
2025-05-14 10:13:29 -07:00
Michael Bolin
13ec2cd577 Merge f9196813ab into sapling-pr-archive-bolinfest 2025-05-14 10:06:37 -07:00
Michael Bolin
f9196813ab chore: move each view used in BottomPane into its own file 2025-05-14 10:06:20 -07:00
Michael Bolin
399e819c9b fix: increase timeout for test_dev_null_write (#933)
After updating this test in https://github.com/openai/codex/pull/923, I
have been getting some timeouts with this test in CI, so increasing the
timeout to match that of `test_writable_root`:


327cf41f0f/codex-rs/core/src/landlock.rs (L211-L213)
2025-05-14 10:06:14 -07:00
Michael Bolin
9e90befce9 Merge d1d918f09a into sapling-pr-archive-bolinfest 2025-05-14 10:03:39 -07:00
Michael Bolin
d1d918f09a fix: increase timeout for test_dev_null_write 2025-05-14 10:03:32 -07:00
Michael Bolin
7849b06fcf merge commit for archive created by Sapling 2025-05-14 09:56:22 -07:00
Michael Bolin
a961801cd0 chore: move each view used in BottomPane into its own file 2025-05-14 09:56:04 -07:00
Michael Bolin
31c72bc460 Merge 57311cb597 into sapling-pr-archive-bolinfest 2025-05-14 09:40:48 -07:00
Michael Bolin
57311cb597 chore: move each view used in BottomPane into its own file 2025-05-14 09:40:43 -07:00
Yaroslav Halchenko
327cf41f0f Add codespell support (config, workflow to detect/not fix) and make it fix some typos (#903)
More about codespell: https://github.com/codespell-project/codespell .

I personally introduced it to dozens if not hundreds of projects already
and so far only positive feedback.

CI workflow has 'permissions' set only to 'read' so also should be safe.

Let me know if just want to take typo fixes in and get rid of the CI

---------

Signed-off-by: Yaroslav O. Halchenko <debian@onerussian.com>
2025-05-14 09:39:49 -07:00
Michael Bolin
0f92262cc1 merge commit for archive created by Sapling 2025-05-14 09:24:10 -07:00
Michael Bolin
e52d31211f chore: move each view used in BottomPane into its own file 2025-05-14 09:24:02 -07:00
Fouad Matin
9e7cd2b25a bump(version): 0.1.2505140839 (#932)
## `0.1.2505140839`

### 🪲 Bug Fixes

- Gpt-4.1 apply_patch handling (#930)
- Add support for fileOpener in config.json (#911)
- Patch in #366 and #367 for marked-terminal (#916)
- Remember to set lastIndex = 0 on shared RegExp (#918)
- Always load version from package.json at runtime (#909)
- Tweak the label for citations for better rendering (#919)
- Tighten up some logic around session timestamps and ids (#922)
- Change EventMsg enum so every variant takes a single struct (#925)
- Reasoning default to medium, show workdir when supplied (#931)
- Test_dev_null_write() was not using echo as intended (#923)
2025-05-14 08:44:52 -07:00
Fouad Matin
73259351ff fix: reasoning default to medium, show workdir when supplied (#931) 2025-05-14 08:38:41 -07:00
Fouad Matin
77347d268d fix: gpt-4.1 apply_patch handling (#930) 2025-05-14 08:34:09 -07:00
Fouad Matin
678f0dbfec add: dynamic instructions (#927) 2025-05-14 01:27:46 -07:00
Michael Bolin
9c680d438a merge commit for archive created by Sapling 2025-05-13 23:27:07 -07:00
Michael Bolin
603d60f590 chore: move each view used in BottomPane into its own file 2025-05-13 23:27:03 -07:00
Michael Bolin
1801ad556d merge commit for archive created by Sapling 2025-05-13 23:26:26 -07:00
Michael Bolin
118fd6625c chore: move each view used in BottomPane into its own file 2025-05-13 23:26:22 -07:00
Michael Bolin
16cb63bdd3 merge commit for archive created by Sapling 2025-05-13 23:24:08 -07:00
Michael Bolin
1a76d2ad48 chore: move each view used in BottomPane into its own file 2025-05-13 23:24:02 -07:00
Michael Bolin
647d611875 merge commit for archive created by Sapling 2025-05-13 23:23:01 -07:00
Michael Bolin
45140daeb3 chore: move each view used in BottomPane into its own file 2025-05-13 23:22:56 -07:00
Michael Bolin
8ababe50d1 merge commit for archive created by Sapling 2025-05-13 23:19:45 -07:00