Commit Graph
7004 Commits
Author SHA1 Message Date
Michael Bolin 6dfc49c2b3 Merge 7a90ed65ad into sapling-pr-archive-bolinfest 2026-02-02 12:51:16 -08:00
Michael Bolin 7a90ed65ad chore: remove deprecated mcp-types crate 2026-02-02 12:50:48 -08:00
Michael Bolin e9ebfa2426 feat: migrate MCP implementation from mcp-types to rmcp 2026-02-02 12:50:48 -08:00
viyatb-oaiandEric Traut 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
Michael Bolin 0a2f5602fe merge commit for archive created by Sapling 2026-02-02 11:16:19 -08:00
Michael Bolin f882e38b73 chore: remove deprecated mcp-types crate 2026-02-02 11:15:28 -08:00
Michael Bolin b1bfee948a feat: migrate MCP implementation from mcp-types to rmcp 2026-02-02 11:15:28 -08:00
Michael Bolin 9c595aea58 merge commit for archive created by Sapling 2026-02-02 11:10:47 -08:00
Michael Bolin 9330afbf51 chore: remove deprecated mcp-types crate 2026-02-02 11:10:41 -08:00
Michael Bolin 99abcc3945 feat: migrate MCP implementation from mcp-types to rmcp 2026-02-02 11:10:40 -08:00
Michael Bolin 7f6baaa1fd merge commit for archive created by Sapling 2026-02-02 11:03:31 -08:00
Michael Bolin 82792e49af feat: migrate MCP implementation from mcp-types to rmcp 2026-02-02 11:03:02 -08: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
Michael Bolin 7d80b9a910 merge commit for archive created by Sapling 2026-02-02 10:00:58 -08:00
Michael Bolin 0e0969df95 chore: remove deprecated mcp-types crate 2026-02-02 10:00:35 -08:00
Michael Bolin 0ae34768da feat: migrate MCP implementation from mcp-types to rmcp 2026-02-02 10:00:35 -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 a03b20bd55 merge commit for archive created by Sapling 2026-02-02 08:41:42 -08:00
Michael Bolin fc7ebe2c9b chore: remove deprecated mcp-types crate 2026-02-02 08:41:32 -08:00
Michael Bolin 9177b966e4 feat: migrate MCP implementation from mcp-types to rmcp 2026-02-02 08:41:32 -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:


https://github.com/openai/codex/blob/03fcd12e77fedf4fa327af27e2e476e1ebc5f651/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 9b2ce7e5f9 merge commit for archive created by Sapling 2026-02-01 23:46:03 -08:00
Michael Bolin 4f8662d796 chore: remove deprecated mcp-types crate 2026-02-01 23:45:54 -08:00
Michael Bolin 3276401a96 feat: migrate MCP implementation from mcp-types to rmcp
***
feat: add MCP protocol types and rmcp adapters
2026-02-01 23:45:38 -08:00
Michael Bolin 1851fd27ae feat: add MCP protocol types (ts/JsonSchema friendly) 2026-02-01 23:38:51 -08: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
Michael Bolin 1c6d4feaa8 merge commit for archive created by Sapling 2026-02-01 23:24:09 -08:00
Michael Bolin d75cd60fcb Remove stray .snap.new filtering from schema fixtures reader
Motivation:
- `codex-app-server-protocol` schema fixtures are not insta snapshots.
- Filtering `*.snap.new` is confusing and risks hiding real files.

What changed:
- Remove the `.snap.new` filename special case in `read_schema_fixture_tree`.

Refs: macOS Bazel schema fixture mismatch investigation
2026-02-01 23:24:03 -08:00
Michael Bolin 9097d74cd8 merge commit for archive created by Sapling 2026-02-01 23:05:17 -08:00
Michael Bolin 5be57b490e Remove stray .snap.new filtering from schema fixtures reader
Motivation:
- `codex-app-server-protocol` schema fixtures are not insta snapshots.
- Filtering `*.snap.new` is confusing and risks hiding real files.

What changed:
- Remove the `.snap.new` filename special case in `read_schema_fixture_tree`.

Refs: macOS Bazel schema fixture mismatch investigation
2026-02-01 23:05:10 -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
Michael Bolin 07d3fc6077 merge commit for archive created by Sapling 2026-02-01 22:50:35 -08:00
Michael Bolin dfdf5e9def Remove stray .snap.new filtering from schema fixtures reader
Motivation:
- `codex-app-server-protocol` schema fixtures are not insta snapshots.
- Filtering `*.snap.new` is confusing and risks hiding real files.

What changed:
- Remove the `.snap.new` filename special case in `read_schema_fixture_tree`.

Refs: macOS Bazel schema fixture mismatch investigation
2026-02-01 22:48:50 -08:00
Michael Bolin e7d0954b24 Merge c2828d9774 into sapling-pr-archive-bolinfest 2026-02-01 22:41:39 -08:00
Michael Bolin c2828d9774 Avoid JSON-schema canonicalization (preserve field order)
Motivation:
- App-server JSON schema output is already stable; sorting object keys is unnecessary.
- Alphabetical key canonicalization is potentially harmful because it obscures intentional ordering (e.g. struct field order) and makes diffs noisier.

What changed:
- Remove JSON key-sorting from schema emission.
- Regenerate vendored JSON schema fixtures.

Refs: openai/codex#8956 (fixture sync test pattern)
2026-02-01 22:40:15 -08:00
Michael Bolin af40fe7abc merge commit for archive created by Sapling 2026-02-01 22:35:22 -08:00
Michael Bolin 989b5a647d Fix clippy in app-server schema fixture test
Motivation:
- `cargo clippy --tests` is run in CI with `-D clippy::expect-used`; the new schema fixture test used `expect()`.

What changed:
- Convert test helpers to return `anyhow::Result` and add context instead of using `expect()`.

Refs: 3b069fda39 (schema fixture vendoring commit)
2026-02-01 22:28:28 -08:00
Michael Bolin dfe883c9ef merge commit for archive created by Sapling 2026-02-01 22:23:03 -08:00
Michael Bolin 3b069fda39 Vendor app-server protocol schema fixtures
Motivation:
- Keep `codex app-server` protocol artifacts (TypeScript + JSON Schema) checked in for consumers (e.g. IDE integrations) and make changes reviewable.
- Prevent drift between generated output (`codex app-server generate-ts` / `codex app-server generate-json-schema`) and what is vendored in the repo.

What changed:
- Vendor generated artifacts under `codex-rs/app-server-protocol/schema/typescript/` and `codex-rs/app-server-protocol/schema/json/`.
- Add `just write-app-server-schema` to fully regenerate fixtures (including deleting stale files).
- Add a fixture sync test for `codex-app-server-protocol` to assert the vendored trees match freshly generated output.
- Canonicalize JSON schema output (sorted object keys) for deterministic diffs.
- Wire Bazel test data so remote tests can read the vendored fixtures.

Refs: openai/codex#8956 (config.schema.json vendoring + sync test pattern)
2026-02-01 22:22:25 -08:00