Commit Graph
548 Commits
Author SHA1 Message Date
James Peter acfaeb7dd5 ci(proxy): set Responses v1 and fail-fast on 5xx\n\n- scripts/openai-proxy.js default RESPONSES_BETA=responses=v1\n- Workflows (issue-code, issue-comment, release, upstream-merge): EXIT_ON_5XX=1 and RESPONSES_BETA=responses=v1\n\nFix: API-key 2nd-call 500s addressed in client; proxy now aligned with production headers 2025-09-12 23:57:18 +10:00
James Peter 1ddedb8b48 chore(proxy): add STRICT_HEADERS and RESPONSES_BETA override; minimal allowlist mode 2025-09-12 23:24:59 +10:00
James Peter a88f97c681 chore(proxy): add debug toggles and error-body logging\n\n- Options: DISABLE_KEEPALIVE, FORCE_CLOSE, NO_GZIP, STRIP_SESSION_ID, IDEMPOTENCY_KEY=auto, LOG_ERROR_BODY(+_BYTES)\n- Helps isolate Responses API 500s on subsequent requests 2025-09-12 23:11:31 +10:00
just-every-code 991df9051a merge(upstream): selective bucketed merge from openai/codex@main
- Adopt upstream in common/file-search and add TUI popup/types
- Preserve fork invariants in core (browser/agent/web_fetch gating, UA/version)
- Keep our TUI and CLI flows; resolve conflicts per policy
- Protocol: align mcp_protocol to upstream; add TS for Verbosity
- file-search: provide run_streaming shim to satisfy TUI usage
- common: make sandbox summary robust to new fields

