Compare commits

..

95 Commits

Author SHA1 Message Date
celia-oai
9fdf129ace changes 2026-02-02 16:33:34 -08:00
celia-oai
d5995076a7 changes 2026-02-02 16:24:21 -08:00
celia-oai
8d4721f46c change 2026-02-02 16:24:21 -08:00
Celia Chen
fb2df99cf1 [feat] persist thread_dynamic_tools in db (#10252)
Persist thread_dynamic_tools in sqlite and read first from it. Fall back
to rollout files if it's not found. Persist dynamic tools to both sqlite
and rollout files.

Saw that new sessions get populated to db correctly & old sessions get
backfilled correctly at startup:
```
celia@com-92114 codex-rs % sqlite3 ~/.codex/state.sqlite \      "select thread_id, position,name,description,input_schema from thread_dynamic_tools;"
019c0cad-ec0d-74b2-a787-e8b33a349117|0|geo_lookup|lookup a city|{"properties":{"city":{"type":"string"}},"required":["city"],"type":"object"}
....
019c10ca-aa4b-7620-ae40-c0919fbd7ea7|0|geo_lookup|lookup a city|{"properties":{"city":{"type":"string"}},"required":["city"],"type":"object"}
```
2026-02-03 00:06:44 +00:00
Dylan Hurd
98debeda8a chore(tui) /personalities tip (#10377)
## Summary
We have /personality now.

## Testing
- [x] tested locally
2026-02-02 15:35:37 -08:00
iceweasel-oai
a5066bef78 emit a separate metric when the user cancels UAT during elevated setup (#10399)
Currently this shows up as elevated setup failure, which isn't quite
accurate.
2026-02-02 15:31:08 -08:00
Eric Traut
0f15ed4325 Updated labeler workflow prompt to include "app" label (#10411)
Support for desktop app issues
2026-02-02 13:13:14 -08:00
viyatb-oai
f50c8b2f81 fix: unsafe auto-approval of git commands (#10258)
fixes https://github.com/openai/codex/issues/10160 and some more.

## Description

Hardens Git command safety to prevent approval bypasses for destructive
or write-capable invocations (branch delete, risky push forms,
output/config-override flags), so these commands no longer auto-run as
“safe.”

- `git branch -d` variants (especially in worktrees / with global
options like -C / -c)
- `git show|diff|log --output` ... style file-write flags
- risky Git config override flags (-c, --config-env) that can trigger
external execution
- dangerous push forms that weren’t fully caught (`--force*`,
`--delete`, `+refspec`, `:refspec`)
- grouped short-flag delete forms (e.g. stacked branch flags containing
`d/D`)

will fast follow with a common git policy to bring windows to parity.

---------

Co-authored-by: Eric Traut <etraut@openai.com>
2026-02-02 12:30:17 -08:00
jif-oai
059d386f03 feat: add --experimental to generate-ts (#10402)
Adding a `--experimental` flag to the `generate-ts` fct in the
app-sever.

It can be called through one of those 2 command
```
just write-app-server-schema --experimental
codex app-server generate-ts --experimental
```
2026-02-02 20:30:01 +00:00
pakrym-oai
74327fa59c Select experimental features with space (#10281) 2026-02-02 11:35:11 -08:00
jif-oai
34c0534f6e feat: drop sqlx logging (#10398) 2026-02-02 19:26:58 +00:00
jif-oai
0b460eda32 chore: ignore synthetic messages (#10394)
This will be fixed once this is settled:
https://www.notion.so/openai/Artificial-context-management-2fb8e50b62b080db8b8ed93b3b19d1a2#2fb8e50b62b080d2bffce2dd1e60972b
2026-02-02 18:13:48 +00:00
pakrym-oai
9d976962ec Add credits tooltip (#10274) 2026-02-02 10:06:43 -08:00
Charley Cunningham
3392c5af24 Nicer highlighting of slash commands, /plan accepts prompt args and pasted images (#10269)
## Summary
- Make typed slash commands become text elements when the user hits
space, including paste‑burst spaces.
- Enable `/plan` to accept inline args and submit them in plan mode,
mirroring `/review` behavior and blocking submission while a task is
running.
- Preserve text elements/attachments for slash commands that take args.

<img width="1510" height="500" alt="image"
src="https://github.com/user-attachments/assets/446024df-b69a-4249-85db-1a85110e07f1"
/>

## Changes
- Add safe helper to insert element ranges in the textarea.
- Extend command‑with‑args pipeline to carry text elements and reuse
submission prep.
- Update `/plan` dispatch to switch to plan mode then submit prompt +
elements.
- Document new composer behavior and add tests.

## Notes
- `/plan` is blocked during active tasks (same as `/review`).
- Slash‑command elementization recognizes built‑ins and `/prompts:`
custom commands only.

## Codex author
`codex fork 019c16d3-4520-7bb0-9b9d-48720d40a8ab`
2026-02-02 09:53:29 -08:00
Michael Bolin
d1e71cd202 feat: add MCP protocol types and rmcp adapters (#10356)
Currently, types from our custom `mcp-types` crate are part of some of
our APIs:


03fcd12e77/codex-rs/app-server-protocol/src/protocol/v2.rs (L43-L46)

To eliminate this crate in #10349 by switching to `rmcp`, we need our
own wrappers for the `rmcp` types that we can use in our API, which is
what this PR does.

Note this PR introduces the new API types, but we do not make use of
them until #10349.





---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/10356).
* #10357
* #10349
* __->__ #10356
2026-02-02 08:41:02 -08:00
jif-oai
4f1cfaf892 fix: Rfc3339 casting (#10386) 2026-02-02 13:33:28 +00:00
jif-oai
e9a774e7ae fix: thread listing (#10383) 2026-02-02 12:52:49 +00:00
jif-oai
4971e96a98 nit: shell snapshot retention to 3 days (#10382) 2026-02-02 12:52:45 +00:00
jif-oai
3cc9122ee2 feat: experimental flags (#10231)
## Problem being solved
- We need a single, reliable way to mark app-server API surface as
experimental so that:
  1. the runtime can reject experimental usage unless the client opts in
2. generated TS/JSON schemas can exclude experimental methods/fields for
stable clients.

Right now that’s easy to drift or miss when done ad-hoc.

## How to declare experimental methods and fields
- **Experimental method**: add `#[experimental("method/name")]` to the
`ClientRequest` variant in `client_request_definitions!`.
- **Experimental field**: on the params struct, derive `ExperimentalApi`
and annotate the field with `#[experimental("method/name.field")]` + set
`inspect_params: true` for the method variant so
`ClientRequest::experimental_reason()` inspects params for experimental
fields.

## How the macro solves it
- The new derive macro lives in
`codex-rs/codex-experimental-api-macros/src/lib.rs` and is used via
`#[derive(ExperimentalApi)]` plus `#[experimental("reason")]`
attributes.
- **Structs**:
- Generates `ExperimentalApi::experimental_reason(&self)` that checks
only annotated fields.
  - The “presence” check is type-aware:
    - `Option<T>`: `is_some_and(...)` recursively checks inner.
    - `Vec`/`HashMap`/`BTreeMap`: must be non-empty.
    - `bool`: must be `true`.
    - Other types: considered present (returns `true`).
- Registers each experimental field in an `inventory` with `(type_name,
serialized field name, reason)` and exposes `EXPERIMENTAL_FIELDS` for
that type. Field names are converted from `snake_case` to `camelCase`
for schema/TS filtering.
- **Enums**:
- Generates an exhaustive `match` returning `Some(reason)` for annotated
variants and `None` otherwise (no wildcard arm).
- **Wiring**:
- Runtime gating uses `ExperimentalApi::experimental_reason()` in
`codex-rs/app-server/src/message_processor.rs` to reject requests unless
`InitializeParams.capabilities.experimental_api == true`.
- Schema/TS export filters use the inventory list and
`EXPERIMENTAL_CLIENT_METHODS` from `client_request_definitions!` to
strip experimental methods/fields when `experimental_api` is false.
2026-02-02 11:06:50 +00:00
jif-oai
9513f18bfe chore: collab experimental (#10381) 2026-02-02 10:57:44 +00:00
pap-openai
1644cbfc6d Session picker shows thread_name if set (#10340)
- shows names of threads in the ResumePicker used by `/resume` and
`codex resume` if set, default to preview (previous behaviour) if none
- adds a `find_thread_names_by_ids` that maps names to IDs in
`codex-rs/core/src/rollout/session_index.rs`. It reads sequentially in
normal (instead of reverse order in `codex resume <name>`) the index
mapping file. This function is called from a list of session (default
page is 25, pages loaded depends of height of terminal), for which most
of them will always have at least one session unnamed and require the
whole file to be read therefore. Could be better and sqlite integration
will make this better
- those reads won't be needed when leveraging sqlite
 

Opened questions:
- We could rename the TUI "Conversation" column to "Name" or "Thread"
that would feel more accurate. Could be a fast-follow if we implement
auto-naming as it'll always be a name instead?
2026-02-02 08:13:17 +00:00
Michael Bolin
974355cfdd feat: vendor app-server protocol schema fixtures (#10371)
Similar to what @sayan-oai did in openai/codex#8956 for
`config.schema.json`, this PR updates the repo so that it includes the
output of `codex app-server generate-json-schema` and `codex app-server
generate-ts` and adds a test to verify it is in sync with the current
code.

Motivation:
- This makes any schema changes introduced by a PR transparent during
code review.
- In particular, this should help us catch PRs that would introduce a
non-backwards-compatible change to the app schema (eventually, this
should also be enforced by tooling).
- Once https://github.com/openai/codex/pull/10231 is in to formalize the
notion of "experimental" fields, we can work on ensuring the
non-experimental bits are backwards-compatible.

`codex-rs/app-server-protocol/tests/schema_fixtures.rs` was added as the
test and `just write-app-server-schema` can be use to generate the
vendored schema files.

Incidentally, when I run:

```
rg _ codex-rs/app-server-protocol/schema/typescript/v2
```

I see a number of `snake_case` names that should be `camelCase`.
2026-02-01 23:38:43 -08:00
Dylan Hurd
08a5ad95a8 fix(personality) prompt patch (#10375)
## Summary
We had 2 typos in #10373

## Testing
- [x] unit tests pass
2026-02-01 23:32:07 -08:00
Dylan Hurd
a90ff831e7 chore(core) gpt-5.2-codex personality template (#10373)
## Summary
Consolidate prompts

## Testing
- [x] Existing tests pass
2026-02-01 22:54:12 -08:00
Dylan Hurd
6c22360bcb fix(core) Deduplicate prefix_rules before appending (#10309)
## Summary
We ideally shouldn't make it to this point in the first place, but if we
do try to append a rule that already exists, we shouldn't append the
same rule twice.

## Testing
- [x] Added unit test for this case
2026-02-01 20:30:38 -08:00
pakrym-oai
03fcd12e77 Do not append items on override turn context (#10354) 2026-02-01 18:51:26 -08:00
Dylan Hurd
8b95d3e082 fix(rules) Limit rules listed in conversation (#10351)
## Summary
We should probably warn users that they have a million rules, and help
clean them up. But for now, we should handle this unbounded case.

Limit rules listed in conversations, with shortest / broadest rules
first.

## Testing
- [x] Updated unit tests
2026-02-02 02:26:15 +00:00
Gav Verma
5fb46187b2 fix: System skills marker includes nested folders recursively (#10350)
Updated system skills bundled with Codex were not correctly replacing
the user's skills in their .system folder.

- Fix `.codex-system-skills.marker` not updating by hashing embedded
system skills recursively (nested dirs + file contents), so updates
trigger a reinstall.
- Added a build Cargo hook to rerun if there are changes in
`src/skills/assets/samples/*`, ensuring embedded skill updates rebuild
correctly under caching.
- Add a small unit test to ensure nested entries are included in the
fingerprint.
2026-02-01 18:17:32 -08:00
Charley Cunningham
d3514bbdd2 Bump thread updated_at on unarchive to refresh sidebar ordering (#10280)
## Summary
- Touch restored rollout files on `thread/unarchive` so `updatedAt`
reflects the unarchive time.
- Add a regression test to ensure unarchiving bumps `updated_at` from an
old mtime.

## Notes
This fixes the UX issue where unarchived old threads don’t reappear near
the top of recent threads.
2026-02-01 12:53:47 -08:00
Charley Cunningham
3dd9a37e0b Improve plan mode interaction rules (#10329)
## Summary
- Replace the “Hard interaction rule” with a clearer “Response
constraints” section that enumerates the allowed exceptions for Plan
Mode replies.
- Remove the stray Phase 1 exception line about simple questions.
- Update plan content requirements to ask for a brief summary section
and generalize API/type wording.
2026-01-31 23:20:27 -08:00
Dylan Hurd
ae4eeff440 fix(config) config schema newline (#10323)
## Summary
Looks like we may have introduced a formatting issue in recent PRs.

## Testing
- [x] ran `just write-config-schema`
2026-02-01 05:08:29 +00:00
Gav Verma
e470461a96 Sync system skills from public repo for openai yaml changes (#10322)
Follow-up to https://github.com/openai/codex/pull/10320

Syncing additional changes from
https://github.com/openai/skills/tree/main/skills/.system
2026-01-31 21:07:35 -08:00
Gav Verma
dfba95309f Sync system skills from public repo (#10320)
Syncs the system skills included in Codex with the updates in
https://github.com/openai/skills/tree/main/skills/.system
2026-01-31 20:44:18 -08:00
Dylan Hurd
11c912c4af chore(features) Personality => Stable (#10310)
## Summary
Bump `/personality` to stable

## Testing
 - [x] unit tests pass
2026-01-31 20:32:32 -08:00
Dylan Hurd
a33fa4bfe5 chore(config) Rename config setting to personality (#10314)
## Summary
Let's make the setting name consistent with the SlashCommand!

## Testing
- [x] Updated tests
2026-01-31 19:38:06 -08:00
Anton Panasenko
101d359cd7 Add websocket telemetry metrics and labels (#10316)
Summary
- expose websocket telemetry hooks through the responses client so
request durations and event processing can be reported
- record websocket request/event metrics and emit runtime telemetry
events that the history UI now surfaces
- improve tests to cover websocket telemetry reporting and guard runtime
summary updates


<img width="824" height="79" alt="Screenshot 2026-01-31 at 5 28 12 PM"
src="https://github.com/user-attachments/assets/ea9a7965-d8b4-4e3c-a984-ef4fdc44c81d"
/>
2026-01-31 19:16:44 -08:00
xl-openai
aab3705c7e Make skills prompt explicit about relative-path lookup (#10282)
Fix cases where the model tries to locate skill scripts from the cwd and
fails.
2026-01-31 19:08:25 -08:00
Gav Verma
39a6a84097 feat: Support loading skills from .agents/skills (#10317)
This PR adds support for loading
[skills](https://developers.openai.com/codex/skills) from
`.agents/skills/`.
- Issue: https://github.com/agentskills/agentskills/issues/15
- Motivation: When skills live on the filesystem, sharing them across
agents is awkward and often ends up requiring symlinks/duplication. A
single location under `.agents/` makes it easier to share skills.
- Loading from `.codex/skills/` will remain but will be deprecated soon.
The change only applies to the [REPO
scope](https://developers.openai.com/codex/skills#where-to-save-skills).
- Documentation will be updated before this change is live.

Testing with skills in two locations of this repo:
<img width="960" height="152" alt="image"
src="https://github.com/user-attachments/assets/28975ff9-7363-46dd-ad40-f4c7bfdb8234"
/>

When starting Codex with CWD in `$repo_root` (should only pick up at
root):
<img width="513" height="143" alt="image"
src="https://github.com/user-attachments/assets/389e1ea7-020c-481e-bda0-ce58562db59f"
/>

When starting Codex with CWD in `$repo_root/codex-rs` (should pick up at
cwd and crawl up to root):
<img width="552" height="177" alt="image"
src="https://github.com/user-attachments/assets/a5beb8de-11b4-45ed-8660-80707c77006a"
/>
2026-01-31 18:45:05 -08:00
alexsong-oai
b164ac6d1e feat: fire tracking events for skill invocation (#10120) 2026-01-31 18:06:26 -08:00
Ahmed Ibrahim
30ed29a7b3 enable plan mode (#10313)
# External (non-OpenAI) Pull Request Requirements

Before opening this Pull Request, please read the dedicated
"Contributing" markdown file or your PR may be closed:
https://github.com/openai/codex/blob/main/docs/contributing.md

If your PR conforms to our contribution guidelines, replace this text
with a detailed and high quality description of your changes.

Include a link to a bug report or enhancement request.
2026-02-01 00:58:17 +00:00
Dylan Hurd
0f9858394b feat(core,tui,app-server) personality migration (#10307)
## Summary
Keep existing users on Pragmatic, to preserve behavior while new users
default to Friendly

## Testing
- [x] Tested locally
- [x] add integration tests
2026-01-31 17:25:14 -07:00
Dylan Hurd
8a461765f3 chore(core) Default to friendly personality (#10305)
## Summary
Update default personality to friendly

## Testing
- [x] Unit tests pass
2026-01-31 17:11:32 -07:00
Ahmed Ibrahim
2d6757430a plan mode prompt (#10308)
# External (non-OpenAI) Pull Request Requirements

Before opening this Pull Request, please read the dedicated
"Contributing" markdown file or your PR may be closed:
https://github.com/openai/codex/blob/main/docs/contributing.md

If your PR conforms to our contribution guidelines, replace this text
with a detailed and high quality description of your changes.

Include a link to a bug report or enhancement request.
2026-01-31 13:55:52 -08:00
Dylan Hurd
ed9e02c9dc chore(app-server) add personality update test (#10306)
## Summary
Add some additional validation to ensure app-server handles Personality
changes

## Testing
- [x] These are tests
2026-01-31 14:49:55 -07:00
Fouad Matin
49342b156d Fix npm README image link (#10303)
### Motivation
- The image referenced in the package README was 404ing on the npm
package page because it used a relative file path that doesn't resolve
on npm, so the splash image needs a GitHub-hosted URL to render
correctly.

### Description
- Update `README.md` to replace the relative image path
`./.github/codex-cli-splash.png` with the GitHub-hosted URL
`https://github.com/openai/codex/blob/main/.github/codex-cli-splash.png`.

### Testing
- No automated tests were run because this is a docs-only change and
does not affect code or test behavior.

------
[Codex
Task](https://chatgpt.com/codex/tasks/task_i_697e58dbce34832d87c7847779e8f4a5)
2026-01-31 20:33:06 +00:00
Dylan Hurd
28f3a71809 chore(features) remove Experimental tag from UTF8 (#10296)
## Summary
This has been default on for some time, it should now be the default.

## Testing
- [x] Existing tests pass
2026-01-31 13:17:24 -07:00
douglaz
9a10121fd6 fix(nix): update flake for newer Rust toolchain requirements (#10302)
## Summary

- Add rust-overlay input to provide newer Rust versions (rama crates
require rustc 1.91.0+)
- Add devShells output with complete development environment
- Add missing git dependency hashes to codex-rs/default.nix

## Changes

**flake.nix:**
- Added `rust-overlay` input to get newer Rust toolchains
- Updated `packages` output to use `rust-bin.stable.latest.minimal` for
builds
- Added `devShells` output with:
  - Rust with `rust-src` and `rust-analyzer` extensions for IDE support
- Required build dependencies: `pkg-config`, `openssl`, `cmake`,
`libclang`
  - Environment variables: `PKG_CONFIG_PATH`, `LIBCLANG_PATH`

**codex-rs/default.nix:**
- Added missing `outputHashes` for git dependencies:
  - `nucleo-0.5.0`, `nucleo-matcher-0.3.1`
  - `runfiles-0.1.0`
  - `tokio-tungstenite-0.28.0`, `tungstenite-0.28.0`

## Test Plan

- [x] `nix develop` enters shell successfully
- [x] `nix develop -c rustc --version` shows 1.93.0
- [x] `nix develop -c cargo build` completes successfully
2026-01-31 11:34:53 -08:00
willwang-openai
2a299317d2 display promo message in usage error (#10285)
If a promo message is attached to a rate limit response, then display it
in the error message.
2026-01-31 08:13:25 -08:00
Anton Panasenko
8660ad6c64 feat: show runtime metrics in console (#10278)
Summary of changes:

- Adds a new feature flag: runtime_metrics
  - Declared in core/src/features.rs
  - Added to core/config.schema.json
  - Wired into OTEL init in core/src/otel_init.rs

- Enables on-demand runtime metric snapshots in OTEL
  - Adds runtime_metrics: bool to otel/src/config.rs
  - Enables experimental custom reader features in otel/Cargo.toml
  - Adds snapshot/reset/summary APIs in:
    - otel/src/lib.rs
    - otel/src/metrics/client.rs
    - otel/src/metrics/config.rs
    - otel/src/metrics/error.rs

- Defines metric names and a runtime summary builder
  - New files:
    - otel/src/metrics/names.rs
    - otel/src/metrics/runtime_metrics.rs
  - Summarizes totals for:
    - Tool calls
    - API requests
    - SSE/streaming events

- Instruments metrics collection in OTEL manager
  - otel/src/traces/otel_manager.rs now records:
    - API call counts + durations
    - SSE event counts + durations (success/failure)
    - Tool call metrics now use shared constants

- Surfaces runtime metrics in the TUI
  - Resets runtime metrics at turn start in tui/src/chatwidget.rs
- Displays metrics in the final separator line in
tui/src/history_cell.rs

- Adds tests
  - New OTEL tests:
    - otel/tests/suite/snapshot.rs
    - otel/tests/suite/runtime_summary.rs
  - New TUI test:
- final_message_separator_includes_runtime_metrics in
tui/src/history_cell.rs

Scope:
- 19 files changed
- ~652 insertions, 38 deletions


<img width="922" height="169" alt="Screenshot 2026-01-30 at 4 11 34 PM"
src="https://github.com/user-attachments/assets/1efd754d-a16d-4564-83a5-f4442fd2f998"
/>
2026-01-30 22:20:02 -08:00
Dylan Hurd
a8c9e386e7 feat(core) Smart approvals on (#10286)
## Summary
Turn on Smart Approvals by default

## Testing
 - [x] Updated unit tests
2026-01-30 23:12:25 -07:00
Ruyut
9327e99b28 Fix minor typos in comments and documentation (#10287)
## Summary

I have read the contribution guidelines.  
All changes in this PR are limited to text corrections and do not modify
any business logic, runtime behavior, or user-facing functionality.

## Details

This PR fixes several minor typos, including:

- `create` -> `crate`
- `analagous` -> `analogous`
- `apply-patch` -> `apply_patch`
- `codecs` -> `codex`
- ` '/" ` -> ` '/' `
- `Respesent` -> `Represent`
2026-01-30 22:11:02 -08:00
gt-oai
47faa1594c Turn on cloud requirements for business too (#10283)
Need to check "enterprise" and "business"
2026-01-31 02:57:42 +00:00
sayan-oai
eb86663dcb add missing fields to WebSearchAction and update app-server types (#10276)
- add `WebSearchAction` to app-server v2 types
- add `queries` to `WebSearchAction::Search` type

Updated tests.
2026-01-30 16:37:56 -08:00
gt-oai
149f3aa27a Add enforce_residency to requirements (#10263)
Add `enforce_residency` to requirements.toml and thread it through to a
header on `default_client`.
2026-01-31 00:26:25 +00:00
gt-oai
a046481ad9 Wire up cloud reqs in exec, app-server (#10241)
We're fetching cloud requirements in TUI in
https://github.com/openai/codex/pull/10167.

This adds the same fetching in exec and app-server binaries also.
2026-01-30 23:53:41 +00:00
Michael Bolin
10ea117ee1 chore: implement Mul for TruncationPolicy (#10272)
Codex thought this was a good idea while working on
https://github.com/openai/codex/pull/10192.
2026-01-30 15:50:20 -08:00
Eric Traut
8d142fd63d Validate CODEX_HOME before resolving (#10249)
Summary
- require `CODEX_HOME` to point to an existing directory before
canonicalizing and surface clear errors otherwise
- share the same helper logic in both `core` and `rmcp-client` and add
unit tests that cover missing, non-directory, valid, and default paths

This addresses #9222
2026-01-30 15:46:33 -08:00
Yuvraj Angad Singh
13e85b1549 fix: update file search directory when session CWD changes (#9279)
## Summary

Fixes #9041

- Adds update_search_dir() method to FileSearchManager to allow updating
the search directory after initialization
- Calls this method when the session CWD changes: new session, resume,
or fork

## Problem

The FileSearchManager was created once with the initial search_dir and
never updated. When a user:

1. Starts Codex in a non-git directory (e.g., /tmp/random)
2. Resumes or forks a session from a different workspace
3. The @filename lookup still searched the original directory

This caused no matches to be returned even when files existed in the
current workspace.

## Solution

Update FileSearchManager.search_dir whenever the session working
directory changes:
- AppEvent::NewSession: Use current config CWD
- SessionSelection::Resume: Use resumed session CWD
- SessionSelection::Fork: Use forked session CWD

## Test plan

- [ ] Start Codex in /tmp/test-dir (non-git)
- [ ] Resume a session from a project with actual files
- [ ] Verify @filename returns matches from the resumed session
directory

---------

Co-authored-by: Eric Traut <etraut@openai.com>
2026-01-30 14:59:20 -08:00
sayan-oai
31d1e49340 fix: dont auto-enable web_search for azure (#10266)
seeing issues with azure after default-enabling web search: #10071,
#10257.

need to work with azure to fix api-side, for now turning off
default-enable of web_search for azure.

diff is big because i moved logic to reuse
2026-01-30 22:52:37 +00:00
Jeremy Rose
d59685f6d4 file-search: multi-root walk (#10240)
Instead of a separate walker for each root in a multi-root walk, use a
single walker.
2026-01-30 22:20:23 +00:00
pakrym-oai
748141bdda Update announcement_tip.toml (#10267)
Extend the test for dev version
2026-01-30 14:14:29 -08:00
pakrym-oai
0fac2744f7 Hide /approvals from the slash-command list (#10265)
`/permissions` is the replacement. `/approvals` still available when
typing.
2026-01-30 22:12:50 +00:00
pakrym-oai
5f81e8e70b Fix main (#10262) 2026-01-30 21:54:05 +00:00
Skylar Graika
9008a0eff9 core: prevent shell_snapshot from inheriting stdin (#9735)
Fixes #9559.

When `shell_snapshot` runs, it may execute user startup files (e.g.
`.bashrc`). If those files read from stdin (or if stdin is an
interactive TTY under job control), the snapshot subprocess can block or
receive `SIGTTIN` (as reported over SSH).

This change explicitly sets `stdin` to `Stdio::null()` for the snapshot
subprocess, so it can't read from the terminal.

Regression test added that would hang/timeout without this change.
Tests: `ulimit -n 4096 && cargo test -p codex-core`.

cc @dongdongbh @etraut-openai

---------

Co-authored-by: Skylar Graika <sgraika127@gmail.com>
2026-01-30 13:47:10 -08:00
pakrym-oai
aacd530a41 Update copy (#10256)
<img width="839" height="62" alt="image"
src="https://github.com/user-attachments/assets/ca987cdb-9e8c-403e-8856-a9b37baa7673"
/>
2026-01-30 12:57:19 -08:00
daniel-oai
dd6c1d3787 Skip loading codex home as project layer (#10207)
Summary:
- Fixes issue #9932: https://github.com/openai/codex/issues/9932
- Prevents `$CODEX_HOME` (typically `~/.codex`) from being discovered as
a project `.codex` layer by skipping it during project layer traversal.
We compare both normalized absolute paths and best-effort canonicalized
paths to handle symlinks.
- Adds regression tests for home-directory invocation and for the case
where `CODEX_HOME` points to a project `.codex` directory (e.g.,
worktrees/editor integrations).

Testing:
- `cargo build -p codex-cli --bin codex`
- `cargo build -p codex-rmcp-client --bin test_stdio_server`
- `cargo test -p codex-core`
- `cargo test --all-features`
- Manual: ran `target/debug/codex` from `~` and confirmed the
disabled-folder warning and trust prompt no longer appear.
2026-01-30 12:42:07 -08:00
Charley Cunningham
83317ed4bf Make plan highlight use popup grey background (#10253)
## Summary
- align proposed plan background with popup surface color by reusing
`user_message_bg`
- remove the custom blue-tinted plan background

<img width="1572" height="1568" alt="image"
src="https://github.com/user-attachments/assets/63a5341e-4342-4c07-b6b0-c4350c3b2639"
/>
2026-01-30 12:39:15 -08:00
Ahmed Ibrahim
b7351f7f53 plan prompt (#10255)
# External (non-OpenAI) Pull Request Requirements

Before opening this Pull Request, please read the dedicated
"Contributing" markdown file or your PR may be closed:
https://github.com/openai/codex/blob/main/docs/contributing.md

If your PR conforms to our contribution guidelines, replace this text
with a detailed and high quality description of your changes.

Include a link to a bug report or enhancement request.
2026-01-30 12:22:37 -08:00
Charley Cunningham
2457bb3c40 Fix deploy (#10251)
Fix
https://github.com/openai/codex/actions/runs/21527697445/job/62035898666
2026-01-30 11:57:13 -08:00
Ahmed Ibrahim
9b29a48a09 Plan mode prompt (#10238)
# External (non-OpenAI) Pull Request Requirements

Before opening this Pull Request, please read the dedicated
"Contributing" markdown file or your PR may be closed:
https://github.com/openai/codex/blob/main/docs/contributing.md

If your PR conforms to our contribution guidelines, replace this text
with a detailed and high quality description of your changes.

Include a link to a bug report or enhancement request.
2026-01-30 11:48:03 -08:00
Michael Bolin
e6d913af2d chore: rename ChatGpt -> Chatgpt in type names (#10244)
When using ChatGPT in names of types, we should be consistent, so this
renames some types with `ChatGpt` in the name to `Chatgpt`. From
https://rust-lang.github.io/api-guidelines/naming.html:

> In `UpperCamelCase`, acronyms and contractions of compound words count
as one word: use `Uuid` rather than `UUID`, `Usize` rather than `USize`
or `Stdin` rather than `StdIn`. In `snake_case`, acronyms and
contractions are lower-cased: `is_xid_start`.

This PR updates existing uses of `ChatGpt` and changes them to
`Chatgpt`. Though in all cases where it could affect the wire format, I
visually inspected that we don't change anything there. That said, this
_will_ change the codegen because it will affect the spelling of type
names.

For example, this renames `AuthMode::ChatGPT` to `AuthMode::Chatgpt` in
`app-server-protocol`, but the wire format is still `"chatgpt"`.

This PR also updates a number of types in `codex-rs/core/src/auth.rs`.
2026-01-30 11:18:39 -08:00
Charley Cunningham
2d10aa6859 Tui: hide Code mode footer label (#10063)
Title
Hide Code mode footer label/cycle hint; add Plan footer-collapse
snapshots

Summary
- Keep Code mode internal naming but suppress the footer mode label +
cycle hint when Code is active.
- Only show the cycle hint when a non‑Code mode indicator is present.
- Add Plan-mode footer collapse snapshot coverage (empty + queued,
across widths) and update existing footer collapse snapshots for the new
Code behavior.

Notes
- The test run currently fails in codex-cloud-requirements on
origin/main due to a stale auth.mode field; no fix is included in this
PR to keep the diff minimal.

Codex author
`codex resume 019c0296-cfd4-7193-9b0a-6949048e4546`
2026-01-30 11:15:21 -08:00
Charley Cunningham
ec4a2d07e4 Plan mode: stream proposed plans, emit plan items, and render in TUI (#9786)
## Summary
- Stream proposed plans in Plan Mode using `<proposed_plan>` tags parsed
in core, emitting plan deltas plus a plan `ThreadItem`, while stripping
tags from normal assistant output.
- Persist plan items and rebuild them on resume so proposed plans show
in thread history.
- Wire plan items/deltas through app-server protocol v2 and render a
dedicated proposed-plan view in the TUI, including the “Implement this
plan?” prompt only when a plan item is present.

## Changes

### Core (`codex-rs/core`)
- Added a generic, line-based tag parser that buffers each line until it
can disprove a tag prefix; implements auto-close on `finish()` for
unterminated tags. `codex-rs/core/src/tagged_block_parser.rs`
- Refactored proposed plan parsing to wrap the generic parser.
`codex-rs/core/src/proposed_plan_parser.rs`
- In plan mode, stream assistant deltas as:
  - **Normal text** → `AgentMessageContentDelta`
  - **Plan text** → `PlanDelta` + `TurnItem::Plan` start/completion  
  (`codex-rs/core/src/codex.rs`)
- Final plan item content is derived from the completed assistant
message (authoritative), not necessarily the concatenated deltas.
- Strips `<proposed_plan>` blocks from assistant text in plan mode so
tags don’t appear in normal messages.
(`codex-rs/core/src/stream_events_utils.rs`)
- Persist `ItemCompleted` events only for plan items for rollout replay.
(`codex-rs/core/src/rollout/policy.rs`)
- Guard `update_plan` tool in Plan Mode with a clear error message.
(`codex-rs/core/src/tools/handlers/plan.rs`)
- Updated Plan Mode prompt to:  
  - keep `<proposed_plan>` out of non-final reasoning/preambles  
  - require exact tag formatting  
  - allow only one `<proposed_plan>` block per turn  
  (`codex-rs/core/templates/collaboration_mode/plan.md`)

### Protocol / App-server protocol
- Added `TurnItem::Plan` and `PlanDeltaEvent` to core protocol items.
(`codex-rs/protocol/src/items.rs`, `codex-rs/protocol/src/protocol.rs`)
- Added v2 `ThreadItem::Plan` and `PlanDeltaNotification` with
EXPERIMENTAL markers and note that deltas may not match the final plan
item. (`codex-rs/app-server-protocol/src/protocol/v2.rs`)
- Added plan delta route in app-server protocol common mapping.
(`codex-rs/app-server-protocol/src/protocol/common.rs`)
- Rebuild plan items from persisted `ItemCompleted` events on resume.
(`codex-rs/app-server-protocol/src/protocol/thread_history.rs`)

### App-server
- Forward plan deltas to v2 clients and map core plan items to v2 plan
items. (`codex-rs/app-server/src/bespoke_event_handling.rs`,
`codex-rs/app-server/src/codex_message_processor.rs`)
- Added v2 plan item tests.
(`codex-rs/app-server/tests/suite/v2/plan_item.rs`)

### TUI
- Added a dedicated proposed plan history cell with special background
and padding, and moved “• Proposed Plan” outside the highlighted block.
(`codex-rs/tui/src/history_cell.rs`, `codex-rs/tui/src/style.rs`)
- Only show “Implement this plan?” when a plan item exists.
(`codex-rs/tui/src/chatwidget.rs`,
`codex-rs/tui/src/chatwidget/tests.rs`)

<img width="831" height="847" alt="Screenshot 2026-01-29 at 7 06 24 PM"
src="https://github.com/user-attachments/assets/69794c8c-f96b-4d36-92ef-c1f5c3a8f286"
/>

### Docs / Misc
- Updated protocol docs to mention plan deltas.
(`codex-rs/docs/protocol_v1.md`)
- Minor plumbing updates in exec/debug clients to tolerate plan deltas.
(`codex-rs/debug-client/src/reader.rs`, `codex-rs/exec/...`)

## Tests
- Added core integration tests:
  - Plan mode strips plan from agent messages.
  - Missing `</proposed_plan>` closes at end-of-message.  
  (`codex-rs/core/tests/suite/items.rs`)
- Added unit tests for generic tag parser (prefix buffering, non-tag
lines, auto-close). (`codex-rs/core/src/tagged_block_parser.rs`)
- Existing app-server plan item tests in v2.
(`codex-rs/app-server/tests/suite/v2/plan_item.rs`)

## Notes / Behavior
- Plan output no longer appears in standard assistant text in Plan Mode;
it streams via `PlanDelta` and completes as a `TurnItem::Plan`.
- The final plan item content is authoritative and may diverge from
streamed deltas (documented as experimental).
- Reasoning summaries are not filtered; prompt instructs the model not
to include `<proposed_plan>` outside the final plan message.

## Codex Author
`codex fork 019bec2d-b09d-7450-b292-d7bcdddcdbfb`
2026-01-30 18:59:30 +00:00
Michael Bolin
40bf11bd52 chore: fix the build breakage that came from a merge race (#10239)
I think I needed to rebase on top of
https://github.com/openai/codex/pull/10167 before merging
https://github.com/openai/codex/pull/10208.
2026-01-30 10:29:54 -08:00
baumann-oai
1ce722ed2e plan mode: add TL;DR checkpoint and client behavior note (#10195)
## Summary
- Tightens Plan Mode to encourage exploration-first behavior and more
back-and-forth alignment.
- Adds a required TL;DR checkpoint before drafting the full plan.
- Clarifies client behavior that can cause premature “Implement this
plan?” prompts.

## What changed
- Require at least one targeted non-mutating exploration pass before the
first user question.
- Insert a TL;DR checkpoint between Phase 2 (intent) and Phase 3
(implementation).
- TL;DR checkpoint guidance:
  - Label: “Proposed Plan (TL;DR)”
  - Format: 3–5 bullets using `- `
  - Options: exactly one option, “Approve”
- `isOther: true`, with explicit guidance that “None of the above” is
the edit path in the current UI.
- Require the final plan to include a TL;DR consistent with the approved
checkpoint.

## Why
- In Plan Mode, any normal assistant message at turn completion is
treated as plan content by the client. This can trigger premature
“Implement this plan?” prompts.
- The TL;DR checkpoint aligns on direction before Codex drafts a long,
decision-complete plan.

## Testing
- Manual: built the local CLI and verified the flow now explores first,
presents a TL;DR checkpoint, and only drafts the full plan after
approval.

---------

Co-authored-by: Nick Baumann <@openai.com>
2026-01-30 10:14:46 -08:00
gt-oai
5662eb8b75 Load exec policy rules from requirements (#10190)
`requirements.toml` should be able to specify rules which always run. 

My intention here was that these rules could only ever be restrictive,
which means the decision can be "prompt" or "forbidden" but never
"allow". A requirement of "you must always allow this command" didn't
make sense to me, but happy to be gaveled otherwise.

Rules already applies the most restrictive decision, so we can safely
merge these with rules found in other config folders.
2026-01-30 18:04:09 +00:00
Dylan Hurd
23db79fae2 chore(feature) Experimental: Smart Approvals (#10211)
## Summary
Let's start getting feedback on this feature 😅 

## Testing
- [x] existing tests pass
2026-01-30 10:41:37 -07:00
Dylan Hurd
dfafc546ab chore(feature) Experimental: Personality (#10212)
## Summary
Let users start opting in to trying out personalities

## Testing
- [x] existing tests pass
2026-01-30 10:41:22 -07:00
Michael Bolin
377ab0c77c feat: refactor CodexAuth so invalid state cannot be represented (#10208)
Previously, `CodexAuth` was defined as follows:


d550fbf41a/codex-rs/core/src/auth.rs (L39-L46)

But if you looked at its constructors, we had creation for
`AuthMode::ApiKey` where `storage` was built using a nonsensical path
(`PathBuf::new()`) and `auth_dot_json` was `None`:


d550fbf41a/codex-rs/core/src/auth.rs (L212-L220)

By comparison, when `AuthMode::ChatGPT` was used, `api_key` was always
`None`:


d550fbf41a/codex-rs/core/src/auth.rs (L665-L671)

https://github.com/openai/codex/pull/10012 took things further because
it introduced a new `ChatgptAuthTokens` variant to `AuthMode`, which is
important in when invoking `account/login/start` via the app server, but
most logic _internal_ to the app server should just reason about two
`AuthMode` variants: `ApiKey` and `ChatGPT`.

This PR tries to clean things up as follows:

- `LoginAccountParams` and `AuthMode` in `codex-rs/app-server-protocol/`
both continue to have the `ChatgptAuthTokens` variant, though it is used
exclusively for the on-the-wire messaging.
- `codex-rs/core/src/auth.rs` now has its own `AuthMode` enum, which
only has two variants: `ApiKey` and `ChatGPT`.
- `CodexAuth` has been changed from a struct to an enum. It is a
disjoint union where each variant (`ApiKey`, `ChatGpt`, and
`ChatGptAuthTokens`) have only the associated fields that make sense for
that variant.

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/10208).
* #10224
* __->__ #10208
2026-01-30 09:33:23 -08:00
jif-oai
0212f4010e nit: fix db with multiple metadata lines (#10237) 2026-01-30 17:32:10 +00:00
jif-oai
079f4952e0 feat: heuristic coloring of logs (#10228) 2026-01-30 18:26:49 +01:00
jif-oai
eff11f792b feat: improve logs client (#10229) 2026-01-30 18:23:18 +01:00
jif-oai
887bec0dee chore: do not clean the DB anymore (#10232) 2026-01-30 18:23:00 +01:00
jif-oai
09d25e91e9 fix: make sure the shell exists (#10222) 2026-01-30 14:18:31 +01:00
jif-oai
6cee538380 explorer prompt (#10225) 2026-01-30 13:50:33 +01:00
gt-oai
e85d019daa Fetch Requirements from cloud (#10167)
Load requirements from Codex Backend. It only does this for enterprise
customers signed in with ChatGPT.

Todo in follow-up PRs:
* Add to app-server and exec too
* Switch from fail-open to fail-closed on failure
2026-01-30 12:03:29 +00:00
pap-openai
1ef5455eb6 Conversation naming (#8991)
Session renaming:
- `/rename my_session`
- `/rename` without arg and passing an argument in `customViewPrompt`
- AppExitInfo shows resume hint using the session name if set instead of
uuid, defaults to uuid if not set
- Names are stored in `CODEX_HOME/sessions.jsonl`

Session resuming:
- codex resume <name> lookup for `CODEX_HOME/sessions.jsonl` first entry
matching the name and resumes the session

---------

Co-authored-by: jif-oai <jif@openai.com>
2026-01-30 10:40:09 +00:00
jif-oai
25ad414680 chore: unify metric (#10220) 2026-01-30 11:13:43 +01:00
jif-oai
129787493f feat: backfill timing metric (#10218)
1. Add a metric to measure the backfill time
2. Add a unit to the timing histogram
2026-01-30 10:19:41 +01:00
Shijie Rao
a0ccef9d5c Chore: plan mode do not include free form question and always include isOther (#10210)
We should never ask a freeform question when planning and we should
always include isOther as an escape hatch.
2026-01-30 01:19:24 -08:00
Josh McKinney
c0cad80668 Add community links to startup tooltips (#10177)
## Summary
- add startup tooltip for OpenAI community Discord
- add startup tooltip for Codex community forum

## Testing
- not run (text-only tooltip change)
2026-01-30 10:14:15 +01:00
jif-oai
f8056e62d4 nit: actually run tests (#10217) 2026-01-30 10:02:46 +01:00
jif-oai
a270a28a06 feat: add output to /ps (#10154)
<img width="599" height="238" alt="Screenshot 2026-01-29 at 13 24 57"
src="https://github.com/user-attachments/assets/1e9a5af2-f649-476c-b310-ae4938814538"
/>
2026-01-30 09:00:44 +01:00
Matthew Zeng
34f89b12d0 MCP tool call approval (simplified version) (#10200)
Add elicitation approval request for MCP tool call requests.
2026-01-29 23:40:32 -08:00
Dylan Hurd
e3ab0bd973 chore(personality) new schema with fallbacks (#10147)
## Summary
Let's dial in this api contract in a bit more with more robust fallback
behavior when model_instructions_template is false.

Switches to a more explicit template / variables structure, with more
fallbacks.

## Testing
- [x] Adding unit tests
- [x] Tested locally
2026-01-30 00:10:12 -07:00
852 changed files with 22018 additions and 4521 deletions

View File

@@ -15,10 +15,10 @@ Things to look out for when doing the review:
## Code Organization
- Each create in the Cargo workspace in `codex-rs` has a specific purpose: make a note if you believe new code is not introduced in the correct crate.
- Each crate in the Cargo workspace in `codex-rs` has a specific purpose: make a note if you believe new code is not introduced in the correct crate.
- When possible, try to keep the `core` crate as small as possible. Non-core but shared logic is often a good candidate for `codex-rs/common`.
- Be wary of large files and offer suggestions for how to break things into more reasonably-sized files.
- Rust files should generally be organized such that the public parts of the API appear near the top of the file and helper functions go below. This is analagous to the "inverted pyramid" structure that is favored in journalism.
- Rust files should generally be organized such that the public parts of the API appear near the top of the file and helper functions go below. This is analogous to the "inverted pyramid" structure that is favored in journalism.
## Assertions in Tests

View File

@@ -38,9 +38,10 @@ jobs:
- If applicable, add one of the following labels to specify which sub-product or product surface the issue relates to.
1. CLI — the Codex command line interface.
2. extension — VS Code (or other IDE) extension-specific issues.
3. codex-web — Issues targeting the Codex web UI/Cloud experience.
4. github-action — Issues with the Codex GitHub action.
5. iOS — Issues with the Codex iOS app.
3. app - Issues related to the Codex desktop application.
4. codex-web — Issues targeting the Codex web UI/Cloud experience.
5. github-action — Issues with the Codex GitHub action.
6. iOS — Issues with the Codex iOS app.
- Additionally add zero or more of the following labels that are relevant to the issue content. Prefer a small set of precise labels over many broad ones.
1. windows-os — Bugs or friction specific to Windows environments (always when PowerShell is mentioned, path handling, copy/paste, OS-specific auth or tooling failures).

View File

@@ -1,7 +1,7 @@
<p align="center"><code>npm i -g @openai/codex</code><br />or <code>brew install --cask codex</code></p>
<p align="center"><strong>Codex CLI</strong> is a coding agent from OpenAI that runs locally on your computer.
<p align="center">
<img src="./.github/codex-cli-splash.png" alt="Codex CLI splash" width="80%" />
<img src="https://github.com/openai/codex/blob/main/.github/codex-cli-splash.png" alt="Codex CLI splash" width="80%" />
</p>
</br>
If you want Codex in your code editor (VS Code, Cursor, Windsurf), <a href="https://developers.openai.com/codex/ide">install in your IDE.</a>

View File

@@ -14,4 +14,4 @@ target_app = "cli"
[[announcements]]
content = "This is a test announcement"
version_regex = "^0\\.0\\.0$"
to_date = "2026-01-10"
to_date = "2026-05-10"

1821
codex-rs/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -5,15 +5,13 @@ members = [
"async-utils",
"app-server",
"app-server-protocol",
"app-server-protocol-stable-export",
"app-server-json-schema",
"app-server-ts-types",
"app-server-test-client",
"debug-client",
"apply-patch",
"arg0",
"feedback",
"codex-backend-openapi-models",
"cloud-requirements",
"cloud-tasks",
"cloud-tasks-client",
"cli",
@@ -45,12 +43,14 @@ members = [
"utils/cache",
"utils/image",
"utils/json-to-toml",
"utils/home-dir",
"utils/pty",
"utils/readiness",
"utils/string",
"codex-client",
"codex-api",
"state",
"codex-experimental-api-macros",
]
resolver = "2"
@@ -69,13 +69,13 @@ app_test_support = { path = "app-server/tests/common" }
codex-ansi-escape = { path = "ansi-escape" }
codex-api = { path = "codex-api" }
codex-app-server = { path = "app-server" }
codex-app-server-json-schema = { path = "app-server-json-schema" }
codex-app-server-protocol = { path = "app-server-protocol" }
codex-app-server-ts-types = { path = "app-server-ts-types" }
codex-app-server-test-client = { path = "app-server-test-client" }
codex-apply-patch = { path = "apply-patch" }
codex-arg0 = { path = "arg0" }
codex-async-utils = { path = "async-utils" }
codex-backend-client = { path = "backend-client" }
codex-cloud-requirements = { path = "cloud-requirements" }
codex-chatgpt = { path = "chatgpt" }
codex-cli = { path = "cli"}
codex-client = { path = "codex-client" }
@@ -83,6 +83,7 @@ codex-common = { path = "common" }
codex-core = { path = "core" }
codex-exec = { path = "exec" }
codex-execpolicy = { path = "execpolicy" }
codex-experimental-api-macros = { path = "codex-experimental-api-macros" }
codex-feedback = { path = "feedback" }
codex-file-search = { path = "file-search" }
codex-git = { path = "utils/git" }
@@ -105,6 +106,7 @@ codex-utils-cache = { path = "utils/cache" }
codex-utils-cargo-bin = { path = "utils/cargo-bin" }
codex-utils-image = { path = "utils/image" }
codex-utils-json-to-toml = { path = "utils/json-to-toml" }
codex-utils-home-dir = { path = "utils/home-dir" }
codex-utils-pty = { path = "utils/pty" }
codex-utils-readiness = { path = "utils/readiness" }
codex-utils-string = { path = "utils/string" }
@@ -156,6 +158,7 @@ image = { version = "^0.25.9", default-features = false }
include_dir = "0.7.4"
indexmap = "2.12.0"
insta = "1.46.0"
inventory = "0.3.19"
itertools = "0.14.0"
keyring = { version = "3.6", default-features = false }
landlock = "0.4.4"

View File

@@ -1,21 +0,0 @@
load("//:defs.bzl", "codex_rust_crate")
stable_files = glob(
include = ["stable/**"],
allow_empty = True,
exclude = [
"**/* *",
"BUILD.bazel",
"Cargo.toml",
],
)
codex_rust_crate(
name = "app-server-json-schema",
compile_data = stable_files,
crate_name = "codex_app_server_json_schema",
extra_binaries = [
"//codex-rs/app-server-protocol-stable-export:codex-app-server-protocol-stable-export",
],
test_data_extra = stable_files,
)

View File

@@ -1,17 +0,0 @@
[package]
name = "codex-app-server-json-schema"
version.workspace = true
edition.workspace = true
license.workspace = true
[lints]
workspace = true
[dependencies]
include_dir = { workspace = true }
[dev-dependencies]
anyhow = { workspace = true }
codex-utils-cargo-bin = { workspace = true }
pretty_assertions = { workspace = true }
tempfile = { workspace = true }

View File

@@ -1,39 +0,0 @@
use std::ffi::OsStr;
use std::fs;
use std::io;
use std::path::Path;
static STABLE_APP_SERVER_JSON_SCHEMA_DIR: include_dir::Dir<'_> =
include_dir::include_dir!("$CARGO_MANIFEST_DIR/stable");
/// Write the bundled stable JSON Schema artifacts to `out_dir`.
pub fn write_stable_json_schema(out_dir: &Path) -> io::Result<()> {
fs::create_dir_all(out_dir)?;
write_dir_recursive(&STABLE_APP_SERVER_JSON_SCHEMA_DIR, out_dir, "json")
}
fn write_dir_recursive(
dir: &include_dir::Dir<'_>,
out_dir: &Path,
extension: &str,
) -> io::Result<()> {
for file in dir.files() {
if file
.path()
.extension()
.is_some_and(|ext| ext == OsStr::new(extension))
{
let out_path = out_dir.join(file.path());
if let Some(parent) = out_path.parent() {
fs::create_dir_all(parent)?;
}
fs::write(out_path, file.contents())?;
}
}
for child in dir.dirs() {
write_dir_recursive(child, out_dir, extension)?;
}
Ok(())
}

View File

@@ -1,42 +0,0 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"oneOf": [
{
"properties": {
"apiKey": {
"type": "string"
},
"type": {
"enum": [
"apiKey"
],
"title": "ApiKeyv2::LoginAccountParamsType",
"type": "string"
}
},
"required": [
"apiKey",
"type"
],
"title": "ApiKeyv2::LoginAccountParams",
"type": "object"
},
{
"properties": {
"type": {
"enum": [
"chatgpt"
],
"title": "Chatgptv2::LoginAccountParamsType",
"type": "string"
}
},
"required": [
"type"
],
"title": "Chatgptv2::LoginAccountParams",
"type": "object"
}
],
"title": "LoginAccountParams"
}

View File

@@ -1,108 +0,0 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"AskForApproval": {
"enum": [
"untrusted",
"on-failure",
"on-request",
"never"
],
"type": "string"
},
"Personality": {
"enum": [
"friendly",
"pragmatic"
],
"type": "string"
},
"SandboxMode": {
"enum": [
"read-only",
"workspace-write",
"danger-full-access"
],
"type": "string"
}
},
"description": "There are three ways to resume a thread: 1. By thread_id: load the thread from disk by thread_id and resume it. 2. By history: instantiate the thread from memory and resume it. 3. By path: load the thread from disk by path and resume it.\n\nThe precedence is: history > path > thread_id. If using history or path, the thread_id param will be ignored.\n\nPrefer using thread_id whenever possible.",
"properties": {
"approvalPolicy": {
"anyOf": [
{
"$ref": "#/definitions/AskForApproval"
},
{
"type": "null"
}
]
},
"baseInstructions": {
"type": [
"string",
"null"
]
},
"config": {
"additionalProperties": true,
"type": [
"object",
"null"
]
},
"cwd": {
"type": [
"string",
"null"
]
},
"developerInstructions": {
"type": [
"string",
"null"
]
},
"model": {
"description": "Configuration overrides for the resumed thread, if any.",
"type": [
"string",
"null"
]
},
"modelProvider": {
"type": [
"string",
"null"
]
},
"personality": {
"anyOf": [
{
"$ref": "#/definitions/Personality"
},
{
"type": "null"
}
]
},
"sandbox": {
"anyOf": [
{
"$ref": "#/definitions/SandboxMode"
},
{
"type": "null"
}
]
},
"threadId": {
"type": "string"
}
},
"required": [
"threadId"
],
"title": "ThreadResumeParams",
"type": "object"
}

View File

@@ -1,132 +0,0 @@
use anyhow::Context;
use anyhow::Result;
use anyhow::bail;
use codex_utils_cargo_bin::cargo_bin;
use codex_utils_cargo_bin::repo_root;
use codex_utils_cargo_bin::runfiles_available;
use pretty_assertions::assert_eq;
use std::collections::BTreeMap;
use std::collections::BTreeSet;
use std::ffi::OsStr;
use std::fs;
use std::path::Path;
use std::path::PathBuf;
use std::process::Command;
use tempfile::TempDir;
const STABLE_EXPORT_BIN: &str = "codex-app-server-protocol-stable-export";
#[test]
fn stable_json_schema_match_generation() -> Result<()> {
let repo_root = repo_root()?;
let codex_rs = repo_root.join("codex-rs");
let hint = "run: just write-app-server-protocol-stable";
let expected_dir = codex_utils_cargo_bin::find_resource!("stable").with_context(|| {
"failed to resolve stable JSON Schema artifacts in this package; ".to_owned() + hint
})?;
let temp_dir = TempDir::new()?;
let out_dir = temp_dir.path().join("generated");
let output = if option_env!("BAZEL_PACKAGE").is_some() || runfiles_available() {
let stable_export_bin = cargo_bin(STABLE_EXPORT_BIN)
.context("failed to resolve stable-export binary via cargo_bin")?;
Command::new(stable_export_bin)
.current_dir(&codex_rs)
.args(["--out"])
.arg(&out_dir)
.output()
.context("failed to run stable-export binary to generate artifacts")?
} else {
// Use a separate cargo invocation with an isolated target dir to avoid
// workspace feature unification (notably `codex-experimental-api`).
let target_dir = temp_dir.path().join("cargo-target");
Command::new("cargo")
.current_dir(&codex_rs)
.env("CARGO_TARGET_DIR", &target_dir)
.args(["run", "-p", STABLE_EXPORT_BIN, "--", "--out"])
.arg(&out_dir)
.output()
.context("failed to run cargo to generate stable app-server protocol artifacts")?
};
if !output.status.success() {
let status = output.status;
let stdout = String::from_utf8_lossy(&output.stdout);
let stderr = String::from_utf8_lossy(&output.stderr);
bail!("cargo run failed with status {status}\nstdout:\n{stdout}\nstderr:\n{stderr}");
}
let expected = collect_files(&expected_dir, "json")?;
let generated = collect_files(&out_dir, "json")?;
let diffs = compare_maps(&expected, &generated, "json");
let assert_hint = "If this fails, run: just write-app-server-protocol-stable";
assert_eq!(diffs, Vec::<String>::new(), "{assert_hint}");
Ok(())
}
fn compare_maps(
expected: &BTreeMap<PathBuf, Vec<u8>>,
generated: &BTreeMap<PathBuf, Vec<u8>>,
label: &str,
) -> Vec<String> {
let expected_paths: BTreeSet<PathBuf> = expected.keys().cloned().collect();
let generated_paths: BTreeSet<PathBuf> = generated.keys().cloned().collect();
let mut diffs = Vec::new();
for missing in expected_paths.difference(&generated_paths) {
let missing = missing.display();
diffs.push(format!("missing generated {label} file: {missing}"));
}
for extra in generated_paths.difference(&expected_paths) {
let extra = extra.display();
diffs.push(format!("unexpected generated {label} file: {extra}"));
}
for path in expected_paths.intersection(&generated_paths) {
let Some(expected_bytes) = expected.get(path) else {
let path = path.display();
diffs.push(format!(
"expected {label} artifacts missing intersection file: {path}"
));
continue;
};
let Some(generated_bytes) = generated.get(path) else {
let path = path.display();
diffs.push(format!(
"generated {label} artifacts missing intersection file: {path}"
));
continue;
};
if expected_bytes != generated_bytes {
let path = path.display();
diffs.push(format!("generated {label} file contents differ: {path}"));
}
}
diffs
}
fn collect_files(root: &Path, extension: &str) -> Result<BTreeMap<PathBuf, Vec<u8>>> {
let mut files = BTreeMap::new();
let mut stack = vec![root.to_path_buf()];
while let Some(dir) = stack.pop() {
for entry in fs::read_dir(&dir)? {
let entry = entry?;
let path = entry.path();
if path.is_dir() {
stack.push(path);
continue;
}
if path
.extension()
.is_some_and(|ext| ext == OsStr::new(extension))
{
let rel_path = path.strip_prefix(root)?;
let bytes = fs::read(&path)?;
files.insert(rel_path.to_path_buf(), bytes);
}
}
}
Ok(files)
}

View File

@@ -1,26 +0,0 @@
# load("//:defs.bzl", "codex_rust_crate")
load("@rules_rust//rust:defs.bzl", "rust_binary")
# codex_rust_crate(
# name = "app-server-protocol-stable-export",
# crate_name = "codex_app_server_protocol_stable_export",
# alt_deps = {
# "//codex-rs/app-server-protocol:app-server-protocol": "//codex-rs/app-server-protocol:app-server-protocol-stable",
# },
# )
rust_binary(
name = "codex-app-server-protocol-stable-export",
srcs = ["//codex-rs/app-server-protocol-stable-export:src/main.rs"],
crate_name = "codex_app_server_protocol_stable_export",
crate_root = "//codex-rs/app-server-protocol-stable-export:src/main.rs",
generator_function = "codex_rust_crate",
generator_location = "codex-rs/app-server-protocol-stable-export/BUILD.bazel:3:17",
generator_name = "app-server-protocol-stable-export",
visibility = ["//visibility:public"],
deps = [
"//codex-rs/app-server-protocol:app-server-protocol-stable",
"@crates//:anyhow-1.0.100",
"@crates//:clap-4.5.54",
],
)

View File

@@ -1,17 +0,0 @@
[package]
name = "codex-app-server-protocol-stable-export"
version.workspace = true
edition.workspace = true
license.workspace = true
[[bin]]
name = "codex-app-server-protocol-stable-export"
path = "src/main.rs"
[lints]
workspace = true
[dependencies]
anyhow = { workspace = true }
clap = { workspace = true, features = ["derive"] }
codex-app-server-protocol = { path = "../app-server-protocol", default-features = false }

View File

@@ -1,22 +0,0 @@
use anyhow::Result;
use clap::Parser;
use std::path::PathBuf;
#[derive(Parser, Debug)]
#[command(
about = "Generate stable TypeScript bindings and JSON Schemas for the Codex app-server protocol"
)]
struct Args {
/// Output directory where generated files will be written
#[arg(short = 'o', long = "out", value_name = "DIR")]
out_dir: PathBuf,
/// Optional Prettier executable path to format generated TypeScript files
#[arg(short = 'p', long = "prettier", value_name = "PRETTIER_BIN")]
prettier: Option<PathBuf>,
}
fn main() -> Result<()> {
let args = Args::parse();
codex_app_server_protocol::generate_types(&args.out_dir, args.prettier.as_deref())
}

View File

@@ -2,11 +2,6 @@ load("//:defs.bzl", "codex_rust_crate")
codex_rust_crate(
name = "app-server-protocol",
crate_features = ["codex-experimental-api"],
crate_name = "codex_app_server_protocol",
alt_rules = {
"app-server-protocol-stable": {
"crate_features": [],
}
}
test_data_extra = glob(["schema/**"], allow_empty = True),
)

View File

@@ -11,14 +11,11 @@ path = "src/lib.rs"
[lints]
workspace = true
[features]
default = ["codex-experimental-api"]
codex-experimental-api = []
[dependencies]
anyhow = { workspace = true }
clap = { workspace = true, features = ["derive"] }
codex-protocol = { workspace = true }
codex-experimental-api-macros = { workspace = true }
codex-utils-absolute-path = { workspace = true }
mcp-types = { workspace = true }
schemars = { workspace = true }
@@ -27,8 +24,12 @@ serde_json = { workspace = true }
strum_macros = { workspace = true }
thiserror = { workspace = true }
ts-rs = { workspace = true }
inventory = { workspace = true }
uuid = { workspace = true, features = ["serde", "v7"] }
[dev-dependencies]
anyhow = { workspace = true }
codex-utils-cargo-bin = { workspace = true }
pretty_assertions = { workspace = true }
similar = { workspace = true }
tempfile = { workspace = true }

View File

@@ -0,0 +1,33 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"ChatgptAuthTokensRefreshReason": {
"oneOf": [
{
"description": "Codex attempted a backend request and received `401 Unauthorized`.",
"enum": [
"unauthorized"
],
"type": "string"
}
]
}
},
"properties": {
"previousAccountId": {
"description": "Workspace/account identifier that Codex was previously using.\n\nClients that manage multiple accounts/workspaces can use this as a hint to refresh the token for the correct workspace.\n\nThis may be `null` when the prior ID token did not include a workspace identifier (`chatgpt_account_id`) or when the token could not be parsed.",
"type": [
"string",
"null"
]
},
"reason": {
"$ref": "#/definitions/ChatgptAuthTokensRefreshReason"
}
},
"required": [
"reason"
],
"title": "ChatgptAuthTokensRefreshParams",
"type": "object"
}

View File

@@ -0,0 +1,17 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"accessToken": {
"type": "string"
},
"idToken": {
"type": "string"
}
},
"required": [
"accessToken",
"idToken"
],
"title": "ChatgptAuthTokensRefreshResponse",
"type": "object"
}

View File

@@ -9,6 +9,10 @@
"properties": {
"conversationId": {
"$ref": "#/definitions/ThreadId"
},
"experimentalRawEvents": {
"default": false,
"type": "boolean"
}
},
"required": [
@@ -156,6 +160,22 @@
],
"type": "object"
},
"CollaborationMode": {
"description": "Collaboration mode for a Codex session.",
"properties": {
"mode": {
"$ref": "#/definitions/ModeKind"
},
"settings": {
"$ref": "#/definitions/Settings"
}
},
"required": [
"mode",
"settings"
],
"type": "object"
},
"CommandExecParams": {
"properties": {
"command": {
@@ -654,8 +674,29 @@
],
"type": "object"
},
"InitializeCapabilities": {
"description": "Client-declared capabilities negotiated during initialize.",
"properties": {
"experimentalApi": {
"default": false,
"description": "Opt into receiving experimental API methods and fields.",
"type": "boolean"
}
},
"type": "object"
},
"InitializeParams": {
"properties": {
"capabilities": {
"anyOf": [
{
"$ref": "#/definitions/InitializeCapabilities"
},
{
"type": "null"
}
]
},
"clientInfo": {
"$ref": "#/definitions/ClientInfo"
}
@@ -922,6 +963,33 @@
],
"title": "ChatgptLoginAccountParams",
"type": "object"
},
{
"description": "[UNSTABLE] FOR OPENAI INTERNAL USE ONLY - DO NOT USE. The access token must contain the same scopes that Codex-managed ChatGPT auth tokens have.",
"properties": {
"accessToken": {
"description": "Access token (JWT) supplied by the client. This token is used for backend API requests.",
"type": "string"
},
"idToken": {
"description": "ID token (JWT) supplied by the client.\n\nThis token is used for identity and account metadata (email, plan type, workspace id).",
"type": "string"
},
"type": {
"enum": [
"chatgptAuthTokens"
],
"title": "ChatgptAuthTokensLoginAccountParamsType",
"type": "string"
}
},
"required": [
"accessToken",
"idToken",
"type"
],
"title": "ChatgptAuthTokensLoginAccountParams",
"type": "object"
}
]
},
@@ -970,6 +1038,17 @@
],
"type": "string"
},
"ModeKind": {
"description": "Initial collaboration mode to use when the TUI starts.",
"enum": [
"plan",
"code",
"pair_programming",
"execute",
"custom"
],
"type": "string"
},
"ModelListParams": {
"properties": {
"cursor": {
@@ -2031,6 +2110,34 @@
},
"type": "object"
},
"Settings": {
"description": "Settings for a collaboration mode.",
"properties": {
"developer_instructions": {
"type": [
"string",
"null"
]
},
"model": {
"type": "string"
},
"reasoning_effort": {
"anyOf": [
{
"$ref": "#/definitions/ReasoningEffort"
},
{
"type": "null"
}
]
}
},
"required": [
"model"
],
"type": "object"
},
"SkillsConfigWriteParams": {
"properties": {
"enabled": {
@@ -2147,6 +2254,13 @@
"null"
]
},
"path": {
"description": "[UNSTABLE] Specify the rollout path to fork from. If specified, the thread_id param will be ignored.",
"type": [
"string",
"null"
]
},
"sandbox": {
"anyOf": [
{
@@ -2303,6 +2417,16 @@
"null"
]
},
"history": {
"description": "[UNSTABLE] FOR CODEX CLOUD - DO NOT USE. If specified, the thread will be resumed with the provided history instead of loaded from disk.",
"items": {
"$ref": "#/definitions/ResponseItem"
},
"type": [
"array",
"null"
]
},
"model": {
"description": "Configuration overrides for the resumed thread, if any.",
"type": [
@@ -2316,6 +2440,13 @@
"null"
]
},
"path": {
"description": "[UNSTABLE] Specify the rollout path to resume from. If specified, the thread_id param will be ignored.",
"type": [
"string",
"null"
]
},
"personality": {
"anyOf": [
{
@@ -2363,6 +2494,21 @@
],
"type": "object"
},
"ThreadSetNameParams": {
"properties": {
"name": {
"type": "string"
},
"threadId": {
"type": "string"
}
},
"required": [
"name",
"threadId"
],
"type": "object"
},
"ThreadSortKey": {
"enum": [
"created_at",
@@ -2422,21 +2568,17 @@
"null"
]
},
"dynamicTools": {
"items": {
"$ref": "#/definitions/DynamicToolSpec"
},
"type": [
"array",
"null"
]
},
"ephemeral": {
"type": [
"boolean",
"null"
]
},
"experimentalRawEvents": {
"default": false,
"description": "If true, opt into emitting raw response items on the event stream.\n\nThis is for internal use only (e.g. Codex Cloud). (TODO): Figure out a better way to categorize internal / experimental events & protocols.",
"type": "boolean"
},
"model": {
"type": [
"string",
@@ -2511,6 +2653,17 @@
],
"description": "Override the approval policy for this turn and subsequent turns."
},
"collaborationMode": {
"anyOf": [
{
"$ref": "#/definitions/CollaborationMode"
},
{
"type": "null"
}
],
"description": "EXPERIMENTAL - set a pre-set collaboration mode. Takes precedence over model, reasoning_effort, and developer instructions if set."
},
"cwd": {
"description": "Override the working directory for this turn and subsequent turns.",
"type": [
@@ -2756,6 +2909,15 @@
"oneOf": [
{
"properties": {
"queries": {
"items": {
"type": "string"
},
"type": [
"array",
"null"
]
},
"query": {
"type": [
"string",
@@ -2968,6 +3130,30 @@
"title": "Thread/archiveRequest",
"type": "object"
},
{
"properties": {
"id": {
"$ref": "#/definitions/RequestId"
},
"method": {
"enum": [
"thread/name/set"
],
"title": "Thread/name/setRequestMethod",
"type": "string"
},
"params": {
"$ref": "#/definitions/ThreadSetNameParams"
}
},
"required": [
"id",
"method",
"params"
],
"title": "Thread/name/setRequest",
"type": "object"
},
{
"properties": {
"id": {

View File

@@ -680,6 +680,14 @@
{
"description": "Agent has started a turn. v1 wire format uses `task_started`; accept `turn_started` for v2 interop.",
"properties": {
"collaboration_mode_kind": {
"allOf": [
{
"$ref": "#/definitions/ModeKind"
}
],
"default": "code"
},
"model_context_window": {
"format": "int64",
"type": [
@@ -1041,12 +1049,14 @@
"description": "How to sandbox commands executed in the system"
},
"session_id": {
"allOf": [
{
"$ref": "#/definitions/ThreadId"
}
],
"description": "Name left as session_id instead of thread_id for backwards compatibility."
"$ref": "#/definitions/ThreadId"
},
"thread_name": {
"description": "Optional user-facing thread name (may be unset).",
"type": [
"string",
"null"
]
},
"type": {
"enum": [
@@ -1070,6 +1080,33 @@
"title": "SessionConfiguredEventMsg",
"type": "object"
},
{
"description": "Updated session metadata (e.g., thread name changes).",
"properties": {
"thread_id": {
"$ref": "#/definitions/ThreadId"
},
"thread_name": {
"type": [
"string",
"null"
]
},
"type": {
"enum": [
"thread_name_updated"
],
"title": "ThreadNameUpdatedEventMsgType",
"type": "string"
}
},
"required": [
"thread_id",
"type"
],
"title": "ThreadNameUpdatedEventMsg",
"type": "object"
},
{
"description": "Incremental MCP startup progress updates.",
"properties": {
@@ -2131,6 +2168,7 @@
"properties": {
"explanation": {
"default": null,
"description": "Arguments for the `update_plan` todo/checklist tool (not plan mode).",
"type": [
"string",
"null"
@@ -2356,6 +2394,38 @@
"title": "AgentMessageContentDeltaEventMsg",
"type": "object"
},
{
"properties": {
"delta": {
"type": "string"
},
"item_id": {
"type": "string"
},
"thread_id": {
"type": "string"
},
"turn_id": {
"type": "string"
},
"type": {
"enum": [
"plan_delta"
],
"title": "PlanDeltaEventMsgType",
"type": "string"
}
},
"required": [
"delta",
"item_id",
"thread_id",
"turn_id",
"type"
],
"title": "PlanDeltaEventMsg",
"type": "object"
},
{
"properties": {
"delta": {
@@ -3206,6 +3276,17 @@
}
]
},
"ModeKind": {
"description": "Initial collaboration mode to use when the TUI starts.",
"enum": [
"plan",
"code",
"pair_programming",
"execute",
"custom"
],
"type": "string"
},
"NetworkAccess": {
"description": "Represents whether outbound network access is available to the agent.",
"enum": [
@@ -4912,6 +4993,30 @@
"title": "AgentMessageTurnItem",
"type": "object"
},
{
"properties": {
"id": {
"type": "string"
},
"text": {
"type": "string"
},
"type": {
"enum": [
"Plan"
],
"title": "PlanTurnItemType",
"type": "string"
}
},
"required": [
"id",
"text",
"type"
],
"title": "PlanTurnItem",
"type": "object"
},
{
"properties": {
"id": {
@@ -5125,6 +5230,15 @@
"oneOf": [
{
"properties": {
"queries": {
"items": {
"type": "string"
},
"type": [
"array",
"null"
]
},
"query": {
"type": [
"string",
@@ -5313,6 +5427,14 @@
{
"description": "Agent has started a turn. v1 wire format uses `task_started`; accept `turn_started` for v2 interop.",
"properties": {
"collaboration_mode_kind": {
"allOf": [
{
"$ref": "#/definitions/ModeKind"
}
],
"default": "code"
},
"model_context_window": {
"format": "int64",
"type": [
@@ -5674,12 +5796,14 @@
"description": "How to sandbox commands executed in the system"
},
"session_id": {
"allOf": [
{
"$ref": "#/definitions/ThreadId"
}
],
"description": "Name left as session_id instead of thread_id for backwards compatibility."
"$ref": "#/definitions/ThreadId"
},
"thread_name": {
"description": "Optional user-facing thread name (may be unset).",
"type": [
"string",
"null"
]
},
"type": {
"enum": [
@@ -5703,6 +5827,33 @@
"title": "SessionConfiguredEventMsg",
"type": "object"
},
{
"description": "Updated session metadata (e.g., thread name changes).",
"properties": {
"thread_id": {
"$ref": "#/definitions/ThreadId"
},
"thread_name": {
"type": [
"string",
"null"
]
},
"type": {
"enum": [
"thread_name_updated"
],
"title": "ThreadNameUpdatedEventMsgType",
"type": "string"
}
},
"required": [
"thread_id",
"type"
],
"title": "ThreadNameUpdatedEventMsg",
"type": "object"
},
{
"description": "Incremental MCP startup progress updates.",
"properties": {
@@ -6764,6 +6915,7 @@
"properties": {
"explanation": {
"default": null,
"description": "Arguments for the `update_plan` todo/checklist tool (not plan mode).",
"type": [
"string",
"null"
@@ -6989,6 +7141,38 @@
"title": "AgentMessageContentDeltaEventMsg",
"type": "object"
},
{
"properties": {
"delta": {
"type": "string"
},
"item_id": {
"type": "string"
},
"thread_id": {
"type": "string"
},
"turn_id": {
"type": "string"
},
"type": {
"enum": [
"plan_delta"
],
"title": "PlanDeltaEventMsgType",
"type": "string"
}
},
"required": [
"delta",
"item_id",
"thread_id",
"turn_id",
"type"
],
"title": "PlanDeltaEventMsg",
"type": "object"
},
{
"properties": {
"delta": {

View File

@@ -1,6 +1,13 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"grantRoot": {
"description": "[UNSTABLE] When set, the agent is asking the user to allow writes under this root for the remainder of the session (unclear if this is honored today).",
"type": [
"string",
"null"
]
},
"itemId": {
"type": "string"
},

View File

@@ -257,7 +257,7 @@
"type": "object"
},
"AuthMode": {
"description": "Authentication mode for OpenAI-backed providers.\n\nThis is used internally to determine the base URL for generating responses, and to gate ChatGPT-only behaviors like rate limits and available models (as opposed to API key-based auth).",
"description": "Authentication mode for OpenAI-backed providers.",
"oneOf": [
{
"description": "OpenAI API key provided by the caller and stored by Codex.",
@@ -272,6 +272,13 @@
"chatgpt"
],
"type": "string"
},
{
"description": "[UNSTABLE] FOR OPENAI INTERNAL USE ONLY - DO NOT USE.\n\nChatGPT auth tokens are supplied by an external host app and are only stored in memory. Token refresh must be handled by the external host app.",
"enum": [
"chatgptAuthTokens"
],
"type": "string"
}
]
},
@@ -1251,6 +1258,14 @@
{
"description": "Agent has started a turn. v1 wire format uses `task_started`; accept `turn_started` for v2 interop.",
"properties": {
"collaboration_mode_kind": {
"allOf": [
{
"$ref": "#/definitions/ModeKind"
}
],
"default": "code"
},
"model_context_window": {
"format": "int64",
"type": [
@@ -1612,12 +1627,14 @@
"description": "How to sandbox commands executed in the system"
},
"session_id": {
"allOf": [
{
"$ref": "#/definitions/ThreadId"
}
],
"description": "Name left as session_id instead of thread_id for backwards compatibility."
"$ref": "#/definitions/ThreadId"
},
"thread_name": {
"description": "Optional user-facing thread name (may be unset).",
"type": [
"string",
"null"
]
},
"type": {
"enum": [
@@ -1641,6 +1658,33 @@
"title": "SessionConfiguredEventMsg",
"type": "object"
},
{
"description": "Updated session metadata (e.g., thread name changes).",
"properties": {
"thread_id": {
"$ref": "#/definitions/ThreadId"
},
"thread_name": {
"type": [
"string",
"null"
]
},
"type": {
"enum": [
"thread_name_updated"
],
"title": "ThreadNameUpdatedEventMsgType",
"type": "string"
}
},
"required": [
"thread_id",
"type"
],
"title": "ThreadNameUpdatedEventMsg",
"type": "object"
},
{
"description": "Incremental MCP startup progress updates.",
"properties": {
@@ -1796,7 +1840,7 @@
{
"properties": {
"action": {
"$ref": "#/definitions/WebSearchAction"
"$ref": "#/definitions/WebSearchAction2"
},
"call_id": {
"type": "string"
@@ -2702,6 +2746,7 @@
"properties": {
"explanation": {
"default": null,
"description": "Arguments for the `update_plan` todo/checklist tool (not plan mode).",
"type": [
"string",
"null"
@@ -2927,6 +2972,38 @@
"title": "AgentMessageContentDeltaEventMsg",
"type": "object"
},
{
"properties": {
"delta": {
"type": "string"
},
"item_id": {
"type": "string"
},
"thread_id": {
"type": "string"
},
"turn_id": {
"type": "string"
},
"type": {
"enum": [
"plan_delta"
],
"title": "PlanDeltaEventMsgType",
"type": "string"
}
},
"required": [
"delta",
"item_id",
"thread_id",
"turn_id",
"type"
],
"title": "PlanDeltaEventMsg",
"type": "object"
},
{
"properties": {
"delta": {
@@ -3980,6 +4057,17 @@
],
"type": "string"
},
"ModeKind": {
"description": "Initial collaboration mode to use when the TUI starts.",
"enum": [
"plan",
"code",
"pair_programming",
"execute",
"custom"
],
"type": "string"
},
"NetworkAccess": {
"description": "Represents whether outbound network access is available to the agent.",
"enum": [
@@ -4166,6 +4254,30 @@
}
]
},
"PlanDeltaNotification": {
"description": "EXPERIMENTAL - proposed plan streaming deltas for plan items. Clients should not assume concatenated deltas match the completed plan item content.",
"properties": {
"delta": {
"type": "string"
},
"itemId": {
"type": "string"
},
"threadId": {
"type": "string"
},
"turnId": {
"type": "string"
}
},
"required": [
"delta",
"itemId",
"threadId",
"turnId"
],
"type": "object"
},
"PlanItemArg": {
"additionalProperties": false,
"properties": {
@@ -4986,7 +5098,7 @@
"action": {
"anyOf": [
{
"$ref": "#/definitions/WebSearchAction"
"$ref": "#/definitions/WebSearchAction2"
},
{
"type": "null"
@@ -5924,6 +6036,13 @@
"description": "Model provider used for this thread (for example, 'openai').",
"type": "string"
},
"path": {
"description": "[UNSTABLE] Path to the thread on disk.",
"type": [
"string",
"null"
]
},
"preview": {
"description": "Usually the first user message in the thread, if available.",
"type": "string"
@@ -6018,6 +6137,31 @@
"title": "AgentMessageThreadItem",
"type": "object"
},
{
"description": "EXPERIMENTAL - proposed plan item content. The completed plan item is authoritative and may not match the concatenation of `PlanDelta` text.",
"properties": {
"id": {
"type": "string"
},
"text": {
"type": "string"
},
"type": {
"enum": [
"plan"
],
"title": "PlanThreadItemType",
"type": "string"
}
},
"required": [
"id",
"text",
"type"
],
"title": "PlanThreadItem",
"type": "object"
},
{
"properties": {
"content": {
@@ -6286,6 +6430,16 @@
},
{
"properties": {
"action": {
"anyOf": [
{
"$ref": "#/definitions/WebSearchAction"
},
{
"type": "null"
}
]
},
"id": {
"type": "string"
},
@@ -6402,6 +6556,23 @@
}
]
},
"ThreadNameUpdatedNotification": {
"properties": {
"threadId": {
"type": "string"
},
"threadName": {
"type": [
"string",
"null"
]
}
},
"required": [
"threadId"
],
"type": "object"
},
"ThreadStartedNotification": {
"properties": {
"thread": {
@@ -6825,6 +6996,30 @@
"title": "AgentMessageTurnItem",
"type": "object"
},
{
"properties": {
"id": {
"type": "string"
},
"text": {
"type": "string"
},
"type": {
"enum": [
"Plan"
],
"title": "PlanTurnItemType",
"type": "string"
}
},
"required": [
"id",
"text",
"type"
],
"title": "PlanTurnItem",
"type": "object"
},
{
"properties": {
"id": {
@@ -6862,7 +7057,7 @@
{
"properties": {
"action": {
"$ref": "#/definitions/WebSearchAction"
"$ref": "#/definitions/WebSearchAction2"
},
"id": {
"type": "string"
@@ -7233,6 +7428,15 @@
"oneOf": [
{
"properties": {
"queries": {
"items": {
"type": "string"
},
"type": [
"array",
"null"
]
},
"query": {
"type": [
"string",
@@ -7257,7 +7461,7 @@
"properties": {
"type": {
"enum": [
"open_page"
"openPage"
],
"title": "OpenPageWebSearchActionType",
"type": "string"
@@ -7285,7 +7489,7 @@
},
"type": {
"enum": [
"find_in_page"
"findInPage"
],
"title": "FindInPageWebSearchActionType",
"type": "string"
@@ -7321,6 +7525,107 @@
}
]
},
"WebSearchAction2": {
"oneOf": [
{
"properties": {
"queries": {
"items": {
"type": "string"
},
"type": [
"array",
"null"
]
},
"query": {
"type": [
"string",
"null"
]
},
"type": {
"enum": [
"search"
],
"title": "SearchWebSearchAction2Type",
"type": "string"
}
},
"required": [
"type"
],
"title": "SearchWebSearchAction2",
"type": "object"
},
{
"properties": {
"type": {
"enum": [
"open_page"
],
"title": "OpenPageWebSearchAction2Type",
"type": "string"
},
"url": {
"type": [
"string",
"null"
]
}
},
"required": [
"type"
],
"title": "OpenPageWebSearchAction2",
"type": "object"
},
{
"properties": {
"pattern": {
"type": [
"string",
"null"
]
},
"type": {
"enum": [
"find_in_page"
],
"title": "FindInPageWebSearchAction2Type",
"type": "string"
},
"url": {
"type": [
"string",
"null"
]
}
},
"required": [
"type"
],
"title": "FindInPageWebSearchAction2",
"type": "object"
},
{
"properties": {
"type": {
"enum": [
"other"
],
"title": "OtherWebSearchAction2Type",
"type": "string"
}
},
"required": [
"type"
],
"title": "OtherWebSearchAction2",
"type": "object"
}
]
},
"WindowsWorldWritableWarningNotification": {
"properties": {
"extraCount": {
@@ -7389,6 +7694,26 @@
"title": "Thread/startedNotification",
"type": "object"
},
{
"properties": {
"method": {
"enum": [
"thread/name/updated"
],
"title": "Thread/name/updatedNotificationMethod",
"type": "string"
},
"params": {
"$ref": "#/definitions/ThreadNameUpdatedNotification"
}
},
"required": [
"method",
"params"
],
"title": "Thread/name/updatedNotification",
"type": "object"
},
{
"properties": {
"method": {
@@ -7570,6 +7895,27 @@
"title": "Item/agentMessage/deltaNotification",
"type": "object"
},
{
"description": "EXPERIMENTAL - proposed plan streaming deltas for plan items.",
"properties": {
"method": {
"enum": [
"item/plan/delta"
],
"title": "Item/plan/deltaNotificationMethod",
"type": "string"
},
"params": {
"$ref": "#/definitions/PlanDeltaNotification"
}
},
"required": [
"method",
"params"
],
"title": "Item/plan/deltaNotification",
"type": "object"
},
{
"properties": {
"method": {

View File

@@ -38,6 +38,35 @@
],
"type": "object"
},
"ChatgptAuthTokensRefreshParams": {
"properties": {
"previousAccountId": {
"description": "Workspace/account identifier that Codex was previously using.\n\nClients that manage multiple accounts/workspaces can use this as a hint to refresh the token for the correct workspace.\n\nThis may be `null` when the prior ID token did not include a workspace identifier (`chatgpt_account_id`) or when the token could not be parsed.",
"type": [
"string",
"null"
]
},
"reason": {
"$ref": "#/definitions/ChatgptAuthTokensRefreshReason"
}
},
"required": [
"reason"
],
"type": "object"
},
"ChatgptAuthTokensRefreshReason": {
"oneOf": [
{
"description": "Codex attempted a backend request and received `401 Unauthorized`.",
"enum": [
"unauthorized"
],
"type": "string"
}
]
},
"CommandAction": {
"oneOf": [
{
@@ -345,6 +374,13 @@
},
"FileChangeRequestApprovalParams": {
"properties": {
"grantRoot": {
"description": "[UNSTABLE] When set, the agent is asking the user to allow writes under this root for the remainder of the session (unclear if this is honored today).",
"type": [
"string",
"null"
]
},
"itemId": {
"type": "string"
},
@@ -493,6 +529,86 @@
},
"ThreadId": {
"type": "string"
},
"ToolRequestUserInputOption": {
"description": "EXPERIMENTAL. Defines a single selectable option for request_user_input.",
"properties": {
"description": {
"type": "string"
},
"label": {
"type": "string"
}
},
"required": [
"description",
"label"
],
"type": "object"
},
"ToolRequestUserInputParams": {
"description": "EXPERIMENTAL. Params sent with a request_user_input event.",
"properties": {
"itemId": {
"type": "string"
},
"questions": {
"items": {
"$ref": "#/definitions/ToolRequestUserInputQuestion"
},
"type": "array"
},
"threadId": {
"type": "string"
},
"turnId": {
"type": "string"
}
},
"required": [
"itemId",
"questions",
"threadId",
"turnId"
],
"type": "object"
},
"ToolRequestUserInputQuestion": {
"description": "EXPERIMENTAL. Represents one request_user_input question and its required options.",
"properties": {
"header": {
"type": "string"
},
"id": {
"type": "string"
},
"isOther": {
"default": false,
"type": "boolean"
},
"isSecret": {
"default": false,
"type": "boolean"
},
"options": {
"items": {
"$ref": "#/definitions/ToolRequestUserInputOption"
},
"type": [
"array",
"null"
]
},
"question": {
"type": "string"
}
},
"required": [
"header",
"id",
"question"
],
"type": "object"
}
},
"description": "Request initiated from the server and sent to the client.",
@@ -547,6 +663,31 @@
"title": "Item/fileChange/requestApprovalRequest",
"type": "object"
},
{
"description": "EXPERIMENTAL - Request input from the user for a tool call.",
"properties": {
"id": {
"$ref": "#/definitions/RequestId"
},
"method": {
"enum": [
"item/tool/requestUserInput"
],
"title": "Item/tool/requestUserInputRequestMethod",
"type": "string"
},
"params": {
"$ref": "#/definitions/ToolRequestUserInputParams"
}
},
"required": [
"id",
"method",
"params"
],
"title": "Item/tool/requestUserInputRequest",
"type": "object"
},
{
"description": "Execute a dynamic tool call on the client.",
"properties": {
@@ -572,6 +713,30 @@
"title": "Item/tool/callRequest",
"type": "object"
},
{
"properties": {
"id": {
"$ref": "#/definitions/RequestId"
},
"method": {
"enum": [
"account/chatgptAuthTokens/refresh"
],
"title": "Account/chatgptAuthTokens/refreshRequestMethod",
"type": "string"
},
"params": {
"$ref": "#/definitions/ChatgptAuthTokensRefreshParams"
}
},
"required": [
"id",
"method",
"params"
],
"title": "Account/chatgptAuthTokens/refreshRequest",
"type": "object"
},
{
"description": "DEPRECATED APIs below Request to approve a patch. This request is used for Turns started via the legacy APIs (i.e. SendUserTurn, SendUserMessage).",
"properties": {

View File

@@ -0,0 +1,84 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"ToolRequestUserInputOption": {
"description": "EXPERIMENTAL. Defines a single selectable option for request_user_input.",
"properties": {
"description": {
"type": "string"
},
"label": {
"type": "string"
}
},
"required": [
"description",
"label"
],
"type": "object"
},
"ToolRequestUserInputQuestion": {
"description": "EXPERIMENTAL. Represents one request_user_input question and its required options.",
"properties": {
"header": {
"type": "string"
},
"id": {
"type": "string"
},
"isOther": {
"default": false,
"type": "boolean"
},
"isSecret": {
"default": false,
"type": "boolean"
},
"options": {
"items": {
"$ref": "#/definitions/ToolRequestUserInputOption"
},
"type": [
"array",
"null"
]
},
"question": {
"type": "string"
}
},
"required": [
"header",
"id",
"question"
],
"type": "object"
}
},
"description": "EXPERIMENTAL. Params sent with a request_user_input event.",
"properties": {
"itemId": {
"type": "string"
},
"questions": {
"items": {
"$ref": "#/definitions/ToolRequestUserInputQuestion"
},
"type": "array"
},
"threadId": {
"type": "string"
},
"turnId": {
"type": "string"
}
},
"required": [
"itemId",
"questions",
"threadId",
"turnId"
],
"title": "ToolRequestUserInputParams",
"type": "object"
}

View File

@@ -0,0 +1,34 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"ToolRequestUserInputAnswer": {
"description": "EXPERIMENTAL. Captures a user's answer to a request_user_input question.",
"properties": {
"answers": {
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"answers"
],
"type": "object"
}
},
"description": "EXPERIMENTAL. Response payload mapping question ids to answers.",
"properties": {
"answers": {
"additionalProperties": {
"$ref": "#/definitions/ToolRequestUserInputAnswer"
},
"type": "object"
}
},
"required": [
"answers"
],
"title": "ToolRequestUserInputResponse",
"type": "object"
}

View File

@@ -8,6 +8,10 @@
"properties": {
"conversationId": {
"$ref": "#/definitions/ThreadId"
},
"experimentalRawEvents": {
"default": false,
"type": "boolean"
}
},
"required": [

View File

@@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"AuthMode": {
"description": "Authentication mode for OpenAI-backed providers.\n\nThis is used internally to determine the base URL for generating responses, and to gate ChatGPT-only behaviors like rate limits and available models (as opposed to API key-based auth).",
"description": "Authentication mode for OpenAI-backed providers.",
"oneOf": [
{
"description": "OpenAI API key provided by the caller and stored by Codex.",
@@ -17,6 +17,13 @@
"chatgpt"
],
"type": "string"
},
{
"description": "[UNSTABLE] FOR OPENAI INTERNAL USE ONLY - DO NOT USE.\n\nChatGPT auth tokens are supplied by an external host app and are only stored in memory. Token refresh must be handled by the external host app.",
"enum": [
"chatgptAuthTokens"
],
"type": "string"
}
]
}

View File

@@ -680,6 +680,14 @@
{
"description": "Agent has started a turn. v1 wire format uses `task_started`; accept `turn_started` for v2 interop.",
"properties": {
"collaboration_mode_kind": {
"allOf": [
{
"$ref": "#/definitions/ModeKind"
}
],
"default": "code"
},
"model_context_window": {
"format": "int64",
"type": [
@@ -1041,12 +1049,14 @@
"description": "How to sandbox commands executed in the system"
},
"session_id": {
"allOf": [
{
"$ref": "#/definitions/ThreadId"
}
],
"description": "Name left as session_id instead of thread_id for backwards compatibility."
"$ref": "#/definitions/ThreadId"
},
"thread_name": {
"description": "Optional user-facing thread name (may be unset).",
"type": [
"string",
"null"
]
},
"type": {
"enum": [
@@ -1070,6 +1080,33 @@
"title": "SessionConfiguredEventMsg",
"type": "object"
},
{
"description": "Updated session metadata (e.g., thread name changes).",
"properties": {
"thread_id": {
"$ref": "#/definitions/ThreadId"
},
"thread_name": {
"type": [
"string",
"null"
]
},
"type": {
"enum": [
"thread_name_updated"
],
"title": "ThreadNameUpdatedEventMsgType",
"type": "string"
}
},
"required": [
"thread_id",
"type"
],
"title": "ThreadNameUpdatedEventMsg",
"type": "object"
},
{
"description": "Incremental MCP startup progress updates.",
"properties": {
@@ -2131,6 +2168,7 @@
"properties": {
"explanation": {
"default": null,
"description": "Arguments for the `update_plan` todo/checklist tool (not plan mode).",
"type": [
"string",
"null"
@@ -2356,6 +2394,38 @@
"title": "AgentMessageContentDeltaEventMsg",
"type": "object"
},
{
"properties": {
"delta": {
"type": "string"
},
"item_id": {
"type": "string"
},
"thread_id": {
"type": "string"
},
"turn_id": {
"type": "string"
},
"type": {
"enum": [
"plan_delta"
],
"title": "PlanDeltaEventMsgType",
"type": "string"
}
},
"required": [
"delta",
"item_id",
"thread_id",
"turn_id",
"type"
],
"title": "PlanDeltaEventMsg",
"type": "object"
},
{
"properties": {
"delta": {
@@ -3206,6 +3276,17 @@
}
]
},
"ModeKind": {
"description": "Initial collaboration mode to use when the TUI starts.",
"enum": [
"plan",
"code",
"pair_programming",
"execute",
"custom"
],
"type": "string"
},
"NetworkAccess": {
"description": "Represents whether outbound network access is available to the agent.",
"enum": [
@@ -4912,6 +4993,30 @@
"title": "AgentMessageTurnItem",
"type": "object"
},
{
"properties": {
"id": {
"type": "string"
},
"text": {
"type": "string"
},
"type": {
"enum": [
"Plan"
],
"title": "PlanTurnItemType",
"type": "string"
}
},
"required": [
"id",
"text",
"type"
],
"title": "PlanTurnItem",
"type": "object"
},
{
"properties": {
"id": {
@@ -5125,6 +5230,15 @@
"oneOf": [
{
"properties": {
"queries": {
"items": {
"type": "string"
},
"type": [
"array",
"null"
]
},
"query": {
"type": [
"string",

View File

@@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"AuthMode": {
"description": "Authentication mode for OpenAI-backed providers.\n\nThis is used internally to determine the base URL for generating responses, and to gate ChatGPT-only behaviors like rate limits and available models (as opposed to API key-based auth).",
"description": "Authentication mode for OpenAI-backed providers.",
"oneOf": [
{
"description": "OpenAI API key provided by the caller and stored by Codex.",
@@ -17,6 +17,13 @@
"chatgpt"
],
"type": "string"
},
{
"description": "[UNSTABLE] FOR OPENAI INTERNAL USE ONLY - DO NOT USE.\n\nChatGPT auth tokens are supplied by an external host app and are only stored in memory. Token refresh must be handled by the external host app.",
"enum": [
"chatgptAuthTokens"
],
"type": "string"
}
]
}

View File

@@ -21,9 +21,30 @@
"version"
],
"type": "object"
},
"InitializeCapabilities": {
"description": "Client-declared capabilities negotiated during initialize.",
"properties": {
"experimentalApi": {
"default": false,
"description": "Opt into receiving experimental API methods and fields.",
"type": "boolean"
}
},
"type": "object"
}
},
"properties": {
"capabilities": {
"anyOf": [
{
"$ref": "#/definitions/InitializeCapabilities"
},
{
"type": "null"
}
]
},
"clientInfo": {
"$ref": "#/definitions/ClientInfo"
}

View File

@@ -775,6 +775,15 @@
"oneOf": [
{
"properties": {
"queries": {
"items": {
"type": "string"
},
"type": [
"array",
"null"
]
},
"query": {
"type": [
"string",

View File

@@ -680,6 +680,14 @@
{
"description": "Agent has started a turn. v1 wire format uses `task_started`; accept `turn_started` for v2 interop.",
"properties": {
"collaboration_mode_kind": {
"allOf": [
{
"$ref": "#/definitions/ModeKind"
}
],
"default": "code"
},
"model_context_window": {
"format": "int64",
"type": [
@@ -1041,12 +1049,14 @@
"description": "How to sandbox commands executed in the system"
},
"session_id": {
"allOf": [
{
"$ref": "#/definitions/ThreadId"
}
],
"description": "Name left as session_id instead of thread_id for backwards compatibility."
"$ref": "#/definitions/ThreadId"
},
"thread_name": {
"description": "Optional user-facing thread name (may be unset).",
"type": [
"string",
"null"
]
},
"type": {
"enum": [
@@ -1070,6 +1080,33 @@
"title": "SessionConfiguredEventMsg",
"type": "object"
},
{
"description": "Updated session metadata (e.g., thread name changes).",
"properties": {
"thread_id": {
"$ref": "#/definitions/ThreadId"
},
"thread_name": {
"type": [
"string",
"null"
]
},
"type": {
"enum": [
"thread_name_updated"
],
"title": "ThreadNameUpdatedEventMsgType",
"type": "string"
}
},
"required": [
"thread_id",
"type"
],
"title": "ThreadNameUpdatedEventMsg",
"type": "object"
},
{
"description": "Incremental MCP startup progress updates.",
"properties": {
@@ -2131,6 +2168,7 @@
"properties": {
"explanation": {
"default": null,
"description": "Arguments for the `update_plan` todo/checklist tool (not plan mode).",
"type": [
"string",
"null"
@@ -2356,6 +2394,38 @@
"title": "AgentMessageContentDeltaEventMsg",
"type": "object"
},
{
"properties": {
"delta": {
"type": "string"
},
"item_id": {
"type": "string"
},
"thread_id": {
"type": "string"
},
"turn_id": {
"type": "string"
},
"type": {
"enum": [
"plan_delta"
],
"title": "PlanDeltaEventMsgType",
"type": "string"
}
},
"required": [
"delta",
"item_id",
"thread_id",
"turn_id",
"type"
],
"title": "PlanDeltaEventMsg",
"type": "object"
},
{
"properties": {
"delta": {
@@ -3206,6 +3276,17 @@
}
]
},
"ModeKind": {
"description": "Initial collaboration mode to use when the TUI starts.",
"enum": [
"plan",
"code",
"pair_programming",
"execute",
"custom"
],
"type": "string"
},
"NetworkAccess": {
"description": "Represents whether outbound network access is available to the agent.",
"enum": [
@@ -4912,6 +4993,30 @@
"title": "AgentMessageTurnItem",
"type": "object"
},
{
"properties": {
"id": {
"type": "string"
},
"text": {
"type": "string"
},
"type": {
"enum": [
"Plan"
],
"title": "PlanTurnItemType",
"type": "string"
}
},
"required": [
"id",
"text",
"type"
],
"title": "PlanTurnItem",
"type": "object"
},
{
"properties": {
"id": {
@@ -5125,6 +5230,15 @@
"oneOf": [
{
"properties": {
"queries": {
"items": {
"type": "string"
},
"type": [
"array",
"null"
]
},
"query": {
"type": [
"string",

View File

@@ -680,6 +680,14 @@
{
"description": "Agent has started a turn. v1 wire format uses `task_started`; accept `turn_started` for v2 interop.",
"properties": {
"collaboration_mode_kind": {
"allOf": [
{
"$ref": "#/definitions/ModeKind"
}
],
"default": "code"
},
"model_context_window": {
"format": "int64",
"type": [
@@ -1041,12 +1049,14 @@
"description": "How to sandbox commands executed in the system"
},
"session_id": {
"allOf": [
{
"$ref": "#/definitions/ThreadId"
}
],
"description": "Name left as session_id instead of thread_id for backwards compatibility."
"$ref": "#/definitions/ThreadId"
},
"thread_name": {
"description": "Optional user-facing thread name (may be unset).",
"type": [
"string",
"null"
]
},
"type": {
"enum": [
@@ -1070,6 +1080,33 @@
"title": "SessionConfiguredEventMsg",
"type": "object"
},
{
"description": "Updated session metadata (e.g., thread name changes).",
"properties": {
"thread_id": {
"$ref": "#/definitions/ThreadId"
},
"thread_name": {
"type": [
"string",
"null"
]
},
"type": {
"enum": [
"thread_name_updated"
],
"title": "ThreadNameUpdatedEventMsgType",
"type": "string"
}
},
"required": [
"thread_id",
"type"
],
"title": "ThreadNameUpdatedEventMsg",
"type": "object"
},
{
"description": "Incremental MCP startup progress updates.",
"properties": {
@@ -2131,6 +2168,7 @@
"properties": {
"explanation": {
"default": null,
"description": "Arguments for the `update_plan` todo/checklist tool (not plan mode).",
"type": [
"string",
"null"
@@ -2356,6 +2394,38 @@
"title": "AgentMessageContentDeltaEventMsg",
"type": "object"
},
{
"properties": {
"delta": {
"type": "string"
},
"item_id": {
"type": "string"
},
"thread_id": {
"type": "string"
},
"turn_id": {
"type": "string"
},
"type": {
"enum": [
"plan_delta"
],
"title": "PlanDeltaEventMsgType",
"type": "string"
}
},
"required": [
"delta",
"item_id",
"thread_id",
"turn_id",
"type"
],
"title": "PlanDeltaEventMsg",
"type": "object"
},
{
"properties": {
"delta": {
@@ -3206,6 +3276,17 @@
}
]
},
"ModeKind": {
"description": "Initial collaboration mode to use when the TUI starts.",
"enum": [
"plan",
"code",
"pair_programming",
"execute",
"custom"
],
"type": "string"
},
"NetworkAccess": {
"description": "Represents whether outbound network access is available to the agent.",
"enum": [
@@ -4912,6 +4993,30 @@
"title": "AgentMessageTurnItem",
"type": "object"
},
{
"properties": {
"id": {
"type": "string"
},
"text": {
"type": "string"
},
"type": {
"enum": [
"Plan"
],
"title": "PlanTurnItemType",
"type": "string"
}
},
"required": [
"id",
"text",
"type"
],
"title": "PlanTurnItem",
"type": "object"
},
{
"properties": {
"id": {
@@ -5125,6 +5230,15 @@
"oneOf": [
{
"properties": {
"queries": {
"items": {
"type": "string"
},
"type": [
"array",
"null"
]
},
"query": {
"type": [
"string",

View File

@@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"AuthMode": {
"description": "Authentication mode for OpenAI-backed providers.\n\nThis is used internally to determine the base URL for generating responses, and to gate ChatGPT-only behaviors like rate limits and available models (as opposed to API key-based auth).",
"description": "Authentication mode for OpenAI-backed providers.",
"oneOf": [
{
"description": "OpenAI API key provided by the caller and stored by Codex.",
@@ -17,6 +17,13 @@
"chatgpt"
],
"type": "string"
},
{
"description": "[UNSTABLE] FOR OPENAI INTERNAL USE ONLY - DO NOT USE.\n\nChatGPT auth tokens are supplied by an external host app and are only stored in memory. Token refresh must be handled by the external host app.",
"enum": [
"chatgptAuthTokens"
],
"type": "string"
}
]
}

Some files were not shown because too many files have changed in this diff Show More