50 Commits
Author SHA1 Message Date
zeekay eb49cac620 name the env after the product, and the key after the stack it opens
457 sites carried an upstream prefix into every surface a user reaches — shell
exports, docs, CI, the SDK. CODEX_ is not our name and it was never going to
stop arriving on its own: it is what upstream writes, and every sync brings more.

Two namespaces, because they answer different questions.

  DEV_*            the app's own configuration — DEV_HOME, DEV_PROFILE, the rest
  HANZO_API_KEY    a credential for the Hanzo stack, which is not app config

CODEX_API_KEY held the literal string "CODEX_API_KEY", so the rename moves the
value and not just the constant. It becomes HANZO_API_KEY, which is what
create_hanzo_provider already reads through HANZO_MACHINE_ENV_KEYS — one name
for one credential instead of two spellings of it.

vendor/ is untouched, which is the point of vendor/: upstream code keeps
upstream names, and the boundary is a path rather than a habit.
2026-08-08 09:14:56 -07:00
zeekay 901a81abe9 docs: describe this product, and only what it can do
The docs read as OpenAI's Codex CLI: a getting-started page titled for it,
`codex --enable skills` and `code sandbox macos` for commands that do not
exist, defaults given as gpt-5.1-codex-max/openai when they are
zen5-coder/hanzo, a Homebrew page describing a formula we do not publish.

Removed three tui-stream-chunking notes and the execpolicy page: they
document modules and a subcommand that live only in the vendored upstream
copy. There is no execpolicy subcommand and no .codexpolicy loader in
code-rs; the page told users to run something the binary does not have.

Rewrote tui-alternate-screen against the source. It described an
auto/always/never enum and a --no-alt-screen flag; the shipped behavior is a
tui.alternate_screen bool with Ctrl+T, which replays the transcript into
scrollback on the way out — a better answer to Zellij than the one written
down. Genuine openai-provider documentation stays.
2026-08-07 21:51:19 -07:00
zeekayandHanzo Dev dc13f1609d fix(merge): restore the identity the merge reverted, and the fields it added
Three regressions the merge introduced, all caught by building and running:

- `core/src/model_provider_info.rs` — upstream added `auth`,
  `experimental_bearer_token` and `websocket_connect_timeout_ms` to
  ModelProviderInfo; the Hanzo provider now sets them (None: our bearer comes
  from HANZO_USER_KEY, not a command, and the websocket default is fine).
  This was the only compile error in 7004 changed files.
- `core/src/config.rs` — the default provider fallback had reverted to
  "openai". Back to HANZO_PROVIDER_ID. This one is the whole product.
- `cli/src/main.rs` — the entire clap identity had reverted: `--help` printed
  "Codex CLI" and `Usage: code`. Restored name/bin_name = "dev", the about
  line, subcommand help, and the doctor/preview/login hints (17 sites).
- `tui/src/updates.rs` — the in-product upgrade hint had reverted to
  `npm install -g @just-every/code@latest`, which would send our users to
  someone else's package.

`core/tests/hanzo_identity.rs` needed one call-site update for upstream's new
`built_in_model_providers(Option<String>)` signature; it then caught nothing
further, which is the point of it.

  cargo test -p code-core --test hanzo_identity
  4 passed; 0 failed

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-05 23:17:49 -07:00
zeekayandHanzo Dev 6cbbea2d03 merge: just-every/code v0.6.169 (e4fe007150) — keep Hanzo identity
Our history is just-every's with author emails rewritten, so the graphs are
disjoint and git finds no merge base. Supplied one by hand: d1f1f51a41, the
just-every commit matching our Oct-2025 fork point (22 files apart). 9618
upstream commits, 7004 files, +1.81M/-159k, 37 conflicts.

Resolution:
- Upstream code where our side was the Oct-2025 prototype of a feature they
  have since reimplemented 3-5x larger (agent_runs, browser_sessions,
  history_cell/{agent,browser}, the vt100 harness and its snapshots).
- Upstream's config.rs module split (builder/defaults/sources/validation)
  kept; zen5-coder and the provider-follows-model rule re-applied on top.
- Ours where the file IS the identity: README, package.json, postinstall,
  release notes pipeline, integration-zed.
