Commit Graph
2066 Commits
Author SHA1 Message Date
Michael Bolin 24c0c2985a Merge 4a70da083e into sapling-pr-archive-bolinfest 2025-07-19 00:18:31 -04:00
Michael Bolin 4a70da083e feat: leverage elicitations in the MCP server 2025-07-19 00:10:47 -04:00
Michael Bolin 3fe0feabbc chore: introduce OutgoingMessageSender 2025-07-19 00:10:47 -04:00
Michael Bolin e78ec00e73 chore: support MCP schema 2025-06-18 (#1621)
This updates the schema in `generate_mcp_types.py` from `2025-03-26` to
`2025-06-18`, regenerates `mcp-types/src/lib.rs`, and then updates all
the code that uses `mcp-types` to honor the changes.

Ran

```
npx @modelcontextprotocol/inspector just codex mcp
```

and verified that I was able to invoke the `codex` tool, as expected.


---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/1621).
* #1623
* #1622
* __->__ #1621
2025-07-19 00:09:34 -04:00
Michael Bolin 471f185b0a merge commit for archive created by Sapling 2025-07-18 23:44:00 -04:00
Michael Bolin d7676ec022 feat: leverage elicitations in the MCP server 2025-07-18 23:43:46 -04:00
Michael Bolin bd223a2a10 chore: introduce OutgoingMessageSender 2025-07-18 23:43:46 -04:00
Michael Bolin 888326403d chore: support MCP schema 2025-06-18 2025-07-18 23:43:46 -04:00
Michael Bolin 85a8f7c167 Merge f9ad2814d6 into sapling-pr-archive-bolinfest 2025-07-18 23:30:59 -04:00
Michael Bolin f9ad2814d6 feat: leverage elicitations in the MCP server 2025-07-18 23:30:47 -04:00
Michael Bolin db02c0134f chore: introduce OutgoingMessageSender 2025-07-18 23:30:47 -04:00
Michael Bolin 494302de2d chore: support MCP schema 2025-06-18 2025-07-18 23:30:47 -04:00
Michael Bolin a06d4f58e4 chore: clean up generate_mcp_types.py so codegen matches existing output (#1620) 2025-07-18 21:40:39 -04:00
Michael Bolin 83e600e8cc Merge eff57db67d into sapling-pr-archive-bolinfest 2025-07-18 17:19:09 -07:00
Michael Bolin eff57db67d feat: leverage elicitations in the MCP server 2025-07-18 17:05:41 -07:00
Michael Bolin 87ca807e36 chore: introduce OutgoingMessageSender 2025-07-18 17:05:41 -07:00
Michael Bolin ed18a038b8 chore: support MCP schema 2025-06-18 2025-07-18 17:05:41 -07:00
Michael Bolin 29ff032412 chore: clean up generate_mcp_types.py so codegen matches existing output 2025-07-18 17:05:41 -07:00
aibrahim-oai 83eefb55fb Add session loading support to Codex (#1602)
## Summary
- extend rollout format to store all session data in JSON
- add resume/write helpers for rollouts
- track session state after each conversation
- support `LoadSession` op to resume a previous rollout
- allow starting Codex with an existing session via
`experimental_resume` config variable

We need a way later for exploring the available sessions in a user
friendly way.

## Testing
- `cargo test --no-run` *(fails: `cargo: command not found`)*

------
https://chatgpt.com/codex/tasks/task_i_68792a29dd5c832190bf6930d3466fba

This video is outdated. you should use `-c experimental_resume:<full
path>` instead of `--resume <full path>`


https://github.com/user-attachments/assets/7a9975c7-aa04-4f4e-899a-9e87defd947a
2025-07-18 17:04:04 -07:00
aibrahim-oaiandMichael Bolin 9846adeabf Refactor env settings into config (#1601)
## Summary
- add OpenAI retry and timeout fields to Config
- inject these settings in tests instead of mutating env vars
- plumb Config values through client and chat completions logic
- document new configuration options

## Testing
- `cargo test -p codex-core --no-run`

------
https://chatgpt.com/codex/tasks/task_i_68792c5b04cc832195c03050c8b6ea94

---------

Co-authored-by: Michael Bolin <mbolin@openai.com>
2025-07-18 19:12:39 +00:00
aibrahim-oai d5a2148deb Fix ctrl+c interrupt while streaming (#1617)
Interrupting while streaming now causes is broken because we aren't
clearing the delta buffer.
2025-07-18 12:08:25 -07:00
Michael Bolin cc874c9205 chore: use AtomicBool instead of Mutex<bool> (#1616) 2025-07-18 11:13:34 -07:00
Michael Bolin 76da4a5d8c Merge 0e2a52a835 into sapling-pr-archive-bolinfest 2025-07-18 10:44:02 -07:00
Michael Bolin 0e2a52a835 chore: use AtomicBool instead of Mutex<bool> 2025-07-18 10:43:56 -07:00
pakrym-oai 6f2b01bb6b feat: ensure session ID header is sent in Response API request (#1614)
Include the current session id in Responses API requests.
2025-07-18 09:59:07 -07:00
Michael Bolin fc1cadb0eb Merge 20afce7105 into sapling-pr-archive-bolinfest 2025-07-18 09:01:03 -07:00
Michael Bolin 20afce7105 fix: disable debouncing RequestRedraw in the TUI for now 2025-07-18 09:00:53 -07:00
aibrahim-oai 9cedeadf6a change the default debounce rate to 10ms (#1606)
changed the default debounce rate to 10ms because typing was laggy.

Before:


https://github.com/user-attachments/assets/e5d15fcb-6a2b-4837-b2b4-c3dcb4cc3409

After



https://github.com/user-attachments/assets/6f0005eb-fd49-4130-ba68-635ee0f2831f
2025-07-17 17:00:17 -07:00
pakrym-oai 327e2254f6 chore: rename toolchain file (#1604)
Rename toolchain file so older versions of cargo can pick it up.
2025-07-17 15:36:15 -07:00
Michael Bolin e16657ca45 feat: add --json flag to codex exec (#1603)
This is designed to facilitate programmatic use of Codex in a more
lightweight way than using `codex mcp`.

Passing `--json` to `codex exec` will print each event as a line of JSON
to stdout. Note that it does not print the individual tokens as they are
streamed, only full messages, as this is aimed at programmatic use
rather than to power UI.

<img width="1348" height="1307" alt="image"
src="https://github.com/user-attachments/assets/fc7908de-b78d-46e4-a6ff-c85de28415c7"
/>

I changed the existing `EventProcessor` into a trait and moved the
implementation to `EventProcessorWithHumanOutput`. Then I introduced an
alternative implementation, `EventProcessorWithJsonOutput`. The `--json`
flag determines which implementation to use.
2025-07-17 15:10:15 -07:00
Michael Bolin da894c8da7 merge commit for archive created by Sapling 2025-07-17 14:54:29 -07:00
Michael Bolin 5608e220db feat: add --json flag to codex exec 2025-07-17 14:54:10 -07:00
Michael Bolin 83ffef5ac6 merge commit for archive created by Sapling 2025-07-17 14:44:41 -07:00
Michael Bolin 33d8a4dc3f feat: add --json flag to codex exec 2025-07-17 14:44:35 -07:00
Michael Bolin eef67167cc merge commit for archive created by Sapling 2025-07-17 14:42:02 -07:00
Michael Bolin 65395df3ec feat: add --json flag to codex exec 2025-07-17 14:41:54 -07:00
aibrahim-oaiandMichael Bolin bb30ab9e96 Implement redraw debounce (#1599)
## Summary
- debouce redraw events so repeated requests don't overwhelm the
terminal
- add `RequestRedraw` event and schedule redraws after 100ms

## Testing
- `cargo clippy --tests`
- `cargo test` *(fails: Sandbox Denied errors in landlock tests)*

------
https://chatgpt.com/codex/tasks/task_i_68792a65b8b483218ec90a8f68746cd8

---------

Co-authored-by: Michael Bolin <mbolin@openai.com>
2025-07-17 12:54:55 -07:00
Michael Bolin f21b57d2ce Merge a825cc8f5a into sapling-pr-archive-bolinfest 2025-07-17 12:14:33 -07:00
Michael Bolin a825cc8f5a feat: add --json flag to codex exec 2025-07-17 12:14:27 -07:00
pakrym-oai 6949329a7f chore: auto format code on save and add more details to AGENTS.md (#1582)
Adds a default vscode config with generally applicable settings.
Adds more entrypoints to justfile both  for environment setup and to help
agents better verify changes.
2025-07-17 11:40:00 -07:00
pakrym-oai b95a010e86 fix: trim MCP tool names to fit into tool name length limit (#1571)
Store fully qualified names along with tool entries so we don't have to re-parse them.

Fixes: https://github.com/openai/codex/issues/1289
2025-07-17 11:35:38 -07:00
aibrahim-oai fcbcc40f51 Storing the sessions in a more organized way for easier look up. (#1596)
now storing the sessions in `~/.codex/sessions/YYYY/MM/DD/<file>`
2025-07-17 10:12:15 -07:00
aibrahim-oai 643ab1f582 Add streaming to exec and tui (#1594)
Added support for streaming in `tui`
Added support for streaming in `exec`


https://github.com/user-attachments/assets/4215892e-d940-452c-a1d0-416ed0cf14eb
2025-07-16 22:26:31 -07:00
Michael Bolin d3dbc10479 fix: update bin/codex.js so it listens for exit on the child process (#1590)
When Codex CLI is installed via `npm`, we use a `.js` wrapper script to
launch the Rust binary.

- Previously, we were not listening for signals to ensure that killing
the Node.js process would also kill the underlying Rust process.
- We also did not have a proper `exit` handler in place on the child
process to ensure we exited from the Node.js process.

This PR fixes these things and hopefully addresses
https://github.com/openai/codex/issues/1570.

This also adds logic so that Windows falls back to the TypeScript CLI
again, which should address https://github.com/openai/codex/issues/1573.
2025-07-16 16:35:29 -07:00
Michael Bolin 0a8d23f536 merge commit for archive created by Sapling 2025-07-16 16:21:32 -07:00
Michael Bolin 1b1642ff1b fix: update bin/codex.js so it listens for exit on the child process 2025-07-16 16:21:24 -07:00
Preet 🚀andMichael Bolin 0bc7ee9193 Added mcp-server name validation (#1591)
This PR implements server name validation for MCP (Model Context
Protocol) servers to ensure they conform to the required pattern
^[a-zA-Z0-9_-]+$. This addresses the TODO comment in
mcp_connection_manager.rs:82.

+ Added validation before spawning MCP client tasks
+ Invalid server names are added to errors map with descriptive messages

I have read the CLA Document and I hereby sign the CLA

---------

Co-authored-by: Michael Bolin <bolinfest@gmail.com>
2025-07-16 16:00:39 -07:00
Michael Bolin 19343b3fa0 merge commit for archive created by Sapling 2025-07-16 15:44:24 -07:00
Michael Bolin 152b2e684e fix: update bin/codex.js so it listens for exit on the child process 2025-07-16 15:44:18 -07:00
aibrahim-oai 2bd3314886 support deltas in core (#1587)
- Added support for message and reasoning deltas
- Skipped adding the support in the cli and tui for later
- Commented a failing test (wrong merge) that needs fix in a separate
PR.

Side note: I think we need to disable merge when the CI don't pass.
2025-07-16 15:11:18 -07:00