Commit Graph
4108 Commits
Author SHA1 Message Date
Michael Bolin 50f322ffeb merge commit for archive created by Sapling 2025-09-30 16:11:53 -07:00
Michael Bolin ebe0b017d2 fix: use macros to ensure request/response symmetry 2025-09-30 16:11:47 -07:00
Michael Bolin 179ff90dac merge commit for archive created by Sapling 2025-09-30 15:46:42 -07:00
Michael Bolin 33aa4368bb fix: use macros to ensure request/response symmetry 2025-09-30 15:46:35 -07:00
Michael Bolin 96a42adcec merge commit for archive created by Sapling 2025-09-30 15:28:11 -07:00
Michael Bolin 8313386c38 fix: use macros to ensure request/response symmetry 2025-09-30 15:27:26 -07:00
Michael Bolin b8e1fe60c5 fix: enable process hardening in Codex CLI for release builds (#4521)
I don't believe there is any upside in making process hardening opt-in
for Codex CLI releases. If you want to tinker with Codex CLI, then build
from source (or run as `root`)?
2025-09-30 14:34:35 -07:00
Michael Bolin ddfb7eb548 fix: clean up TypeScript exports (#4518)
Fixes:

- Removed overdeclaration of types that were unnecessary because they
were already included by induction.
- Reordered list of response types to match the enum order, making it
easier to identify what was missing.
- Added `ExecArbitraryCommandResponse` because it was missing.
- Leveraged `use codex_protocol::mcp_protocol::*;` to make the file more
readable.
- Removed crate dependency on `mcp-types` now that we have separate the
app server from the MCP server:
https://github.com/openai/codex/pull/4471

My next move is to come up with some scheme that ensures request types
always have a response type and that the response type is automatically
included with the output of `codex generate-ts`.
2025-09-30 14:08:43 -07:00
Michael Bolin 8c2bcf731c Merge 0dd49683a5 into sapling-pr-archive-bolinfest 2025-09-30 13:58:54 -07:00
Michael Bolin 0dd49683a5 fix: enable process hardening in Codex CLI for release builds 2025-09-30 13:58:47 -07:00
Michael Bolin a8605ab845 Merge 585cdc7d25 into sapling-pr-archive-bolinfest 2025-09-30 13:26:42 -07:00
Michael Bolin 585cdc7d25 fix: clean up TypeScript exports 2025-09-30 13:26:39 -07:00
Michael Bolin 3048adefad merge commit for archive created by Sapling 2025-09-30 13:24:01 -07:00
Michael Bolin 9b958abf55 fix: clean up TypeScript exports 2025-09-30 13:23:56 -07:00
Michael Bolin 8dd59bc87c merge commit for archive created by Sapling 2025-09-30 13:21:16 -07:00
Michael Bolin 6681c8a929 fix: clean up TypeScript exports 2025-09-30 13:21:11 -07:00
Michael Bolin e9ba8c8bdc merge commit for archive created by Sapling 2025-09-30 13:20:48 -07:00
Michael Bolin da231e54ab fix: clean up TypeScript exports 2025-09-30 13:20:44 -07:00
Michael Bolin 65ec8348a9 merge commit for archive created by Sapling 2025-09-30 13:20:21 -07:00
Michael Bolin fb163b16da fix: clean up TypeScript exports 2025-09-30 13:20:10 -07:00
Michael Bolin 4df4b6257f Merge 7c4c595abd into sapling-pr-archive-bolinfest 2025-09-30 13:16:48 -07:00
Michael Bolin 7c4c595abd fix: clean up TypeScript exports 2025-09-30 13:16:41 -07:00
Michael Bolin d4e7c6bfde Merge d059efe086 into sapling-pr-archive-bolinfest 2025-09-30 12:55:54 -07:00
Michael Bolin d059efe086 fix: clean up TypeScript exports 2025-09-30 12:55:45 -07:00
Michael Bolin 6910be3224 fix: ensure every variant of ClientRequest has a params field (#4512)
This ensures changes the generated TypeScript type for `ClientRequest`
so that instead of this:

```typescript
/**
 * Request from the client to the server.
 */
export type ClientRequest =
  | { method: "initialize"; id: RequestId; params: InitializeParams }
  | { method: "newConversation"; id: RequestId; params: NewConversationParams }
  // ...
  | { method: "getUserAgent"; id: RequestId }
  | { method: "userInfo"; id: RequestId }
  // ...
```

we have this:

```typescript
/**
 * Request from the client to the server.
 */
export type ClientRequest =
  | { method: "initialize"; id: RequestId; params: InitializeParams }
  | { method: "newConversation"; id: RequestId; params: NewConversationParams }
  // ...
  | { method: "getUserAgent"; id: RequestId; params: undefined }
  | { method: "userInfo"; id: RequestId; params: undefined }
  // ...
```

which makes TypeScript happier when it comes to destructuring instances
of `ClientRequest` because it does not complain about `params` not being
guaranteed to exist anymore.
2025-09-30 12:03:32 -07:00
pakrym-oai a534356fe1 Wire up web search item (#4511)
Add handling for web search events.
2025-09-30 12:01:17 -07:00
Michael Bolin 7101030a0b merge commit for archive created by Sapling 2025-09-30 11:49:20 -07:00
Michael Bolin 4385103da3 fix: ensure every variant of ClientRequest has a params field 2025-09-30 11:49:09 -07:00
Michael Bolin 8c91d1a280 Merge 176571cd60 into sapling-pr-archive-bolinfest 2025-09-30 11:48:44 -07:00
Michael Bolin 176571cd60 fix: ensure every variant of ClientRequest has a params field 2025-09-30 11:48:36 -07:00
pakrym-oai c89b0e1235 [SDK] Test that a tread can be continued with extra params (#4508) 2025-09-30 17:22:14 +00:00
jif-oai f6a152848a chore: prompt update to enforce good usage of apply_patch (#3846)
Update prompt to prevent codex to use Python script or fancy commands to
edit files.

## Testing:
3 scenarios have been considered:
1. Rename codex to meca_code. Proceed to the whole refactor file by
file. Don't ask for approval at each step
2. Add a description to every single function you can find in the repo
3. Rewrite codex.rs in a more idiomatic way. Make sure to touch ONLY
this file and that clippy does not complain at the end

Before this update, 22% (estimation as it's sometimes hard to find all
the creative way the model find to edit files) of the file editions
where made using something else than a raw `apply_patch`

After this update, not a single edition without `apply_patch` was found

[EDIT]
I managed to have a few `["bash", "-lc", "apply_path"]` when reaching <
10% context left
2025-09-30 10:18:59 -07:00
dedrisian-oai 3592ecb23c Named args for custom prompts (#4474)
Here's the logic:

1. If text is empty and selector is open:
- Enter on a prompt without args should autosubmit the prompt
- Enter on a prompt with numeric args should add `/prompts:name ` to the
text input
- Enter on a prompt with named args should add `/prompts:name ARG1=""
ARG2=""` to the text input
2. If text is not empty but no args are passed:
- For prompts with numeric args -> we allow it to submit (params are
optional)
- For prompts with named args -> we throw an error (all params should
have values)

<img width="454" height="246" alt="Screenshot 2025-09-23 at 2 23 21 PM"
src="https://github.com/user-attachments/assets/fd180a1b-7d17-42ec-b231-8da48828b811"
/>
2025-09-30 10:06:41 -07:00
pakrym-oai 516acc030b Support model and sandbox mode in the sdk (#4503) 2025-09-30 09:00:39 -07:00
easong-openai 5b038135de Add cloud tasks (#3197)
Adds a TUI for managing, applying, and creating cloud tasks
2025-09-30 10:10:33 +00:00
Michael Bolin d9dbf48828 fix: separate codex mcp into codex mcp-server and codex app-server (#4471)
This is a very large PR with some non-backwards-compatible changes.

Historically, `codex mcp` (or `codex mcp serve`) started a JSON-RPC-ish
server that had two overlapping responsibilities:

- Running an MCP server, providing some basic tool calls.
- Running the app server used to power experiences such as the VS Code
extension.

This PR aims to separate these into distinct concepts:

- `codex mcp-server` for the MCP server
- `codex app-server` for the "application server"

Note `codex mcp` still exists because it already has its own subcommands
for MCP management (`list`, `add`, etc.)

The MCP logic continues to live in `codex-rs/mcp-server` whereas the
refactored app server logic is in the new `codex-rs/app-server` folder.
Note that most of the existing integration tests in
`codex-rs/mcp-server/tests/suite` were actually for the app server, so
all the tests have been moved with the exception of
`codex-rs/mcp-server/tests/suite/mod.rs`.

Because this is already a large diff, I tried not to change more than I
had to, so `codex-rs/app-server/tests/common/mcp_process.rs` still uses
the name `McpProcess` for now, but I will do some mechanical renamings
to things like `AppServer` in subsequent PRs.

While `mcp-server` and `app-server` share some overlapping functionality
(like reading streams of JSONL and dispatching based on message types)
and some differences (completely different message types), I ended up
doing a bit of copypasta between the two crates, as both have somewhat
similar `message_processor.rs` and `outgoing_message.rs` files for now,
though I expect them to diverge more in the near future.

One material change is that of the initialize handshake for `codex
app-server`, as we no longer use the MCP types for that handshake.
Instead, we update `codex-rs/protocol/src/mcp_protocol.rs` to add an
`Initialize` variant to `ClientRequest`, which takes the `ClientInfo`
object we need to update the `USER_AGENT_SUFFIX` in
`codex-rs/app-server/src/message_processor.rs`.

One other material change is in
`codex-rs/app-server/src/codex_message_processor.rs` where I eliminated
a use of the `send_event_as_notification()` method I am generally trying
to deprecate (because it blindly maps an `EventMsg` into a
`JSONNotification`) in favor of `send_server_notification()`, which
takes a `ServerNotification`, as that is intended to be a custom enum of
all notification types supported by the app server. So to make this
update, I had to introduce a new variant of `ServerNotification`,
`SessionConfigured`, which is a non-backwards compatible change with the
old `codex mcp`, and clients will have to be updated after the next
release that contains this PR. Note that
`codex-rs/app-server/tests/suite/list_resume.rs` also had to be update
to reflect this change.

I introduced `codex-rs/utils/json-to-toml/src/lib.rs` as a small utility
crate to avoid some of the copying between `mcp-server` and
`app-server`.
2025-09-30 07:06:18 +00:00
Michael Bolin 2817ec68a5 merge commit for archive created by Sapling 2025-09-29 23:55:03 -07:00
Michael Bolin e8b83439df fix: separate codex mcp into codex mcp-server and codex app-server 2025-09-29 23:54:54 -07:00
Gabriel Peal 2e95e5602d Update MCP docs to reference experimental RMCP client (#4422) 2025-09-30 02:44:16 -04:00
dedrisian-oai 87a654cf6b Move PR-style review to top (#4486)
<img width="469" height="330" alt="Screenshot 2025-09-29 at 10 31 22 PM"
src="https://github.com/user-attachments/assets/b5e20a08-85b4-4095-8a7f-0f58d1195b7e"
/>
2025-09-30 06:03:37 +00:00
Michael Bolin 8da4aaab85 Merge 32e0d6e73e into sapling-pr-archive-bolinfest 2025-09-29 22:05:38 -07:00
Michael Bolin 32e0d6e73e fix: separate codex mcp into codex mcp-server and codex app-server 2025-09-29 22:05:28 -07:00
Michael Bolin f0f0606f0c merge commit for archive created by Sapling 2025-09-29 22:05:17 -07:00
Michael Bolin 9a7aeeb569 fix: separate codex mcp into codex mcp-server and codex app-server 2025-09-29 22:05:12 -07:00
Michael Bolin afbc4ba438 merge commit for archive created by Sapling 2025-09-29 21:58:34 -07:00
Michael Bolin 676bbf8171 fix: separate codex mcp into codex mcp-server and codex app-server 2025-09-29 21:58:26 -07:00
Michael Bolin 6a0089f6d5 merge commit for archive created by Sapling 2025-09-29 21:30:38 -07:00
Michael Bolin f642adda36 fix: separate codex mcp into codex mcp-server and codex app-server 2025-09-29 21:30:32 -07:00
pakrym-oai 27c6c5d7a7 SDK CI (#4483)
Build debug codex in SDK configuration
2025-09-29 21:15:02 -07:00
pakrym-oai c09e131653 Set originator for codex exec (#4485)
Distinct from the main CLI.
2025-09-29 20:59:19 -07:00