Commit Graph
5175 Commits
Author SHA1 Message Date
jif-oaiandGitHub 8d1a09a606 chore: config editor (#5878)
The goal is to have a single place where we actually write files

In a follow-up PR, will move everything config related in a dedicated
module and move the helpers in a dedicated file
2025-10-29 20:52:46 +00:00
jif-oaiandGitHub 768494c879 fix: icu_decimal version (#5919) 2025-10-29 20:46:45 +00:00
Rasmus RygaardandGitHub 898deba95e Add a wrapper around raw response items (#5923)
We currently have nested enums when sending raw response items in the
app-server protocol. This makes downstream schemas confusing because we
need to embed `type`-discriminated enums within each other.

This PR adds a small wrapper around the response item so we can keep the
schemas separate
2025-10-29 20:32:40 +00:00
Eric TrautandGitHub 7beeec4018 Add missing "nullable" macro to protocol structs that contain optional fields (#5901)
This PR addresses a current hole in the TypeScript code generation for
the API server protocol. Fields that are marked as "Optional<>" in the
Rust code are serialized such that the value is omitted when it is
deserialized — appearing as `undefined`, but the TS type indicates
(incorrectly) that it is always defined but possibly `null`. This can
lead to subtle errors that the TypeScript compiler doesn't catch. The
fix is to include the `#[ts(optional_fields = nullable)]` macro for all
protocol structs that contain one or more `Optional<>` fields.

This PR also includes a new test that validates that all TS protocol
code containing "| null" in its type is marked optional ("?") to catch
cases where `#[ts(optional_fields = nullable)]` is omitted.
2025-10-29 12:09:47 -07:00
jif-oaiandGitHub 5d9294e03e feat: add output even in sandbox denied (#5908) 2025-10-29 18:21:18 +00:00
jif-oaiandGitHub eaa9d7bba6 feat: deprecation warning (#5825)
<img width="955" height="311" alt="Screenshot 2025-10-28 at 14 26 25"
src="https://github.com/user-attachments/assets/99729b3d-3bc9-4503-aab3-8dc919220ab4"
/>
2025-10-29 12:29:28 +00:00
jif-oaiandGitHub 93da2cefd3 chore: merge git crates (#5909)
Merge `git-apply` and `git-tooling` into `utils/`
2025-10-29 12:11:44 +00:00
James Peter 0ea766a4ce fix(ci/preview-build): add fallback build for external PRs
Gracefully skips prerelease publishing when no codex slug is present and runs build-fast.sh so forked branches still get a CI build. Prevents comment job from running without a release.
2025-10-29 20:08:54 +10:00
Abhishek BhardwajandGitHub f7efcb3b86 feature: Add "!cmd" user shell execution (#2471)
feature: Add "!cmd" user shell execution

This change lets users run local shell commands directly from the TUI by
prefixing their input with ! (e.g. !ls). Output is truncated to keep the
exec cell usable, and Ctrl-C cleanly
  interrupts long-running commands (e.g. !sleep 10000).

**Summary of changes**

- Route Op::RunUserShellCommand through a dedicated UserShellCommandTask
(core/src/tasks/user_shell.rs), keeping the task logic out of codex.rs.
- Reuse the existing tool router: the task constructs a ToolCall for the
local_shell tool and relies on ShellHandler, so no manual MCP tool
lookup is required.
- Emit exec lifecycle events (ExecCommandBegin/ExecCommandEnd) so the
TUI can show command metadata, live output, and exit status.

**End-to-end flow**

  **TUI handling**

1. ChatWidget::submit_user_message (TUI) intercepts messages starting
with !.
2. Non-empty commands dispatch Op::RunUserShellCommand { command };
empty commands surface a help hint.
3. No UserInput items are created, so nothing is enqueued for the model.

  **Core submission loop**
4. The submission loop routes the op to handlers::run_user_shell_command
(core/src/codex.rs).
5. A fresh TurnContext is created and Session::spawn_user_shell_command
enqueues UserShellCommandTask.

  **Task execution**
6. UserShellCommandTask::run emits TaskStartedEvent, formats the
command, and prepares a ToolCall targeting local_shell.
  7. ToolCallRuntime::handle_tool_call dispatches to ShellHandler.

  **Shell tool runtime**
8. ShellHandler::run_exec_like launches the process via the unified exec
runtime, honoring sandbox and shell policies, and emits
ExecCommandBegin/End.
9. Stdout/stderr are captured for the UI, but the task does not turn the
resulting ToolOutput into a model response.

  **Completion**
10. After ExecCommandEnd, the task finishes without an assistant
message; the session marks it complete and the exec cell displays the
final output.

  **Conversation context**

- The command and its output never enter the conversation history or the
model prompt; the flow is local-only.
  - Only exec/task events are emitted for UI rendering.

**Demo video**


https://github.com/user-attachments/assets/fcd114b0-4304-4448-a367-a04c43e0b996
2025-10-29 00:31:20 -07:00
AxojhfandGitHub df0f0ffd3d Fix bash detection failure in VS Code Codex extension on Windows under certain conditions (#3421)
Found that the VS Code Codex extension throws “Error starting
conversation” when initializing a conversation with Git for Windows’
bash on PATH.
Debugging showed the bash-detection logic did not return as expected;
this change makes it reliable in that scenario.
Possibly related to issue #2841.
2025-10-28 21:29:16 -07:00
James PeterandGitHub f412237e3d Merge pull request #366 from just-every/new/fix-mcp-scroll
Merging via CLI to reconcile with local merges.
2025-10-29 14:10:22 +10:00
CurtandGitHub 32d266afec fix(windows-path): preserve PATH order; include core env vars (#5579)
# Preserve PATH precedence & fix Windows MCP env propagation

## Problem & intent

Preserve user PATH precedence and reduce Windows setup friction for MCP
servers by avoiding PATH reordering and ensuring Windows child processes
receive essential env vars.

- Addresses: #4180 #5225 #2945 #3245 #3385 #2892 #3310 #3457 #4370  
- Supersedes: #4182, #3866, #3828 (overlapping/inferior once this
merges)
- Notes: #2626 / #2646 are the original PATH-mutation sources being
corrected.

---

## Before / After

**Before**  
- PATH was **prepended** with an `apply_patch` helper dir (Rust + Node
wrapper), reordering tools and breaking virtualenvs/shims on
macOS/Linux.
- On Windows, MCP servers missed core env vars and often failed to start
without explicit per-server env blocks.

**After**  
- Helper dir is **appended** to PATH (preserves user/tool precedence).  
- Windows MCP child env now includes common core variables and mirrors
`PATH` → `Path`, so typical CLIs/plugins work **without** per-server env
blocks.

---

## Scope of change

### `codex-rs/arg0/src/lib.rs`
- Append temp/helper dir to `PATH` instead of prepending.

### `codex-cli/bin/codex.js`
- Mirror the same append behavior for the Node wrapper.

### `codex-rs/rmcp-client/src/utils.rs`
- Expand Windows `DEFAULT_ENV_VARS` (e.g., `COMSPEC`, `SYSTEMROOT`,
`PROGRAMFILES*`, `APPDATA`, etc.).
- Mirror `PATH` → `Path` for Windows child processes.  
- Small unit test; conditional `mut` + `clippy` cleanup.

---

## Security effects

No broadened privileges. Only environment propagation for well-known
Windows keys on stdio MCP child processes. No sandbox policy changes and
no network additions.

---

## Testing evidence

**Static**  
- `cargo fmt`  
- `cargo clippy -p codex-arg0 -D warnings` → **clean**  
- `cargo clippy -p codex-rmcp-client -D warnings` → **clean**  
- `cargo test -p codex-rmcp-client` → **13 passed**

**Manual**  
- Local verification on Windows PowerShell 5/7 and WSL (no `unused_mut`
warnings on non-Windows targets).

---

## Checklist

- [x] Append (not prepend) helper dir to PATH in Rust and Node wrappers
- [x] Windows MCP child inherits core env vars; `PATH` mirrored to
`Path`
- [x] `cargo fmt` / `clippy` clean across touched crates  
- [x] Unit tests updated/passing where applicable  
- [x] Cross-platform behavior preserved (macOS/Linux PATH precedence
intact)
2025-10-28 21:06:39 -07:00
GitHub Action e6d8c1c9f4 docs(changelog): update for v0.4.4 [skip ci] 2025-10-29 04:04:32 +00:00
GitHub Action 3fbfb38174 chore(release): 0.4.4 [skip ci] v0.4.4 2025-10-29 04:01:50 +00:00
James Peter f62a159aa5 test(tui): skip agent toggle when not installed 2025-10-29 13:42:36 +10:00
James Peter c36d983ef3 test(tui): tolerate missing claude agent 2025-10-29 13:23:35 +10:00
James Peter 23b12f9f93 test(tui): accept agent toggle active label 2025-10-29 13:04:08 +10:00
James Peter c88b7fbba1 test(tui): check agent toggle remains enabled 2025-10-29 12:44:21 +10:00
James Peter 5f0e8157ee test(tui): align vt100 snapshot to 'active' 2025-10-29 12:22:05 +10:00
pakrym-oaiandGitHub 878ab7c5ef Refresh tokens more often and log a better message when both auth and token refresh fails (#5655)
<img width="784" height="153" alt="image"
src="https://github.com/user-attachments/assets/c44b0eb2-d65c-4fc2-8b54-b34f7e1c4d95"
/>
2025-10-28 18:55:53 -07:00
James Peter ae645eb4c2 fix(codex-core): use reqwest::Url for host check 2025-10-29 11:53:23 +10:00
James Peter f05da78302 test(rmcp): assert schema version format 2025-10-29 11:49:52 +10:00
James Peter 1efe667bc4 Merge branch 'pr361' into main 2025-10-29 11:44:51 +10:00
James Peter a5e1dcc385 Merge branch 'pr365' into main 2025-10-29 11:26:54 +10:00
Anton PanasenkoandGitHub 580b43fac1 [codex][app-server] resume conversation from history (#5893) 2025-10-28 18:18:03 -07:00
James Peter 6b0954c531 Merge branch 'pr363' into main 2025-10-29 11:12:57 +10:00
James Peter 6d674a2244 ci(release): ensure py3.12 and tomllib/tomli fallback 2025-10-29 11:10:46 +10:00
James Peter a272090e77 Merge pr362: stable beta header routing 2025-10-29 11:07:15 +10:00
James Peter 18070bf295 fix(core/responses): default to stable beta header 2025-10-29 11:00:06 +10:00
Gabriel PealandGitHub 1beaf09fba [App Server] Allow fetching or resuming a conversation summary from the conversation id (#5890)
This PR adds an option to app server to allow conversation summaries to
be fetched from just the conversation id rather than rollout path for
convenience at the cost of some latency to discover the rollout path.

This convenience is non-trivial as it allows app servers to simply
maintain conversation ids rather than rollout paths and the associated
platform (Windows) handling associated with storing and encoding them
correctly.
2025-10-28 20:17:22 -04:00
James Peter b773da3b43 Merge pr364: pin preview toolchain env 2025-10-29 10:14:50 +10:00
James Peter 335f738aa6 Merge origin/main: adopt IME repeat guard 2025-10-29 10:06:27 +10:00
James Peter 6d4d8b9b7c Merge pr367: rollout mtime ordering, MCP scroll, homebrew version 2025-10-29 10:04:07 +10:00
James PeterandGitHub 8745d7dd8b fix(tui/ime): drop repeat events during composition (#368)
* fix(tui/ime): ignore interim repeat events

* ci: retrigger preview build after #364
2025-10-29 09:58:09 +10:00
James Peter cac6dfa555 ci(release): drop unsupported attestation permission 2025-10-29 09:57:15 +10:00
James Peter 98e542d19a fix(tui,ci): tidy test-mode ESC and harden release workflow
TUI:
- clear the spinner in test-mode sessions so idle Esc maps back to the undo hint and gate the greeting helper behind test cfg
- relax the spacer regression invariant and filter the welcome bullets from replay counts so assertions reflect user-visible rows

Tests:
- refresh the spacer and VT100 ChatWidget snapshots to capture the new chrome and deterministic greeting layout

CI:
- switch release concurrency to a release-specific group without auto-cancel and declare the full permissions set required to publish
- read code-rs/rust-toolchain.toml once, install via dtolnay/rust-toolchain@stable, and key rust-cache entries by the resolved channel
- enforce fetch-depth: 0 on release checkouts so changelog generation, tagging, and cache keys have the full history
2025-10-29 09:49:41 +10:00
Rasmus RygaardandGitHub 90c11f0cc0 [app-server] Annotate more exported types with a title (#5879)
Follow-up to https://github.com/openai/codex/pull/5063

Refined the app-server export pipeline so JSON Schema variants and
discriminator fields are annotated with descriptive, stable titles
before writing the bundle. This eliminates anonymous enum names in the
generated Pydantic models (goodbye Type7) while keeping downstream
tooling simple. Added shared helpers to derive titles and literals, and
reused them across the traversal logic for clarity. Running just fix -p
codex-app-server-protocol, just fmt, and cargo test -p
codex-app-server-protocol validates the change.
2025-10-28 16:35:12 -07:00
zhao-oaiandGitHub 85edfa66d8 verify mime type of images (#5888)
solves: https://github.com/openai/codex/issues/5675

Block non-image uploads in the view_image workflow. We now confirm the
file’s MIME is image/* before building the data URL; otherwise we emit a
“unsupported MIME type” error to the model. This stops the agent from
sending application/json blobs that the Responses API rejects with 400s.

<img width="409" height="556" alt="Screenshot 2025-10-28 at 1 15 10 PM"
src="https://github.com/user-attachments/assets/a92199e8-2769-4b1d-8e33-92d9238c90fe"
/>
2025-10-28 14:52:51 -07:00
Eric TrautandGitHub 5c76377ad7 Fixed bug that results in a sporadic hang when attaching images (#5891)
Addresses https://github.com/openai/codex/issues/5773

Testing: I tested that images work (regardless of order that they are
associated with the task prompt) in both the CLI and Extension. Also
verified that conversations in CLI and extension with images can be
resumed.
2025-10-28 14:42:46 -07:00
Ahmed IbrahimandGitHub ef4f9090a3 remove beta experimental header (#5892) 2025-10-28 21:28:56 +00:00
Ahmed IbrahimandGitHub 07f4746024 revert #5812 release file (#5887)
revert #5812 release file
2025-10-28 20:06:16 +00:00
pakrym-oaiandGitHub a07bddd4f3 Filter out reasoning items from previous turns (#5857)
Reduces request size and prevents 400 errors when switching between API
orgs.

Based on Responses API behavior described in
https://cookbook.openai.com/examples/responses_api/reasoning_items#caching
2025-10-28 11:39:34 -07:00
Jeremy RoseandGitHub add6f0b869 Fix handling of non-main default branches for cloud task submissions (#5069)
## Summary
- detect the repository's default branch before submitting a cloud task
- expose a helper in `codex_core::git_info` for retrieving the default
branch name

Fixes #4888


------
https://chatgpt.com/codex/tasks/task_i_68e96093cf28832ca0c9c73fc618a309
2025-10-28 11:02:25 -07:00
Jeremy RoseandGitHub dd0449c41a tui: show queued messages during response stream (#5540)
This fixes an issue where messages sent during the final response stream
would seem to disappear, because the "queued messages" UI wasn't shown
during streaming.
2025-10-28 16:59:19 +00:00
Jeremy RoseandGitHub 171f5ff024 tui: wait longer for color query results (#5004)
this bumps the timeout when reading the responses to OSC 10/11 so that
we're less likely to pass the deadline halfway through reading the
response.
2025-10-28 09:42:57 -07:00
zhao-oaiandGitHub df748651f6 fix advanced.md (#5833)
table wasn't formatting correctly
2025-10-28 16:32:20 +00:00
jif-oaiandGitHub 0c7267b211 chore: decompose submission loop (#5854) 2025-10-28 15:23:46 +00:00
Owen LinandGitHub d7f6178541 chore: use anyhow::Result for all app-server integration tests (#5836)
There's a lot of visual noise in app-server's integration tests due to
the number of `.expect("<some_msg>")` lines which are largely redundant
/ not very useful. Clean them up by using `anyhow::Result` + `?`
consistently.

Replaces the existing pattern of:
```
    let codex_home = TempDir::new().expect("create temp dir");
    create_config_toml(codex_home.path()).expect("write config.toml");

    let mut mcp = McpProcess::new(codex_home.path())
        .await
        .expect("spawn mcp process");
    timeout(DEFAULT_READ_TIMEOUT, mcp.initialize())
        .await
        .expect("initialize timeout")
        .expect("initialize request");
```

With:
```
    let codex_home = TempDir::new()?;
    create_config_toml(codex_home.path())?;

    let mut mcp = McpProcess::new(codex_home.path()).await?;
    timeout(DEFAULT_READ_TIMEOUT, mcp.initialize()).await??;
```
2025-10-28 08:10:23 -07:00
jif-oaiandGitHub 586e4dcce3 chore: drop useless shell stuff (#5848) 2025-10-28 14:52:52 +00:00
jif-oaiandGitHub f80165be84 chore: speed-up pipeline (#5812)
Speed-up pipeline by:
* Decoupling tests and clippy
* Use pre-built binary in tests
* `sccache` for caching of the builds
2025-10-28 14:08:52 +00:00