Verification:
- scripts/upstream-merge/verify.sh: PASS (build-fast + API checks)
2025-09-12 10:45:24 +00:00
James Peter 6ad9cb283c fix(core/http): set explicit Host header from target URL to avoid proxy TLS SNI handshake failures when using HTTP(S)_PROXY with /v1/responses streaming 2025-09-12 18:25:06 +10: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
James Peter 2994466b77 feat(tui/theme): allow Left/Right to mirror Up/Down; enable Save/Retry navigation via arrows
- Treat Left/Right as Up/Down across Theme/Spinner views, including Create flows.\n- In review screens, Left focuses preview toggle (themes) and cycles buttons; Right moves to Save/Retry.\n- Update title hint to display '▲ ▼ ◀ ▶ select'.\n\nAlso includes other local TUI/core adjustments present in the working tree. Verified with ./build-fast.sh.
2025-09-12 16:21:45 +10: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
pakrym-oaiandGitHub 3b5a5412bb Log cf-ray header in client traces (#3488)
## Summary
- log the `cf-ray` header when tracing HTTP responses in the Codex
client
- keep existing response status logging unchanged

## Testing
- just fmt
- just fix -p codex-core
- cargo test -p codex-core *(fails:
suite::client::azure_overrides_assign_properties_used_for_responses_url,
suite::client::env_var_overrides_loaded_auth)*

------
https://chatgpt.com/codex/tasks/task_i_68c31640dacc83209be131baf91611cd
2025-09-11 17:42:44 -07:00
jif-oaiandGitHub 44bb53df1e bug: default to image (#3501)
Default the MIME type to image
2025-09-11 23:10:24 +00:00
James Peter 6be2331872 fix(core/client): surface rich server error context on final retry (status, request-id, body excerpt); replace generic 500 mapping\n\n- Replace with carrying a preformatted, actionable message\n- Include HTTP status, , and a trimmed body excerpt in the error string\n- Log event to debug logger and close request log\n- Parse 429 bodies from cached text to avoid consuming response twice\n\nMotivation: All Code workflows showed a vague "high demand" stream error for ~24h. This change makes permanent failures diagnosable from the UI and logs. 2025-09-12 09:09:38 +10:00
James Peter 60699251dc Merge origin/main: adopt remote version bumps; keep ours elsewhere (MCP per-server timeouts, non-fatal listing) 2025-09-12 08:57:48 +10:00
jif-oaiandGitHub 8453915e02 feat: TUI onboarding (#3398)
Example of how onboarding could look like
2025-09-11 15:04:29 -07:00
Ahmed IbrahimandGitHub 44587c2443 Use PlanType enum when formatting usage-limit CTA (#3495)
- Started using Play type struct
- Added CTA for team/business 
- Refactored a bit to unify the logic
2025-09-11 22:01:25 +00:00
DylanandGitHub 027944c64e fix: improve handle_sandbox_error timeouts (#3435)
## Summary
Handle timeouts the same way, regardless of approval mode. There's more
to do here, but this is simple and should be zero-regret

## Testing
- [x] existing tests pass
- [x] test locally and verify rollout
2025-09-11 12:09:20 -07:00
Michael BolinandGitHub bec51f6c05 chore: enable clippy::redundant_clone (#3489)
Created this PR by:

- adding `redundant_clone` to `[workspace.lints.clippy]` in
`cargo-rs/Cargol.toml`
- running `cargo clippy --tests --fix`
- running `just fmt`

Though I had to clean up one instance of the following that resulted:

```rust
let codex = codex;
```
2025-09-11 11:59:37 -07:00
pakrym-oaiandGitHub 66967500bb Assign the entire gpt-5 model family same characteristics (#3490)
So the context size indicator is displayed.
2025-09-11 18:56:49 +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
jif-oaiandGitHub 114ce9ff4d NIT unified exec (#3479)
Fix the default value of the experimental flag of unified_exec
2025-09-11 16:19:12 +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
James Peter f69ea8b525 fix(core/mcp): honor per-server startup_timeout_ms and make tools/list failures non-fatal; add test MCP server + smoke harness to validate slow/fast scenarios
- Add  to  and parse/write in config
- Apply per-server timeout to  and initial
- Treat per-server  errors as non-fatal; record and skip those servers
- Keep manager creation successful even if some servers time out
- Export  so local smoke tool can exercise it
- Add  (stdio JSON-RPC) and  binary for manual validation
- Update TUI  to set  by default

This resolves GitHub issue #91 where a slow MCP server caused manager creation to time out and fail entirely.
2025-09-12 00:10:56 +10:00
James PeterandGitHub 46b5ede594 Merge pull request #119 from just-every/issue-118
Auto PR: OLLama client defaults to small context.
2025-09-11 23:28:52 +10:00
James Peter a0de41baca fix(upstream-merge): restore fork features and adapt to upstream APIs
- Restore browser_*/agent_* tool exposure and web_fetch (openai_tools.rs)
- Reintroduce browser gating and screenshot handling in codex.rs; remove obsolete image 'detail' field; adapt RolloutRecorder::new to params API
- Keep upstream TS model changes (protocol/models.rs) to satisfy protocol-ts while preserving our semantics
- Reinstate UA helpers for MCP server (USER_AGENT_SUFFIX, get_codex_user_agent_default) in default_client.rs

Build: ./build-fast.sh clean on upstream-merge
2025-09-11 20:44:34 +10:00
just-every-code 43ec3addf8 Merge remote-tracking branch 'origin/main' into upstream-merge 2025-09-11 01:03:48 +00: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
just-every-code 0b94541775 merge(upstream): incorporate upstream main changes in MCP modules; verify ok 2025-09-10 23:46:21 +00:00
James Peter 4d9335a3cd feat(custom-theme/mode): include generated name and is_dark in UI + config; toggle preview re-applies custom colors and falls back to Photon when off; fix pattern/initializers 2025-09-11 09:26:12 +10:00
Michael BolinandGitHub 44262d8fd8 fix: ensure output of codex-rs/mcp-types/generate_mcp_types.py matches codex-rs/mcp-types/src/lib.rs (#3439)
https://github.com/openai/codex/pull/3395 updated `mcp-types/src/lib.rs`
by hand, but that file is generated code that is produced by
`mcp-types/generate_mcp_types.py`. Unfortunately, we do not have
anything in CI to verify this right now, but I will address that in a
subsequent PR.

#3395 ended up introducing a change that added a required field when
deserializing `InitializeResult`, breaking Codex when used as an MCP
client, so the quick fix in #3436 was to make the new field `Optional`
with `skip_serializing_if = "Option::is_none"`, but that did not address
the problem that `mcp-types/generate_mcp_types.py` and
`mcp-types/src/lib.rs` are out of sync.

This PR gets things back to where they are in sync. It removes the
custom `mcp_types::McpClientInfo` type that was added to
`mcp-types/src/lib.rs` and forces us to use the generated
`mcp_types::Implementation` type. Though this PR also updates
`generate_mcp_types.py` to generate the additional `user_agent:
Optional<String>` field on `Implementation` so that we can continue to
specify it when Codex operates as an MCP server.

However, this also requires us to specify `user_agent: None` when Codex
operates as an MCP client.

We may want to introduce our own `InitializeResult` type that is
specific to when we run as a server to avoid this in the future, but my
immediate goal is just to get things back in sync.
2025-09-10 16:14:41 -07:00
James Peter 69e6cc16f5 fix(theme/persist): apply custom colors only when theme == Custom; clear [tui.theme].colors/label when switching to built-in themes so startup doesn’t force Custom palette 2025-09-11 09:02:15 +10:00
Jeremy RoseGitHubCodex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
95a9938d3a fix trampling projects table when accepting trusted dirs (#3434)
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
2025-09-10 23:01:31 +00:00
just-every-code 50f9c5516d merge(upstream): sync with openai/codex main into upstream-merge\n\n- Prefer upstream in core: adopt new ToolsConfig API and OpenAI tools plumbing\n- Keep our TUI/tooling; no conflicts in prefer-ours buckets\n- Purge rules respected; no reintroduced assets\n\nBuild: ./build-fast.sh ok; verify.sh ok 2025-09-10 22:27:14 +00:00
Jeremy RoseandGitHub f69f07b028 put workspace roots in the environment context (#3375)
to keep the tool description constant when the writable roots change.
2025-09-10 15:10:52 -07:00
James Peter 47ecfbbdca Merge origin/main: pull latest before pushing Windows input fixes
- Keep local TUI input changes (keyboard enhancement gating; approval modal Press|Repeat)
- Adopt any remote version bumps and metadata updates
2025-09-11 07:50:56 +10:00
just-every-code 9e1be3be88 merge(upstream): incorporate upstream/main into upstream-merge; keep ours in core to preserve API/build; adopt new config_edit.rs
- Default to upstream outside protected paths
- Preserve codex-core public re-exports and models alias
- Purge-globs unchanged

Build: ./build-fast.sh ok; verify.sh ok
2025-09-10 21:23:45 +00:00
dedrisian-oaiandGitHub 87654ec0b7 Persist model & reasoning changes (#2799)
Persists `/model` changes across both general and profile-specific
sessions.
2025-09-10 20:53:46 +00:00
just-every-code 544f45822d merge(upstream): by-bucket sync with openai/codex main
- Adopt upstream core shell improvements (Bash support, detection)
- Preserve our core codex for TUI/ordering and custom tools
- Fix TUI render module export for markdown_utils

Verification: build_fast=ok, api_check=ok
2025-09-10 20:27:28 +00:00
Michael BolinandGitHub 51d9e05de7 Back out "feat: POSIX unification and snapshot sessions (#3179)" (#3430)
This reverts https://github.com/openai/codex/pull/3179.

#3179 appears to introduce a regression where sourcing dotfiles causes a
bunch of activity in the title bar (and potentially slows things down?)


https://github.com/user-attachments/assets/a68f7fb3-0749-4e0e-a321-2aa6993e01da

Verified this no longer happens after backing out #3179.

Original commit changeset: 62bd0e3d9d
2025-09-10 12:40:24 -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 bf548a81b8 Merge remote-tracking branch 'origin/main' into upstream-merge 2025-09-10 15:38:55 +00:00
Michael BolinandGitHub c13c3dadbf fix: remove unnecessary #[allow(dead_code)] annotation (#3357) 2025-09-10 08:19:05 -07:00
James Peter a59fba9280 feat(tui/theme): add AI-powered custom theme creation flow (prompt -> streaming -> preview -> save); persist label + colors, show custom label in Overview; include pseudo-row in Themes list; fix paste routing for theme form 2025-09-10 22:21:16 +10:00
James Peter 704286d3da feat(spinner): accept "name" in custom spinner JSON, persist as label in config, and display spinner labels (not IDs) in Overview; replace existing custom on save 2025-09-10 21:29:26 +10:00
James Peter d772837593 feat(tui/spinner): LLM-driven custom spinner flow with live streaming, JSON schema, and preview\n\n- Replace manual custom form with prompt-based generator\n- Send text.format=json_schema (strict), enforce interval 50–300ms, 2–50 frames, 1–20 chars; truncate + left-pad frames\n- Live in-box streaming during generation with wrapping; dimmed line with postfix\n- Loading view: title + spinner + "Generating spinner with AI…"\n- Review view: list-style preview row; [Save] [Retry] below preview\n- Enter on Description submits immediately\n- Add CLI: for side-channel structured requests\n- Core: add TextFormat + Prompt.text_format; include text.format in requests 2025-09-10 21:07:43 +10:00
James Peter 08a2f0ee50 feat(tui/theme): improve Create Custom spinner UX\n\n- Add visible caret and field focus; Up/Down navigates Interval→Frames→Save/Cancel\n- Save/Cancel buttons at bottom; Enter confirms action\n- Save writes a single "Custom" spinner (upsert) and activates it, then returns to Overview\n- Titles: Overview, Overview » Change Theme, Overview » Change Spinner, Overview » Change Spinner » Create Custom\n- Ensure pane heights so Frames + Save/Cancel are visible\n- Fix Instant scheduling (use checked_add)\n- Upsert custom spinner in registry 2025-09-10 17:47:38 +10:00
just-every-code 04ac84333b merge(upstream): by-bucket sync with openai/codex@main
- Adopt upstream MCP user-agent handling in core/mcp; keep workspace-compatible wrappers
- Prefer theirs in core/protocol; preserve ours in TUI/CLI and workflows
- Purged any reintroduced codex-cli images per policy

verify: scripts/upstream-merge/verify.sh ok; build-fast.sh ok (no warnings)
2025-09-10 02:51:24 +00:00
Gabriel PealandGitHub 8636bff46d Set a user agent suffix when used as a mcp server (#3395)
This automatically adds a user agent suffix whenever the CLI is used as
a MCP server
2025-09-10 02:32:57 +00:00
just-every-code 37eb04668f Merge remote-tracking branch 'origin/main' into upstream-merge 2025-09-10 01:02:55 +00:00