Commit Graph
3317 Commits
Author SHA1 Message Date
Michael Bolin 387cbd2060 Merge 809f97d45e into sapling-pr-archive-bolinfest 2025-08-28 22:09:56 -07:00
Michael Bolin 809f97d45e fix: drop Mutex before calling tx_approve.send() 2025-08-28 22:09:50 -07:00
Michael Bolin 58fca4c9ab Merge 076d6d8ba7 into sapling-pr-archive-bolinfest 2025-08-28 21:55:53 -07:00
Michael Bolin 998d24ea7e Merge 89a47429fe into sapling-pr-archive-bolinfest 2025-08-28 21:54:34 -07:00
Michael Bolin 89a47429fe fix: remove unnecessary flush() calls
Because we are writing to a pipe, the `flush()` call is unnecessary, so removing
these saves us some syscalls.
2025-08-28 21:54:28 -07:00
Michael Bolin 076d6d8ba7 fix: switch to unbounded channel 2025-08-28 21:54:20 -07:00
Michael Bolin 5d2d3002ef fix: specify --profile to cargo clippy in CI (#2871)
Today we had a breakage in the release build that went unnoticed by CI.
Here is what happened:

- https://github.com/openai/codex/pull/2242 originally added some logic
to do release builds to prevent this from happening
- https://github.com/openai/codex/pull/2276 undid that change to try to
speed things up by removing the step to build all the individual crates
in release mode, assuming the `cargo check` call was sufficient
coverage, which it would have been, had it specified `--profile`

This PR adds `--profile` to the `cargo check` step so we should get the
desired coverage from our build matrix.

Indeed, enabling this in our CI uncovered a warning that is only present
in release mode that was going unnoticed.
2025-08-28 21:43:40 -07:00
agro bb30996f7c Bugfix: Prevents brew install codex in comment to be executed (#2868)
The default install command causes unexpected code to be executed:

```
npm install -g @openai/codex # Alternatively: `brew install codex`
```

The problem is some environment will treat # as literal string, not
start of comment. Therefore the user will execute this instead (because
it's in backtick)

```
brew install codex
```

And then the npm command will error (because it's trying to install
package #)
2025-08-28 21:40:28 -07:00
Michael Bolin ece1af810a Merge 55e3f36da1 into sapling-pr-archive-bolinfest 2025-08-28 21:33:25 -07:00
Michael Bolin 55e3f36da1 fix: specify --profile to cargo clippy in CI 2025-08-28 21:33:22 -07:00
Michael Bolin ae1d11f477 Merge c0c10f34cb into sapling-pr-archive-bolinfest 2025-08-28 21:26:39 -07:00
Michael Bolin c0c10f34cb fix: specify --profile to cargo clippy in CI 2025-08-28 21:26:29 -07:00
dedrisian-oai 3f8184034f Fix CI release build (#2864) 2025-08-29 03:06:10 +00:00
unshipandMichael Bolin f7cb2f87a0 Bug fix: clone of incoming_tx can lead to deadlock (#2747)
POC code

```rust
use tokio::sync::mpsc;
use std::time::Duration;

#[tokio::main]
async fn main() {
    println!("=== Test 1: Simulating original MCP server pattern ===");
    test_original_pattern().await;
}

async fn test_original_pattern() {
    println!("Testing the original pattern from MCP server...");
    
    // Create channel - this simulates the original incoming_tx/incoming_rx
    let (tx, mut rx) = mpsc::channel::<String>(10);
    
    // Task 1: Simulates stdin reader that will naturally terminate
    let stdin_task = tokio::spawn({
        let tx_clone = tx.clone();
        async move {
            println!("  stdin_task: Started, will send 3 messages then exit");
            for i in 0..3 {
                let msg = format!("Message {}", i);
                if tx_clone.send(msg.clone()).await.is_err() {
                    println!("  stdin_task: Receiver dropped, exiting");
                    break;
                }
                println!("  stdin_task: Sent {}", msg);
                tokio::time::sleep(Duration::from_millis(300)).await;
            }
            println!("  stdin_task: Finished (simulating EOF)");
            // tx_clone is dropped here
        }
    });
    
    // Task 2: Simulates message processor
    let processor_task = tokio::spawn(async move {
        println!("  processor_task: Started, waiting for messages");
        while let Some(msg) = rx.recv().await {
            println!("  processor_task: Processing {}", msg);
            tokio::time::sleep(Duration::from_millis(100)).await;
        }
        println!("  processor_task: Finished (channel closed)");
    });
    
    // Task 3: Simulates stdout writer or other background task
    let background_task = tokio::spawn(async move {
        for i in 0..2 {
            tokio::time::sleep(Duration::from_millis(500)).await;
            println!("  background_task: Tick {}", i);
        }
        println!("  background_task: Finished");
    });
    
    println!("  main: Original tx is still alive here");
    println!("  main: About to call tokio::join! - will this deadlock?");
    
    // This is the pattern from the original code
    let _ = tokio::join!(stdin_task, processor_task, background_task);
}

```

---------

Co-authored-by: Michael Bolin <bolinfest@gmail.com>
2025-08-28 19:28:17 -07:00
Ahmed Ibrahim 9dbe7284d2 Following up on #2371 post commit feedback (#2852)
- Introduce websearch end to complement the begin 
- Moves the logic of adding the sebsearch tool to
create_tools_json_for_responses_api
- Making it the client responsibility to toggle the tool on or off 
- Other misc in #2371 post commit feedback
- Show the query:

<img width="1392" height="151" alt="image"
src="https://github.com/user-attachments/assets/8457f1a6-f851-44cf-bcca-0d4fe460ce89"
/>
2025-08-28 19:24:38 -07:00
dedrisian-oai b8e8454b3f Custom /prompts (#2696)
Adds custom `/prompts` to `~/.codex/prompts/<command>.md`.

<img width="239" height="107" alt="Screenshot 2025-08-25 at 6 22 42 PM"
src="https://github.com/user-attachments/assets/fe6ebbaa-1bf6-49d3-95f9-fdc53b752679"
/>

---

Details:

1. Adds `Op::ListCustomPrompts` to core.
2. Returns `ListCustomPromptsResponse` with list of `CustomPrompt`
(name, content).
3. TUI calls the operation on load, and populates the custom prompts
(excluding prompts that collide with builtins).
4. Selecting the custom prompt automatically sends the prompt to the
agent.
2025-08-29 02:16:39 +00:00
HaxagonusD bbcfd63aba UI: Make slash commands bold in welcome message (#2762)
## What
Make slash commands (/init, /status, /approvals, /model) bold and white
in the welcome message for better visibility.
<img width="990" height="286" alt="image"
src="https://github.com/user-attachments/assets/13f90e96-b84a-4659-aab4-576d84a31af7"
/>


## Why
The current welcome message displays all text in a dimmed style, making
the slash commands less prominent. Users need to quickly identify
available commands when starting Codex.

## How
Modified `tui/src/history_cell.rs` in the `new_session_info` function
to:
- Split each command line into separate spans
- Apply bold white styling to command text (`/init`, `/status`, etc.)
- Keep descriptions dimmed for visual contrast
- Maintain existing layout and spacing

## Test plan
- [ ] Run the TUI and verify commands appear bold in the welcome message
- [ ] Ensure descriptions remain dimmed for readability
- [ ] Confirm all existing tests pass
2025-08-28 18:12:41 -07:00
Eric Traut 6209d49520 Changed OAuth success screen to use the string "Codex" rather than "Codex CLI" (#2737) 2025-08-28 21:21:10 +00:00
Gabriel Peal c3a8b96a60 Add a VS Code Extension issue template (#2853)
Template mostly copied from the bug template
2025-08-28 16:56:52 -04:00
Ahmed Ibrahim c9ca63dc1e burst paste edge cases (#2683)
This PR fixes two edge cases in managing burst paste (mainly on power
shell).
Bugs:
- Needs an event key after paste to render the pasted items

> ChatComposer::flush_paste_burst_if_due() flushes on timeout. Called:
>     - Pre-render in App on TuiEvent::Draw.
>     - Via a delayed frame
>
BottomPane::request_redraw_in(ChatComposer::recommended_paste_flush_delay()).

- Parses two key events separately before starting parsing burst paste

> When threshold is crossed, pull preceding burst chars out of the
textarea and prepend to paste_burst_buffer, then keep buffering.

- Integrates with #2567 to bring image pasting to windows.
2025-08-28 12:54:12 -07:00
Ahmed Ibrahim ed06f90fb3 Race condition in compact (#2746)
This fixes the flakiness in
`summarize_context_three_requests_and_instructions` because we should
trim history before sending task complete.
2025-08-28 12:53:00 -07:00
Michael Bolin f09170b574 chore: print stderr from MCP server to test output using eprintln! (#2849)
Related to https://github.com/openai/codex/pull/2848, I don't see the
stderr from `codex mcp` colocated with the other stderr from
`test_shell_command_approval_triggers_elicitation()` when it fails even
though we have `RUST_LOG=debug` set when we spawn `codex mcp`:


https://github.com/openai/codex/blob/1e9e703b969d3f0965b31d1cc3d70fed3ebdd6f6/codex-rs/mcp-server/tests/common/mcp_process.rs#L65

Let's try this new logic which should be more explicit.
2025-08-28 12:43:13 -07:00
Michael Bolin 9fbe68b431 Merge 91c5ac5d4e into sapling-pr-archive-bolinfest 2025-08-28 12:34:47 -07:00
Michael Bolin 91c5ac5d4e chore: print stderr from MCP server to test output using eprintln! 2025-08-28 12:34:42 -07:00
Michael Bolin 44d9829e38 Merge b926d1ed48 into sapling-pr-archive-bolinfest 2025-08-28 12:34:31 -07:00
Michael Bolin b926d1ed48 chore: print stderr from MCP server to test output using eprintln! 2025-08-28 12:34:24 -07:00
Michael Bolin 1e9e703b96 chore: try to make it easier to debug the flakiness of test_shell_command_approval_triggers_elicitation (#2848)
`test_shell_command_approval_triggers_elicitation()` is one of a number
of integration tests that we have observed to be flaky on GitHub CI, so
this PR tries to reduce the flakiness _and_ to provide us with more
information when it flakes. Specifically:

- Changed the command that we use to trigger the elicitation from `git
init` to `python3 -c 'import pathlib; pathlib.Path(r"{}").touch()'`
because running `git` seems more likely to invite variance.
- Increased the timeout to wait for the task response from 10s to 20s.
- Added more logging.
2025-08-28 12:33:33 -07:00
Michael Bolin 4da60b21aa merge commit for archive created by Sapling 2025-08-28 12:16:29 -07:00
Michael Bolin 9379b49c8a chore: try to make it easier to debug the flakiness of test_shell_command_approval_triggers_elicitation 2025-08-28 12:15:28 -07:00
Michael Bolin 61e75112e9 Merge 354c072b5c into sapling-pr-archive-bolinfest 2025-08-28 12:01:57 -07:00
Michael Bolin 354c072b5c chore: try to make it easier to debug the flakiness of test_shell_command_approval_triggers_elicitation 2025-08-28 12:01:49 -07:00
Michael Bolin 916d26d57d Merge 064458e825 into sapling-pr-archive-bolinfest 2025-08-28 12:01:45 -07:00
Michael Bolin 064458e825 chore: try to make it easier to debug the flakiness of test_shell_command_approval_triggers_elicitation 2025-08-28 12:01:35 -07:00
Michael Bolin 74d2741729 chore: require uninlined_format_args from clippy (#2845)
- added `uninlined_format_args` to `[workspace.lints.clippy]` in the
`Cargo.toml` for the workspace
- ran `cargo clippy --tests --fix`
- ran `just fmt`
2025-08-28 11:25:23 -07:00
Michael Bolin fc3822b3c5 Merge 6ad577acfe into sapling-pr-archive-bolinfest 2025-08-28 11:13:44 -07:00
Michael Bolin 6ad577acfe chore: require uninlined_format_args from clippy
- added `uninlined_format_args` to `[workspace.lints.clippy]` in the `Cargo.toml` for the workspace
- ran `cargo clippy --tests --fix`
- ran `just fmt`
2025-08-28 11:13:34 -07:00
Michael Bolin 20b149a3aa Merge a513c32f59 into sapling-pr-archive-bolinfest 2025-08-28 11:12:16 -07:00
Michael Bolin a513c32f59 chore: require uninlined_format_args from clippy
- added `uninlined_format_args` to `[workspace.lints.clippy]` in the `Cargo.toml` for the workspace
- ran `cargo clippy --tests --fix`
- ran `just fmt`
2025-08-28 11:12:09 -07:00
Jeremy Rose e5611aab07 disallow some slash commands while a task is running (#2792)
/new, /init, /models, /approvals, etc. don't work correctly during a
turn. disable them.
2025-08-28 10:15:59 -07:00
dedrisian-oai 4e9ad23864 Add "View Image" tool (#2723)
Adds a "View Image" tool so Codex can find and see images by itself:

<img width="1772" height="420" alt="Screenshot 2025-08-26 at 10 40
04 AM"
src="https://github.com/user-attachments/assets/7a459c7b-0b86-4125-82d9-05fbb35ade03"
/>
2025-08-27 17:41:23 -07:00
Jeremy Rose 3e309805ae fix cursor after suspend (#2690)
This was supposed to be fixed by #2569, but I think the actual fix got
lost in the refactoring.

Intended behavior: pressing ^Z moves the cursor below the viewport
before suspending.
2025-08-27 14:17:10 -07:00
Jeremy Rose 488a40211a fix (most) doubled lines and hanging list markers (#2789)
This was mostly written by codex under heavy guidance via test cases
drawn from logged session data and fuzzing. It also uncovered some bugs
in tui_markdown, which will in some cases split a list marker from the
list item content. We're not addressing those bugs for now.
2025-08-27 13:55:59 -07:00
Gabriel Peal 903178eeeb Point the CHANGELOG to the releases page (#2780)
The typescript changelog is misleading and unhelpful
2025-08-27 11:45:40 -07:00
Reuben Narad 6e4c9d5243 Added back codex-rs/config.md to link to new location (#2778)
Quick fix: point old config.md to new location
2025-08-27 18:37:41 +00:00
Reuben Naradandeasong-openai 459363e17b README / docs refactor (#2724)
This PR cleans up the monolithic README by breaking it into a set
navigable pages under docs/ (install, getting started, configuration,
authentication, sandboxing and approvals, platform details, FAQ, ZDR,
contributing, license). The top‑level README is now more concise and
intuitive, (with corrected screenshots).

It also consolidates overlapping content from codex-rs/README.md into
the top‑level docs and updates links accordingly. The codex-rs README
remains in place for now as a pointer and for continuity.

Finally, added an extensive config reference table at the bottom of
docs/config.md.

---------

Co-authored-by: easong-openai <easong@openai.com>
2025-08-27 10:30:39 -07:00
Michael Bolin ffe585387b fix: for now, limit the number of deltas sent back to the UI (#2776)
This is a stopgap solution, but today, we are seeing the client get
flooded with events. Since we already truncate the output we send to the
model, it feels reasonable to limit how many deltas we send to the
client.
2025-08-27 10:23:25 -07:00
Michael Bolin 068d8a1806 merge commit for archive created by Sapling 2025-08-27 10:13:17 -07:00
Michael Bolin 21cff87506 fix: for now, limit the number of deltas sent back to the UI 2025-08-27 10:13:05 -07:00
Dylan 0cec0770e2 [mcp-server] Add GetConfig endpoint (#2725)
## Summary
Adds a GetConfig request to the MCP Protocol, so MCP clients can
evaluate the resolved config.toml settings which the harness is using.

## Testing
- [x] Added an end to end test of the endpoint
2025-08-27 09:59:03 -07:00
Ahmed Ibrahim 2d2f66f9c5 Bug fix: deduplicate assistant messages (#2758)
We are treating assistant messages in a different way than other
messages which resulted in a duplicated history.

See #2698
2025-08-27 01:29:16 -07:00