Commit Graph

2053 Commits

Author SHA1 Message Date
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-oai
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-oai
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 🚀
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
Michael Bolin
acd7e2b6e3 Merge 40e9f725ae into sapling-pr-archive-bolinfest 2025-07-16 09:36:43 -07:00
Michael Bolin
40e9f725ae fix: update bin/codex.js so it listens for exit on the child process 2025-07-16 09:33:51 -07:00
Michael Bolin
5b820c5ce7 feat: ctrl-d only exits when there is no user input (#1589)
While this does make it so that `ctrl-d` will not exit Codex when the
composer is not empty, `ctrl-d` will still exit Codex if it is in the
"working" state.

Fixes https://github.com/openai/codex/issues/1443.
2025-07-16 08:59:26 -07:00
Michael Bolin
b0ab509dfa merge commit for archive created by Sapling 2025-07-16 08:48:08 -07:00
Michael Bolin
fb5ba7a999 feat: ctrl-d only exits when there is no user input 2025-07-16 08:47:57 -07:00
Michael Bolin
3db15fa6c9 merge commit for archive created by Sapling 2025-07-16 08:42:01 -07:00
Michael Bolin
88d8d50c4f feat: ctrl-d only exits when there is no user input 2025-07-16 08:41:53 -07:00
Michael Bolin
ed0e963dc6 Merge 907fe66ae8 into sapling-pr-archive-bolinfest 2025-07-16 08:40:02 -07:00
Michael Bolin
907fe66ae8 feat: ctrl-d only exits when there is no user input 2025-07-16 08:39:53 -07:00
aibrahim-oai
f14b5adabf Add SSE Response parser tests (#1541)
## Summary
- add `tokio-test` dev dependency
- implement response stream parsing unit tests

## Testing
- `cargo clippy -p codex-core --tests -- -D warnings`
- `cargo test -p codex-core -- --nocapture`

------
https://chatgpt.com/codex/tasks/task_i_687163f3b2208321a6ce2adbef3fbc06
2025-07-14 14:51:32 -07:00
Michael Bolin
9c0b413fd1 docs: clarify the build process for the npm release (#1568)
It appears that `0.5.0` was built with `stage_release.sh` instead of
`stage_rust_release.py`, so add docs to clarify this and recommend
running `--version` on the release candidate to verify the right thing
was built.
2025-07-14 09:41:11 -07:00
Michael Bolin
b59be49dba Merge ff99fae4e4 into sapling-pr-archive-bolinfest 2025-07-14 09:39:50 -07:00
Michael Bolin
ff99fae4e4 docs: clarify the build process for the npm release 2025-07-14 09:39:42 -07:00