- Hybrid where upstream improved a file we had branded: updates.rs (their
  release-repo migration, our hanzoai/dev), release.yml (their fail-fast npm
  auth check, our package name), chatwidget.rs (their turn handling, our
  HANZO_USER_KEY hint), exec human output (their 237 lines, our banner).

Superseded and dropped deliberately: our resume_command_name() coder-alias
hack — upstream's derive_resume_command_name() reads the invocation basename
generically, which yields "dev" for us.

LLM.md now records the real topology and the sync point; AGENTS.md and
CLAUDE.md are symlinks to it again. Single parent on purpose: adopting
jecode/main as a second parent would re-import 13,742 commits carrying the
upstream author emails a prior rewrite deliberately removed.

Version 0.2.188 -> 0.2.189.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-05 23:09:12 -07:00
James Peter 44458d2d0e Merge upstream/main: adopt tool parallelism and exec formatting 2025-10-06 11:19:57 +10:00
Michael BolinandGitHub 0c0f43d58a chore: subject docs/*.md to Prettier checks (#4645)
Apparently we were not running our `pnpm run prettier` check in CI, so
many files that were covered by the existing Prettier check were not
well-formatted.

This updates CI and formats the files.
2025-10-03 11:35:48 -07:00
Gabriel PealandGitHub 33cba3777b [MCP] Add support for MCP Oauth credentials (#4517)
This PR adds oauth login support to streamable http servers when
`experimental_use_rmcp_client` is enabled.

This PR is large but represents the minimal amount of work required for
this to work. To keep this PR smaller, login can only be done with
`codex mcp login` and `codex mcp logout` but it doesn't appear in `/mcp`
or `codex mcp list` yet. Fingers crossed that this is the last large MCP
PR and that subsequent PRs can be smaller.

Under the hood, credentials are stored using platform credential
managers using the [keyring crate](https://crates.io/crates/keyring).
When the keyring isn't available, it falls back to storing credentials
in `CODEX_HOME/.credentials.json` which is consistent with how other
coding agents handle authentication.

I tested this on macOS, Windows, WSL (ubuntu), and Linux. I wasn't able
to test the dbus store on linux but did verify that the fallback works.

One quirk is that if you have credentials, during development, every
build will have its own ad-hoc binary so the keyring won't recognize the
reader as being the same as the write so it may ask for the user's
password. I may add an override to disable this or allow
users/enterprises to opt-out of the keyring storage if it causes issues.

<img width="5064" height="686" alt="CleanShot 2025-09-30 at 19 31 40"
src="https://github.com/user-attachments/assets/9573f9b4-07f1-4160-83b8-2920db287e2d"
/>
<img width="745" height="486" alt="image"
src="https://github.com/user-attachments/assets/9562649b-ea5f-4f22-ace2-d0cb438b143e"
/>
2025-10-03 13:43:12 -04:00
James Peter 9f4221ec4a feat(protocol): add MCP shim and sync tool stack 2025-10-03 14:36:00 +10:00
James Peter db582085b5 feat(core/agents): add 'cloud' agent support across run_agent, /plan, /solve; docs and examples; basic tests
- core/agent_tool: recognize "cloud" model and append prompt positionally; honor per‑mode args
- core/codex(agent_run): include "cloud" in command resolution + PATH check
- core/slash_commands: default /plan,/solve models now include "cloud"; test asserts prompt includes it
- core/agent_defaults: add cloud case (no default flags); unit test ensures empty defaults
- docs: note default agent set includes "cloud"; add config example

Build passes via ./build-fast.sh. Full test suite currently fails on unrelated preexisting test drift (protocol/test-support imports, enum shapes).
2025-10-02 23:53:36 +10:00
easong-openaiandGitHub 2bf7607c2c Fall back to configured instruction files if AGENTS.md isn't available (#4544)
Allow users to configure an agents.md alternative to consume, but warn
the user it may degrade model performance.

Fixes #4376
2025-10-01 18:19:59 +00:00
James Peter b0e445a4ef chore(merge): prepare workspace for vitual cherry-pick 2025-10-01 04:11:40 +10:00
Gabriel PealandGitHub 1f2a050ecb Update MCP docs to reference experimental RMCP client (#4422) 2025-09-30 02:44:16 -04:00
vishnu-oaiandGitHub 00e9385e78 OpenTelemetry events (#2103)
### Title

## otel

Codex can emit [OpenTelemetry](https://opentelemetry.io/) **log events**
that
describe each run: outbound API requests, streamed responses, user
input,
tool-approval decisions, and the result of every tool invocation. Export
is
**disabled by default** so local runs remain self-contained. Opt in by
adding an
`[otel]` table and choosing an exporter.

```toml
[otel]
environment = "staging"   # defaults to "dev"
exporter = "none"          # defaults to "none"; set to otlp-http or otlp-grpc to send events
log_user_prompt = false    # defaults to false; redact prompt text unless explicitly enabled
```

Codex tags every exported event with `service.name = "codex-cli"`, the
CLI
version, and an `env` attribute so downstream collectors can distinguish
dev/staging/prod traffic. Only telemetry produced inside the
`codex_otel`
crate—the events listed below—is forwarded to the exporter.

### Event catalog

Every event shares a common set of metadata fields: `event.timestamp`,
`conversation.id`, `app.version`, `auth_mode` (when available),
`user.account_id` (when available), `terminal.type`, `model`, and
`slug`.

With OTEL enabled Codex emits the following event types (in addition to
the
metadata above):

- `codex.api_request`
  - `cf_ray` (optional)
  - `attempt`
  - `duration_ms`
  - `http.response.status_code` (optional)
  - `error.message` (failures)
- `codex.sse_event`
  - `event.kind`
  - `duration_ms`
  - `error.message` (failures)
  - `input_token_count` (completion only)
  - `output_token_count` (completion only)
  - `cached_token_count` (completion only, optional)
  - `reasoning_token_count` (completion only, optional)
  - `tool_token_count` (completion only)
- `codex.user_prompt`
  - `prompt_length`
  - `prompt` (redacted unless `log_user_prompt = true`)
- `codex.tool_decision`
  - `tool_name`
  - `call_id`
- `decision` (`approved`, `approved_for_session`, `denied`, or `abort`)
  - `source` (`config` or `user`)
- `codex.tool_result`
  - `tool_name`
  - `call_id`
  - `arguments`
  - `duration_ms` (execution time for the tool)
  - `success` (`"true"` or `"false"`)
  - `output`

### Choosing an exporter

Set `otel.exporter` to control where events go:

- `none` – leaves instrumentation active but skips exporting. This is
the
  default.
- `otlp-http` – posts OTLP log records to an OTLP/HTTP collector.
Specify the
  endpoint, protocol, and headers your collector expects:

  ```toml
  [otel]
  exporter = { otlp-http = {
    endpoint = "https://otel.example.com/v1/logs",
    protocol = "binary",
    headers = { "x-otlp-api-key" = "${OTLP_TOKEN}" }
  }}
  ```

- `otlp-grpc` – streams OTLP log records over gRPC. Provide the endpoint
and any
  metadata headers:

  ```toml
  [otel]
  exporter = { otlp-grpc = {
    endpoint = "https://otel.example.com:4317",
    headers = { "x-otlp-meta" = "abc123" }
  }}
  ```

If the exporter is `none` nothing is written anywhere; otherwise you
must run or point to your
own collector. All exporters run on a background batch worker that is
flushed on
shutdown.

If you build Codex from source the OTEL crate is still behind an `otel`
feature
flag; the official prebuilt binaries ship with the feature enabled. When
the
feature is disabled the telemetry hooks become no-ops so the CLI
continues to
function without the extra dependencies.

---------

Co-authored-by: Hanzo Dev <[email protected]>
2025-09-29 11:30:55 -07:00
James Peter 67bf7fb260 feat(auto-drive): add observer thread and telemetry 2025-09-29 12:09:06 +10:00
just-every-code 7138268b81 Auto: address issue #263 - Using sub-agents to collect context for coding agents. 2025-09-26 12:19:10 +00:00
James Peter 6e57ee4737 fix(core/config): allow overriding OpenAI wire API via env
Fixes #234
2025-09-25 15:28:39 +10:00
James Peter 13e55be8fc Merge upstream-merge: bring pro observer and readiness updates 2025-09-24 09:47:07 +10:00
James Peter 1fb539be98 merge code-branch-20250922-231915 via /merge 2025-09-23 14:15:35 +10:00
James Peter ff782c166e feat(validation): expand functional checks 2025-09-23 14:06:03 +10:00
just-every-code 83d48aa8a4 merge(upstream): by-bucket merge upstream/main into upstream-merge\n\n- Keep ours for TUI fixtures; purge binary-size-log.jsonl\n- Adopt upstream MCP typed config tests (GetUserSavedConfigResponse)\n- Sync defaults to gpt-5-codex where applicable\n\nverify.sh: PASS; build-fast.sh: PASS 2025-09-23 03:40:47 +00:00
Thibault SottiauxandGitHub 585432f0fd feat: update default (#4076)
Changes:
- Default model and docs now use gpt-5-codex. 
- Disables the GPT-5 Codex NUX by default.
- Keeps presets available for API key users.
2025-09-22 20:10:52 -07:00
just-every-code 57b5c00789 Merge upstream/main: preserve core/TUI; adopt upstream in common; build-fast ok
- Prefer ours: core/codex.rs, core/config.rs, core/config_types.rs, core/mcp_connection_manager.rs, TUI files (chat_composer, history_cell, markdown_stream), keep wrapping.rs deleted.
- Prefer theirs: common/exec/file-search where merged cleanly.
- Reconciliations: restored core mcp_tool_call.rs signature; updated CLI mcp config to startup_timeout_ms; adjusted TUI callers to pass TextAreaState by value.
- Guards: tool families and UA/version preserved; verify.sh passed.
- Purge: no purged assets reintroduced.

Result: ./build-fast.sh success with zero warnings.
2025-09-22 17:54:57 +00:00
Jeremy RoseandGitHub 1ee0afdf16 timeouts for mcp tool calls (#3959)
defaults to 60sec, overridable with MCP_TOOL_TIMEOUT or on a per-server
basis in the config.
2025-09-22 10:30:59 -07:00
James Peter 96b0507f7c feat(validation): polish settings UI and disable defaults 2025-09-22 08:53:24 +10:00
James Peter aa4be91655 feat(validation): replace rustfmt toggle with cargo check 2025-09-22 08:10:50 +10:00
James Peter a1a3ee55d3 Merge branch 'code-branch-20250919-061709' into main 2025-09-22 07:23:50 +10:00
James Peter ea8e9b56c6 feat(validation): add patch harness with TUI controls 2025-09-21 13:41:23 +10:00
James Peter 6c035bad2c feat(project-hooks): add project hooks and commands
Closes #203
2025-09-20 06:04:46 +10:00
James Peter 2f18e78f04 docs: clarify config directories (closes #181) 2025-09-18 17:21:12 +10:00
just-every-code 93e02e15b8 merge(upstream): integrate openai/codex@933145d00 (docs update); verify ok 2025-09-16 16:33:45 +00:00
pakrym-oaiandGitHub 933145d00d Update azure model provider example (#3680)
Make the section linkable.
2025-09-16 08:43:29 -07:00
just-every-code 29caea1fcc merge(upstream): by-bucket sync with openai/codex@main
- Preserve TUI and core tool invariants (browser_*, agent_*, web_fetch gating, screenshot queue, UA/version)
- Incorporate upstream TUI notifications config and exec-tool flag mapping
- Resolve core config conflicts; align tests with forked Config shape

verify: scripts/upstream-merge/verify.sh ok; ./build-fast.sh ok
2025-09-15 18:05:13 +00:00
Jeremy RoseandGitHub 4345f13cd0 notifications on approvals and turn end (#3329)
uses OSC 9 to notify when a turn ends or approval is required. won't
work in vs code or terminal.app but iterm2/kitty/wezterm supports it :)
2025-09-15 10:22:02 -07:00
just-every-code 512080e132 merge(upstream): sync upstream/main into upstream-merge
- Adopt upstream changes by bucket per policy
- Keep our core/TUI invariants and tool gating
- Purge upstream codex-cli image assets
- Verify: scripts/upstream-merge/verify.sh ok; ./build-fast.sh ok
2025-09-15 05:05:11 +00:00
easong-openaiandGitHub 70c3e2bc87 initial mcp add interface (#3543)
Adds `codex mcp add`, `codex mcp list`, `codex mcp remove`. Currently writes to global config.
2025-09-15 04:30:56 +00:00
just-every-code c9217ca273 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
Eric TrautandGitHub 0a982f6d27 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
just-every-code 8dd5a2e740 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
RobertandGitHub a389f40064 Improve explanation of how the shell handles quotes in config.md (#3169)
* Clarify how the shell's handling of quotes affects the interpretation
of TOML values in `--config`/`-c`
* Provide examples of the right way to pass complex TOML values
* The previous explanation incorrectly demonstrated how to pass TOML
values to `--config`/`-c` (misunderstanding how the shell’s handling of
quotes affects things) and would result in invalid invocations of
`codex`.
2025-09-08 15:58:25 -07:00
cbe82219d3 feat(mcp): per-server startup timeout (#3182)
Seeing timeouts on certain, slow mcp server starting up when codex is
invoked. Before this change, the timeout was a hard-coded 10s. Need the
ability to define arbitrary timeouts on a per-server basis.

## Summary of changes

- Add startup_timeout_ms to McpServerConfig with 10s default when unset
- Use per-server timeout for initialize and tools/list
- Introduce ManagedClient to store client and timeout; rename
LIST_TOOLS_TIMEOUT to DEFAULT_STARTUP_TIMEOUT
- Update docs to document startup_timeout_ms with example and options
table

---------

Co-authored-by: Matthew Dolan <[email protected]>
2025-09-08 08:12:08 -07:00
James Peter e19e49e6f5 feat(tui/github): add settings view and Actions tools; wire into bottom pane and chatwidget
- core(config): add GithubConfig and setter for check_on_push
- tui: integrate gh_actions panel; exec tools plumbing
- workflows: use RUNNER_TEMP cargo-home; enforce policy removals (images + cargo caches)
- repo: ignore .cargo2; docs(config): clarify allow_git_writes default
- protocol: minor adjustments across core/protocol crates
2025-09-07 17:43:58 +10:00
pakrym-oaiandGitHub 73f9cf8c85 Never store requests (#3212)
When item ids are sent to Responses API it will load them from the
database ignoring the provided values. This adds extra latency.

Not having the mode to store requests also allows us to simplify the
code.

## Breaking change

The `disable_response_storage` configuration option is removed.
2025-09-05 10:41:47 -07:00
Anton PanasenkoandGitHub 7a0b82fac1 [codex] move configuration for reasoning summary format to model family config type (#3171) 2025-09-04 11:00:01 -07:00
James Peter b8f48d8ada merge(core): integrate upstream main, adopt default_client UA; fix auth originator and tool docs
- Resolve upstream delete of user_agent.rs; use default_client::get_codex_user_agent
- Switch client construction to default_client with originator header
- Update AuthManager::shared and CodexAuth::from_codex_home call sites to pass originator
- Fix openai_tools shell tool description formatting and include writable roots
- Deduplicate/repair config_types derives; import Serialize/Display early
- Use rollout::policy::is_persisted_response_item and remove dead import
- Keep our TUI architecture intact; no functional UI changes

Build: ./build-fast.sh passes with zero warnings
2025-09-04 07:21:05 +10:00
Anton PanasenkoandGitHub c61302350b [codex] document use_experimental_reasoning_summary toml key config (#3118)
Follow up on https://github.com/openai/codex/issues/3101
2025-09-03 11:16:07 -07:00
James Peter 08609e46c7 merge: integrate upstream/main (prefer ours); keep TUI fork, drop legacy vt100 tests, retain local common.rs 2025-09-03 19:49:35 +10:00
Zhongsheng JiandGitHub 59676e7d91 docs: fix typo of config.md (#3082)
Fixed a typo in config.md. I guess TOML doesn't have the “key”: “value”
syntax.
2025-09-02 23:14:57 -07:00
Reuben NaradandGitHub 02de01ebbd fix config reference table (#3063)
3 quick fixes to docs/config.md

- Fix the reference table so option lists render correctly
- Corrected the default `stream_max_retries` to 5 (Old: 10)
- Update example approval_policy to untrusted (Old: unless-allow-listed)
2025-09-02 13:03:11 -07:00
James Peter 0c644deb34 chore: commit local changes before sync 2025-08-29 13:42:37 +10:00
84b0c238d9 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: Hanzo Dev <[email protected]>
2025-08-27 10:30:39 -07:00