Commit Graph
107 Commits
Author SHA1 Message Date
James Peter 57ecce7cca feat(approval): add semantic prefix matching 2025-09-19 14:03:22 +10:00
James Peter e5a01aeb56 Merge origin/upstream-merge: adopt MCP conversation id refactor 2025-09-19 09:45:42 +10:00
just-every-code b7811420d6 merge: upstream main into upstream-merge (preserve core/TUI, adapt exec). build-fast ok 2025-09-18 21:33:38 +00:00
dedrisian-oaiandGitHub 62258df92f feat: /review (#3774)
Adds `/review` action in TUI

<img width="637" height="370" alt="Screenshot 2025-09-17 at 12 41 19 AM"
src="https://github.com/user-attachments/assets/b1979a6e-844a-4b97-ab20-107c185aec1d"
/>
2025-09-18 14:14:16 -07:00
just-every-code 9d0ad614d2 merge(upstream): incorporate upstream main into upstream-merge
- Align ConversationId API to upstream; add From conversions
- Keep MCP server UA semantics and disable login flows in server
- Preserve ICU/sys-locale deps; keep uuid v4 usage
- Minimal fixes to core + recorder for new id type

Build: verify.sh ok; build-fast.sh ok (no warnings)
2025-09-18 15:07:28 +00:00
pakrym-oaiandGitHub d4aba772cb Switch to uuid_v7 and tighten ConversationId usage (#3819)
Make sure conversations have a timestamp.
2025-09-18 14:37:03 +00:00
James Peter 52b7a48c2d Queue user prompts into next request 2025-09-18 21:05:16 +10:00
James Peter 002857fea2 Merge branch 'code-branch-20250916-172734' into main 2025-09-18 12:21:18 +10:00
James Peter 6d1bfdd0b2 fix(resume): restore full history replay 2025-09-18 11:56:22 +10:00
James Peter 29eda799d4 feat: add plan names and terminal title sync 2025-09-17 15:47:52 +10:00
James Peter b6b9fc4186 Add Exploring support for read-only git commands 2025-09-17 09:32:44 +10:00
just-every-code 02159a44e5 Merge upstream/main: preserve TUI/tooling; adopt core updates (verify.sh ok, build-fast: zero warnings) 2025-09-15 01:30:16 +00:00
dedrisian-oaiandGitHub 2aa84b8891 Fix EventMsg Optional (#3604) 2025-09-15 00:34:33 +00:00
just-every-code 5a6328e55a merge(upstream): sync with openai/codex@main (by-bucket)
- Keep fork invariants in core/tui; prefer ours under protected globs
- Prefer upstream for common/exec/file-search buckets
- Resolve core codex.rs conflict by preserving fork browser/screenshot + ordering
- Fix TUI enum usage: CodeEvent -> CodexEvent
- Purge reintroduced .github/codex-cli-*.png assets per policy

Verification: scripts/upstream-merge/verify.sh PASS; build-fast.sh OK (0 warnings)
2025-09-14 13:52:51 +00:00
Ahmed IbrahimandGitHub bbea6bbf7e Handle resuming/forking after compact (#3533)
We need to construct the history different when compact happens. For
this, we need to just consider the history after compact and convert
compact to a response item.

This needs to change and use `build_compact_history` when this #3446 is
merged.
2025-09-14 13:23:31 +00:00
just-every-code bb92168957 merge(upstream): incorporate openai/codex@main into upstream-merge
- Keep ours: core/codex.rs, TUI chatwidget, UA/version + tool gating
- Prefer theirs: exec/event processor, common/protocol syncs where compatible
- Reconciled: MCP tool runner match arms (preserve browser/agent events), config review_model default
- Added upstream review prompt/tests without enabling review mode features
- Verified via scripts/upstream-merge/verify.sh and ./build-fast.sh (no warnings)
2025-09-13 01:14:38 +00:00
dedrisian-oaiandGitHub 90a0fd342f Review Mode (Core) (#3401)
## 📝 Review Mode -- Core

This PR introduces the Core implementation for Review mode:

- New op `Op::Review { prompt: String }:` spawns a child review task
with isolated context, a review‑specific system prompt, and a
`Config.review_model`.
- `EnteredReviewMode`: emitted when the child review session starts.
Every event from this point onwards reflects the review session.
- `ExitedReviewMode(Option<ReviewOutputEvent>)`: emitted when the review
finishes or is interrupted, with optional structured findings:

```json
{
  "findings": [
    {
      "title": "<≤ 80 chars, imperative>",
      "body": "<valid Markdown explaining *why* this is a problem; cite files/lines/functions>",
      "confidence_score": <float 0.0-1.0>,
      "priority": <int 0-3>,
      "code_location": {
        "absolute_file_path": "<file path>",
        "line_range": {"start": <int>, "end": <int>}
      }
    }
  ],
  "overall_correctness": "patch is correct" | "patch is incorrect",
  "overall_explanation": "<1-3 sentence explanation justifying the overall_correctness verdict>",
  "overall_confidence_score": <float 0.0-1.0>
}
```

## Questions

### Why separate out its own message history?

We want the review thread to match the training of our review models as
much as possible -- that means using a custom prompt, removing user
instructions, and starting a clean chat history.

We also want to make sure the review thread doesn't leak into the parent
thread.

### Why do this as a mode, vs. sub-agents?

1. We want review to be a synchronous task, so it's fine for now to do a
bespoke implementation.
2. We're still unclear about the final structure for sub-agents. We'd
prefer to land this quickly and then refactor into sub-agents without
rushing that implementation.
2025-09-12 23:25:10 +00:00
just-every-code 062c769126 merge(upstream): sync openai/codex main; keep TUI/core; adopt compact
- Prefer ours for TUI and core/codex.rs
- Prefer theirs for conversation_history, model_info, tests, Cargo.lock
- Add compat prompt, history.keep_last_messages, import get_model_info
- Remove dead code to ensure zero warnings

Build: ./build-fast.sh PASS (no warnings)
2025-09-12 20:29:42 +00:00
jif-oaiandGitHub ea225df22e feat: context compaction (#3446)
## Compact feature:
1. Stops the model when the context window become too large
2. Add a user turn, asking for the model to summarize
3. Build a bridge that contains all the previous user message + the
summary. Rendered from a template
4. Start sampling again from a clean conversation with only that bridge
2025-09-12 13:07:10 -07:00
just-every-code 7df177653d merge(upstream): sync with openai/codex main (by-bucket)
- Preserve forked TUI/core wiring and UA/version semantics
- Reconcile protocol + rollout variants; add TS for Verbosity
- Update MCP server (drop GetConfigToml; add fallback; extend NewConversationResponse)
- Minimal fixes in common/config_summary and client reasoning param
- ./build-fast.sh + verify.sh: passing
2025-09-12 19:29:22 +00:00
jif-oaiandGitHub c6fd056aa6 feat: reasoning effort as optional (#3527)
Allow the reasoning effort to be optional
2025-09-12 12:06:33 -07:00
just-every-code 4f7427a2ee merge(upstream): merge openai/codex@main into upstream-merge
- Preserve fork tooling: browser_*/agent_* gating and web_fetch exposure
- Keep shell tool semantics; detailed WorkspaceWrite description, simple for others
- Adopt upstream MCP protocol structs for compatibility (no server behavior change)
- Honor purge policy; verify.sh + build-fast passed cleanly
2025-09-12 18:59:29 +00:00
Michael BolinandGitHub abdcb40f4c feat: change the behavior of SetDefaultModel RPC so None clears the value. (#3529)
It turns out that we want slightly different behavior for the
`SetDefaultModel` RPC because some models do not work with reasoning
(like GPT-4.1), so we should be able to explicitly clear this value.

Verified in `codex-rs/mcp-server/tests/suite/set_default_model.rs`.
2025-09-12 11:35:51 -07:00
Michael BolinandGitHub c172e8e997 feat: added SetDefaultModel to JSON-RPC server (#3512)
This adds `SetDefaultModel`, which takes `model` and `reasoning_effort`
as optional fields. If set, the field will overwrite what is in the
user's `config.toml`.

This reuses logic that was added to support the `/model` command in the
TUI: https://github.com/openai/codex/pull/2799.
2025-09-11 23:44:17 -07:00
Michael BolinandGitHub 9bbeb75361 feat: include reasoning_effort in NewConversationResponse (#3506)
`ClientRequest::NewConversation` picks up the reasoning level from the user's defaults in `config.toml`, so it should be reported in `NewConversationResponse`.
2025-09-11 21:04:40 -07:00
jif-oaiandGitHub 44bb53df1e bug: default to image (#3501)
Default the MIME type to image
2025-09-11 23:10:24 +00:00
Ahmed IbrahimandGitHub 674e3d3c90 Add Compact and Turn Context to the rollout items (#3444)
Adding compact and turn context to the rollout items

based on #3440
2025-09-11 18:08:51 +00:00
Eric TrautandGitHub e13b35ecb0 Simplify auth flow and reconcile differences between ChatGPT and API Key auth (#3189)
This PR does the following:
* Adds the ability to paste or type an API key.
* Removes the `preferred_auth_method` config option. The last login
method is always persisted in auth.json, so this isn't needed.
* If OPENAI_API_KEY env variable is defined, the value is used to
prepopulate the new UI. The env variable is otherwise ignored by the
CLI.
* Adds a new MCP server entry point "login_api_key" so we can implement
this same API key behavior for the VS Code extension.
<img width="473" height="140" alt="Screenshot 2025-09-04 at 3 51 04 PM"
src="https://github.com/user-attachments/assets/c11bbd5b-8a4d-4d71-90fd-34130460f9d9"
/>
<img width="726" height="254" alt="Screenshot 2025-09-04 at 3 51 32 PM"
src="https://github.com/user-attachments/assets/6cc76b34-309a-4387-acbc-15ee5c756db9"
/>
2025-09-11 09:16:34 -07:00
Ahmed IbrahimandGitHub 162e1235a8 Change forking to read the rollout from file (#3440)
This PR changes get history op to get path. Then, forking will use a
path. This will help us have one unified codepath for resuming/forking
conversations. Will also help in having rollout history in order. It
also fixes a bug where you won't see the UI when resuming after forking.
2025-09-10 17:42:54 -07:00
jif-oaiandGitHub c09ed74a16 Unified execution (#3288)
## Unified PTY-Based Exec Tool

Note: this requires to have this flag in the config:
`use_experimental_unified_exec_tool=true`

- Adds a PTY-backed interactive exec feature (“unified_exec”) with
session reuse via
  session_id, bounded output (128 KiB), and timeout clamping (≤ 60 s).
- Protocol: introduces ResponseItem::UnifiedExec { session_id,
arguments, timeout_ms }.
- Tools: exposes unified_exec as a function tool (Responses API);
excluded from Chat
  Completions payload while still supported in tool lists.
- Path handling: resolves commands via PATH (or explicit paths), with
UTF‑8/newline‑aware
  truncation (truncate_middle).
- Tests: cover command parsing, path resolution, session
persistence/cleanup, multi‑session
  isolation, timeouts, and truncation behavior.
2025-09-10 17:38:11 -07:00
Michael BolinandGitHub 65f3528cad feat: add UserInfo request to JSON-RPC server (#3428)
This adds a simple endpoint that provides the email address encoded in
`$CODEX_HOME/auth.json`.

As noted, for now, we do not hit the server to verify this is the user's
true email address.
2025-09-10 17:03:35 -07:00
just-every-code 2f9e9f8a6a merge(upstream): sync with openai/codex main into upstream-merge
- Adopt upstream in core/protocol selectively; retain our TUI/CLI UX
- Keep our exec/conversation flow; add compatibility shims for rollout
- Add protocol num_format + TS derives to satisfy upstream types
- Resolve conflicts per policy; purge upstream-only UI events
- Build verified via scripts/upstream-merge/verify.sh and ./build-fast.sh (clean, no warnings)
2025-09-10 18:02:37 +00:00
Eric TrautandGitHub 39db113cc9 Added images to UserMessageEvent (#3400)
This PR adds an `images` field to the existing `UserMessageEvent` so we
can encode zero or more images associated with a user message. This
allows images to be restored when conversations are restored.
2025-09-10 10:18:43 -07:00
Ahmed IbrahimandGitHub 45bd5ca4b9 Move initial history to protocol (#3422)
To fix an edge case of forking then resuming

#3419
2025-09-10 10:17:24 -07:00
just-every-code 949171c2a6 merge(upstream): sync with openai/codex main (by-bucket)\n\n- Adopt upstream protocol models (TS derives; no image detail)\n- Update core to new InputImage shape; keep API re-exports\n- Purge reintroduced .github images per policy\n\nBuild: ./build-fast.sh ok; verify.sh api_check ok 2025-09-09 22:24:25 +00:00
just-every-code 2c6989f3d3 merge(upstream): incorporate upstream main selectively (by-bucket)
- Prefer ours for TUI, workflows, docs, Node CLI
- Revert upstream in core/exec/protocol/mcp-server/cli when breaking
- Fix core history entry field rename (session_id)
- Purge codex-cli image assets per policy

Status: verify.sh ok; build-fast.sh ok
2025-09-09 21:51:50 +00:00
pakrym-oaiandGitHub 5bcc9d8b77 Do not send reasoning item IDs (#3390)
Response API doesn't require IDs on reasoning items anymore. 

Fixes: https://github.com/openai/codex/issues/3292
2025-09-09 14:47:06 -07:00
just-every-code 77756d2283 merge(upstream): adopt protocol ConversationId and MCP type updates; keep our core APIs with minimal bridges; mcp-server compatibility layer; TS fixes (build: ok) 2025-09-09 16:14:17 +00:00
ace14e8d36 feat: add ArchiveConversation to ClientRequest (#3353)
Adds support for `ArchiveConversation` in the JSON-RPC server that takes
a `(ConversationId, PathBuf)` pair and:

- verifies the `ConversationId` corresponds to the rollout id at the
`PathBuf`
- if so, invokes
`ConversationManager.remove_conversation(ConversationId)`
- if the `CodexConversation` was in memory, send `Shutdown` and wait for
`ShutdownComplete` with a timeout
- moves the `.jsonl` file to `$CODEX_HOME/archived_sessions`

---------

Co-authored-by: Gabriel Peal <[email protected]>
2025-09-09 11:39:00 -04:00
just-every-code b57d270d5a merge(upstream): incorporate openai/codex@2a76a08a9 (by-bucket)
- Prefer ours for TUI/CLI and workflows; theirs for protocol where safe
- Adopt upstream rollout_path in NewConversationResponse; wire through SessionConfiguredEvent
- Add TS derives for protocol types to satisfy upstream TS schema
- Keep core API re-exports and models alias intact

Verification: scripts/upstream-merge/verify.sh passed; ./build-fast.sh clean (no warnings)
2025-09-09 07:34:28 +00:00
Michael BolinandGitHub 2a76a08a9e fix: include rollout_path in NewConversationResponse (#3352)
Adding the `rollout_path` to the `NewConversationResponse` makes it so a
client can perform subsequent operations on a `(ConversationId,
PathBuf)` pair. #3353 will introduce support for `ArchiveConversation`.

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/3352).
* #3353
* __->__ #3352
2025-09-09 00:11:48 -07:00
just-every-code 8f2081ee70 merge(upstream): merge upstream/main into upstream-merge (by-bucket)
- Keep ours for TUI/CLI/workflows/docs; purge reintroduced rust-ci.yml
- Prefer theirs in protocol/deps; add serde_bytes + ICU/sys-locale/serde_with
- Keep our core codex/shell to preserve API; fix exec AuthMode import
- Make verify.sh CI-safe (no sccache; local CARGO dirs); check api_surface only

Build: ok; Verify: ok
2025-09-09 01:56:14 +00:00
jif-oaiandGitHub a9c68ea270 feat: Run cargo shear during CI (#3338)
Run cargo shear as part of the CI to ensure no unused dependencies
2025-09-09 01:05:08 +00:00
just-every-code 96bc007cb1 chore(protocol): restore our protocol and protocol-ts to match existing core/server API 2025-09-09 00:37:11 +00:00
just-every-code 6b0f13558a fix(protocol): sync config_types.rs and add serde_with dependency 2025-09-09 00:26:56 +00:00
just-every-code de22e92acb fix(protocol): adopt upstream protocol.rs to resolve leftover conflict markers and align types 2025-09-09 00:25:57 +00:00
just-every-code 4f9992099e fix(protocol): adopt upstream mcp_protocol.rs to resolve merge artifact and compile errors 2025-09-09 00:24:54 +00:00
just-every-code 8bcf8bba6d merge(upstream): merge upstream/main into upstream-merge (by-bucket)\n\n- Prefer ours: TUI, CLI, workflows, docs\n- Prefer theirs: core/common/protocol/exec/file-search\n- Purged disallowed assets; resolved conflicts per policy 2025-09-09 00:21:14 +00:00
Gabriel PealandGitHub 5eaaf307e1 Generate more typescript types and return conversation id with ConversationSummary (#3219)
This PR does multiple things that are necessary for conversation resume
to work from the extension. I wanted to make sure everything worked so
these changes wound up in one PR:
1. Generate more ts types
2. Resume rollout history files rather than create a new one every time
it is resumed so you don't see a duplicate conversation in history for
every resume. Chatted with @aibrahim-oai to verify this
3. Return conversation_id in conversation summaries
4. [Cleanup] Use serde and strong types for a lot of the rollout file
parsing
2025-09-08 17:54:47 -04:00
Justin LebarandGitHub 18330c2362 Format large numbers in a more readable way. (#2046)
- In the bottom line of the TUI, print the number of tokens to 3 sigfigs
  with an SI suffix, e.g. "1.23K".
- Elsewhere where we print a number, I figure it's worthwhile to print
  the exact number, because e.g. it's a summary of your session. Here we print
  the numbers comma-separated.
2025-09-08 21:48:48 +00:00