Commit Graph

3336 Commits

Author SHA1 Message Date
Charles Cunningham
8c3c405ea7 Update app-server schema fixtures after protocol changes 2026-02-02 22:29:41 -08:00
Charles Cunningham
19498742cd Skip first-turn collaboration update after initial seeding 2026-02-02 22:29:41 -08:00
Charles Cunningham
3dd4a613cb Sync base mode when collaboration UI disabled 2026-02-02 22:29:41 -08:00
Charles Cunningham
18bda76b99 Keep custom base when applying rollback mode 2026-02-02 22:29:41 -08:00
Charles Cunningham
e45544fa93 Defer override context updates to next user turn 2026-02-02 22:29:41 -08:00
Charles Cunningham
7239785077 Left-pad turn context history after rollback 2026-02-02 22:29:41 -08:00
Charles Cunningham
d5652614f6 Fix redundant clone in collaboration mode tests 2026-02-02 22:29:41 -08:00
Charles Cunningham
bea06a5895 Restore mode sync context after rebase 2026-02-02 22:29:41 -08:00
Charles Cunningham
96f94b02be Count only real user turns for turn-context sync 2026-02-02 22:29:41 -08:00
Charles Cunningham
cf50fbf2b4 Fix TS optional-nullable export and backtrack clippy lint 2026-02-02 22:29:41 -08:00
Charles Cunningham
0174a3db48 Simplify backtrack mode sync and generalize pending sync naming 2026-02-02 22:29:40 -08:00
Charles Cunningham
4b7b5cd7cc Sync rollback model-visible mode state across core and tui 2026-02-02 22:29:40 -08:00
Charles Cunningham
c6dca12acf Handle compaction in turn context rebuild 2026-02-02 22:29:40 -08:00
Charles Cunningham
a569296f3d Preserve collaboration inject flag on overrides 2026-02-02 22:29:40 -08:00
Charles Cunningham
b0e5300c7e Fix SessionState import 2026-02-02 22:29:40 -08:00
Charles Cunningham
a580669627 Clarify rollback mode flow 2026-02-02 22:29:40 -08:00
Charles Cunningham
6e1d0fd263 doc 2026-02-02 22:29:40 -08:00
Charles Cunningham
a70e23ac5a Document rollback turn context helper 2026-02-02 22:29:40 -08:00
Charles Cunningham
ec06fccbb7 Extract rollback turn context helper 2026-02-02 22:29:40 -08:00
Charles Cunningham
4c46f80eb4 Restore mcp cancel formatting 2026-02-02 22:29:40 -08:00
Charles Cunningham
954b0884d5 Remove request_user_input call_id plumbing 2026-02-02 22:29:40 -08:00
Charles Cunningham
7af9dce46b Revert request_user_input serialization change 2026-02-02 22:29:40 -08:00
Charles Cunningham
466b4b704f Document turn context history reset 2026-02-02 22:29:40 -08:00
Charles Cunningham
b9fc83dd06 Document turn context placeholders 2026-02-02 22:29:40 -08:00
Charles Cunningham
5b4550d7d7 Rename force collaboration flag 2026-02-02 22:29:40 -08:00
Charles Cunningham
98179dd3ff Avoid stale collaboration mode on rollback 2026-02-02 22:29:39 -08:00
Charles Cunningham
37ef9a1904 Fix rollback lock and propagate user input call_id 2026-02-02 22:29:39 -08:00
Charles Cunningham
a057ee0d21 Remove collaboration mode fallback parsing 2026-02-02 22:29:39 -08:00
Charles Cunningham
e91826feb6 Test rollback uses turn context history 2026-02-02 22:29:39 -08:00
Charles Cunningham
7200e1e47a Use TurnContextItem for rollback modes 2026-02-02 22:29:39 -08:00
Charles Cunningham
883e57d10e Revert "Persist collaboration mode masks in history"
This reverts commit bc9757c41ec3701e196d6b6da1a2e894ec3e19ad.
2026-02-02 22:29:39 -08:00
Charles Cunningham
3341646eb8 Persist collaboration mode masks in history 2026-02-02 22:29:39 -08:00
Charles Cunningham
ef8575c24a Drop redundant clones in backtrack tests 2026-02-02 22:29:39 -08:00
Charles Cunningham
a1a0a2be6f Restore collaboration mode on backtrack failure 2026-02-02 22:29:39 -08:00
Charles Cunningham
0efb5292f3 Add backtrack collaboration mode tests 2026-02-02 22:29:39 -08:00
Charles Cunningham
e39c9e3b64 Sync collaboration mode on rollback 2026-02-02 22:29:39 -08:00
Charles Cunningham
f30151cc18 Fix backtrack to restore collaboration mode and keep developer instructions in sync 2026-02-02 22:29:39 -08:00
sayan-oai
59707da857 fix: clarify deprecation message for features.web_search (#10406)
clarify that the new `web_search` is not a feature flag under
`[features]` in the deprecation CTA
2026-02-02 21:17:01 -08:00
pakrym-oai
bf87468c2b Restore status after preamble (#10465) 2026-02-02 20:35:50 -08:00
Eric Traut
8b280367b1 Updated bug and feature templates (#10453)
The current bug template uses CLI-specific instructions for getting the
version.

The current feature template doesn't ask the user to provide the Codex
variant (surface) they are using.

This PR addresses these problems.
2026-02-02 20:08:08 -08:00
pakrym-oai
cbfd2a37cc Trim compaction input (#10374)
Two fixes:

1. Include trailing tool output in the total context size calculation.
Otherwise when checking whether compaction should run we ignore newly
added outputs.
2. Trim trailing tool output/tool calls until we can fit the request
into the model context size. Otherwise the compaction endpoint will fail
to compact. We only trim items that can be reproduced again by the model
(tool calls, tool call outputs).
2026-02-02 19:03:11 -08:00
Colin Young
7e07ec8f73 [Codex][CLI] Gate image inputs by model modalities (#10271)
###### Summary

- Add input_modalities to model metadata so clients can determine
supported input types.
- Gate image paste/attach in TUI when the selected model does not
support images.
- Block submits that include images for unsupported models and show a
clear warning.
- Propagate modality metadata through app-server protocol/model-list
responses.
  - Update related tests/fixtures.

  ###### Rationale

  - Models support different input modalities.
- Clients need an explicit capability signal to prevent unsupported
requests.
- Backward-compatible defaults preserve existing behavior when modality
metadata is absent.

  ###### Scope

  - codex-rs/protocol, codex-rs/core, codex-rs/tui
  - codex-rs/app-server-protocol, codex-rs/app-server
  - Generated app-server types / schema fixtures

  ###### Trade-offs

- Default behavior assumes text + image when field is absent for
compatibility.
  - Server-side validation remains the source of truth.

  ###### Follow-up

- Non-TUI clients should consume input_modalities to disable unsupported
attachments.
- Model catalogs should explicitly set input_modalities for text-only
models.

  ###### Testing

  - cargo fmt --all
  - cargo test -p codex-tui
  - env -u GITHUB_APP_KEY cargo test -p codex-core --lib
  - just write-app-server-schema
- cargo run -p codex-cli --bin codex -- app-server generate-ts --out
app-server-types
  - test against local backend
  
<img width="695" height="199" alt="image"
src="https://github.com/user-attachments/assets/d22dd04f-5eba-4db9-a7c5-a2506f60ec44"
/>

---------

Co-authored-by: Josh McKinney <joshka@openai.com>
2026-02-02 18:56:39 -08:00
Ahmed Ibrahim
b8addcddb9 Require models refresh on cli version mismatch (#10414) 2026-02-02 18:55:25 -08:00
sayan-oai
fc05374344 chore: add phase to message responseitem (#10455)
### What

add wiring for `phase` field on `ResponseItem::Message` to lay
groundwork for differentiating model preambles and final messages.
currently optional.

follows pattern in #9698.

updated schemas with `just write-app-server-schema` so we can see type
changes.

### Tests
Updated existing tests for SSE parsing and hydrating from history
2026-02-03 02:52:26 +00:00
Ahmed Ibrahim
0999fd82b9 app tool tip (#10454)
# 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-03 02:37:01 +00:00
Michael Bolin
891ed87409 chore: remove deprecated mcp-types crate (#10357)
https://github.com/openai/codex/pull/10349 migrated us off of
`mcp-types`, so this PR deletes the code.

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/10357).
* __->__ #10357
* #10349
* #10356
2026-02-03 02:33:16 +00:00
Ahmed Ibrahim
97ff090104 Hide short worked-for label in final separator (#10452)
- Hide the "Worked for" label in the final message separator unless
elapsed time is over one minute.\n- Update/add tests to cover both
hidden (<60s) and shown (>=61s) behavior.
2026-02-03 02:29:20 +00:00
Eric Traut
8dd41e229b Fixed sandbox mode inconsistency if untrusted is selected (#10415)
This PR addresses #10395

When a user is asked to pick the trust level of a project, the code
currently reloads the config if they select "trusted". It doesn't reload
the config in the "untrusted" case but should. This causes the sandbox
mode to be reported incorrectly in `/status` during the first run (it's
displayed as `read-only` even though it acts as though it's
`workspace-write`).
2026-02-03 02:00:35 +00:00
Michael Bolin
66447d5d2c feat: replace custom mcp-types crate with equivalents from rmcp (#10349)
We started working with MCP in Codex before
https://crates.io/crates/rmcp was mature, so we had our own crate for
MCP types that was generated from the MCP schema:


8b95d3e082/codex-rs/mcp-types/README.md

Now that `rmcp` is more mature, it makes more sense to use their MCP
types in Rust, as they handle details (like the `_meta` field) that our
custom version ignored. Though one advantage that our custom types had
is that our generated types implemented `JsonSchema` and `ts_rs::TS`,
whereas the types in `rmcp` do not. As such, part of the work of this PR
is leveraging the adapters between `rmcp` types and the serializable
types that are API for us (app server and MCP) introduced in #10356.

Note this PR results in a number of changes to
`codex-rs/app-server-protocol/schema`, which merit special attention
during review. We must ensure that these changes are still
backwards-compatible, which is possible because we have:

```diff
- export type CallToolResult = { content: Array<ContentBlock>, isError?: boolean, structuredContent?: JsonValue, };
+ export type CallToolResult = { content: Array<JsonValue>, structuredContent?: JsonValue, isError?: boolean, _meta?: JsonValue, };
```

so `ContentBlock` has been replaced with the more general `JsonValue`.
Note that `ContentBlock` was defined as:

```typescript
export type ContentBlock = TextContent | ImageContent | AudioContent | ResourceLink | EmbeddedResource;
```

so the deletion of those individual variants should not be a cause of
great concern.

Similarly, we have the following change in
`codex-rs/app-server-protocol/schema/typescript/Tool.ts`:

```
- export type Tool = { annotations?: ToolAnnotations, description?: string, inputSchema: ToolInputSchema, name: string, outputSchema?: ToolOutputSchema, title?: string, };
+ export type Tool = { name: string, title?: string, description?: string, inputSchema: JsonValue, outputSchema?: JsonValue, annotations?: JsonValue, icons?: Array<JsonValue>, _meta?: JsonValue, };
```

so:

- `annotations?: ToolAnnotations` ➡️ `JsonValue`
- `inputSchema: ToolInputSchema` ➡️ `JsonValue`
- `outputSchema?: ToolOutputSchema` ➡️ `JsonValue`

and two new fields: `icons?: Array<JsonValue>, _meta?: JsonValue`

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/10349).
* #10357
* __->__ #10349
* #10356
2026-02-02 17:41:55 -08:00
Charley Cunningham
8f5edddf71 TUI: Render request_user_input results in history and simplify interrupt handling (#10064)
## Summary
This PR improves the TUI experience for `request_user_input` by
rendering submitted question/answer sets directly in conversation
history with clear, structured formatting.

It also intentionally simplifies interrupt behavior for now: on `Esc` /
`Ctrl+C`, the questions overlay interrupts the turn without attempting
to submit partial answers.

<img width="1344" height="573" alt="Screenshot 2026-02-02 at 4 51 40 PM"
src="https://github.com/user-attachments/assets/ff752131-7060-44c1-9ded-af061969a533"
/>

## Scope
- TUI-only changes.
- No core/protocol/app-server behavior changes in this PR.
- Resume reconstruction of interrupted question sets is out of scope for
this PR.

## What Changed
- Added a new history cell: `RequestUserInputResultCell` in
`codex-rs/tui/src/history_cell.rs`.
- On normal `request_user_input` submission, TUI now inserts that
history cell immediately after sending `Op::UserInputAnswer`.
- Rendering includes a `Questions` header with `answered/total` count.
- Rendering shows each question as a bullet item.
- Rendering styles submitted answer lines in cyan.
- Rendering styles notes (for option questions) as `note:` lines in
cyan.
- Rendering styles freeform text (for no-option questions) as `answer:`
lines in cyan.
- Rendering dims only the `(unanswered)` suffix.
- Rendering can include an interrupted suffix and summary text when the
cell is marked interrupted.
- Rendering redacts secret questions as `••••••` instead of showing raw
values.
- Added `wrap_with_prefix(...)` in `history_cell.rs` for wrapped
prefixed lines.
- Added `split_request_user_input_answer(...)` in `history_cell.rs` for
decoding `"user_note: ..."` entries.

## Interrupt Behavior (Intentional for this PR)
- `Esc` / `Ctrl+C` in the questions overlay now performs `Op::Interrupt`
and exits the overlay.
- It does **not** submit partial/committed answers on interrupt.
- Added TODO comments in `request_user_input` overlay interrupt paths
indicating where interrupted partial result emission should be
reintroduced once core support is finalized.
- Queued `request_user_input` overlays are discarded on interrupt in the
current behavior.

## Tests Updated
- Updated/added overlay tests in
`codex-rs/tui/src/bottom_pane/request_user_input/mod.rs` to reflect
interrupt-only behavior.
- Added helper assertion for interrupt-only event expectation.
- Existing submission-path tests now validate history insertion behavior
and expected answer maps.

## Behavior Notes
- Completed question flows now produce a readable `Questions` block in
transcript history.
- Interrupted flows currently do not persist partial answers to
model-visible tool output.

## Follow-ups
- Reintroduce partial-answer-on-interrupt semantics once core can
persist/sequence interrupted `request_user_input` outputs safely.
- Optionally add replay/resume rendering for interrupted question sets
as a separate PR.

## Codex author
`codex fork 019bfb8d-2a65-7313-9be2-ea7100d19a61`
2026-02-02 17:41:30 -08:00