Commit Graph
14562 Commits
Author SHA1 Message Date
Michael Bolin 14eae7019f merge commit for archive created by Sapling 2026-04-30 12:13:18 -07:00
Michael Bolin 79ace487a3 ci: add Windows cargo-xwin release PoC 2026-04-30 12:13:10 -07:00
Michael Bolin c6622c7e0e merge commit for archive created by Sapling 2026-04-30 12:04:23 -07:00
Michael Bolin b40263be77 ci: add Windows cargo-xwin release PoC 2026-04-30 12:03:55 -07:00
khoi 719431da6e [Codex] Add browser use external feature flag (#20245)
## Summary

- Adds a separate feature control for external-browser Browser Use
integrations.
- Registers `browser_use_external` as a stable, default-enabled
requirements-owned feature key.
- Updates feature registry tests and regenerates the config schema.

Codex validation:
- `cargo fmt -- --config imports_granularity=Item`
- `cargo run -p codex-core --bin codex-write-config-schema`
- `cargo test -p codex-features`

## Addendum

This gives enterprise policy a coarse control for Browser Use outside
the Codex-managed in-app browser. The existing `browser_use` feature is
the Browser Use control, while `browser_use_external` can gate
extension/native integrations for external browsers as that surface
grows
2026-04-30 11:53:19 -07:00
pakrym-oai b52083146c Stop emitting item/fileChange/outputDelta output delta notifications (#20471)
## Why

`item/fileChange/outputDelta` text output was only the tool's summary or
error text and not used by client surfaces.

We keep `item/fileChange/outputDelta` in the app-server protocol as a
deprecated compatibility entry, but the server no longer emits it.

## What changed

- stop the `apply_patch` runtime from emitting `ExecCommandOutputDelta`
events
- simplify `item_event_to_server_notification` so command output deltas
always map to `item/commandExecution/outputDelta`
- remove the app-server bookkeeping that tried to detect whether an
output delta belonged to a file change
- mark `item/fileChange/outputDelta` as a deprecated legacy protocol
entry in the v2 types, schema, and README
- simplify the file-change approval tests so they only wait for
completion instead of expecting output-delta notifications

## Testing

- `cargo test -p codex-app-server-protocol`
- `cargo test -p codex-thread-manager-sample`
- `cargo test -p codex-app-server-protocol
protocol::event_mapping::tests::exec_command_output_delta_maps_to_command_execution_output_delta
-- --exact`
- `cargo test -p codex-app-server
turn_start_file_change_approval_accept_for_session_persists_v2 --
--exact` *(failed before the test assertions because the wiremock
`/responses` mock received 0 requests in setup)*
2026-04-30 11:42:07 -07:00
Eric Traut f2bc2f26a9 Remove core protocol dependency [2/2] (#20325)
## Why

With the local model layer and app-server routing in place from PR1,
this PR moves the active TUI runtime onto app-server notifications. The
affected pieces share the same event flow, so the command surface,
session state, bottom-pane prompts, chat rendering, history/status
views, and tests move together to keep the stacked branch buildable.

This PR also removes the obsolete compatibility surface that is no
longer used after the migration. The proposed protocol-boundary verifier
layer was dropped from the stack; enforcing that final boundary will be
simpler once `codex-tui` no longer needs any `codex_protocol`
references.

This PR is part 2 of a 2-PR stack:

1. Add TUI-owned replacement models and extract app-server event
routing.
2. Move the active TUI flow to app-server notifications and delete
obsolete adapter code.

## What changed

- Rewired app command and session handling to use app-server request and
notification shapes.
- Moved approval overlays, request-user-input flows, MCP elicitation,
realtime events, and review commands onto the app-server-facing model
surface.
- Updated chat rendering, history cells, status views, multi-agent UI,
replay state, and TUI tests to use app-server notifications plus the
local models introduced in PR1.
- Deleted `codex-rs/tui/src/app/app_server_adapter.rs` and the
superseded `chatwidget/tests/background_events.rs` fixture path.

## Verification

- `cargo check -p codex-tui --tests`
- Top of stack: `cargo test -p codex-tui`
2026-04-30 11:34:34 -07:00
pakrym-oai 5cc5f12efc Move item event mapping into app-server-protocol (#20299)
## Why

Follow-up to #20291.

The v2 item-event-to-notification translation had been embedded in
`app-server/src/bespoke_event_handling.rs`, which made it hard to reuse
anywhere else. This PR moves that stateless mapping into shared protocol
code so other entry points can produce the same `ServerNotification`
payloads without copying app-server logic.

That also lets `thread-manager-sample` demonstrate the same notification
surface that the app server exposes, instead of only printing the final
assistant message.

## What changed

- move `item_event_to_server_notification` into
`codex-app-server-protocol::protocol::event_mapping`
- keep the mapper tests next to the shared implementation in
`codex-app-server-protocol`
- re-export the mapper from `codex-core-api` so lightweight consumers
can use it without reaching into `app-server-protocol` directly
- simplify `app-server/src/bespoke_event_handling.rs` so it delegates
the stateless event-to-notification projection to the shared helper
- update `thread-manager-sample` to:
  - print mapped notifications as newline-delimited JSON
  - use the shared mapper through `codex-core-api`
- enable the default feature set so the sample exposes the normal tool
surface
- use a `read_only` permission profile so shell commands can run in the
sample without widening permissions

## Testing

- `cargo test -p codex-app-server-protocol`
- `cargo test -p codex-core-api`
- `cargo test -p codex-app-server bespoke_event_handling::tests`
- `cargo test -p codex-thread-manager-sample`
- `cargo run -p codex-thread-manager-sample -- "briefly explore the repo
with pwd and ls, then summarize it"`
2026-04-30 11:02:13 -07:00
Eric Traut c70cdc108f Remove core protocol dependency [1/2] (#20324)
## Why

This stack moves `codex-tui` away from the core protocol event surface
and toward app-server API shapes plus TUI-owned local models. This first
PR sets up the lower-risk foundation: it introduces the local model
surface and extracts app-server event routing into focused TUI modules
while preserving the existing behavior for the larger migration in PR2.

This PR is part 1 of a 2-PR stack:

1. Add TUI-owned replacement models and extract app-server event
routing.
2. Move the active TUI flow to app-server notifications and delete
obsolete adapter code.

## What changed

- Added TUI-owned approval, diff, session state, session resume, token
usage, and user-message models.
- Added `app/app_server_event_targets.rs` and `app/app_server_events.rs`
to hold app-server event targeting and dispatch logic outside `app.rs`.
- Updated app/status tests to use the local model layer and added
focused routing coverage.
- Boxed a few large async TUI test futures so this base layer remains
checkable without overflowing the default test stack.

## Verification

- `cargo check -p codex-tui --tests`
2026-04-30 10:52:19 -07:00
teddywyly-oai 487716ae74 [Extension] Allowlist Chrome Extension in the tool_suggest tool (#20458)
### Summary
Allowlist chrome extension in tool_suggest tool

### Screenshot
Allowlist chrome extension in tool_suggest tool
<img width="808" height="309" alt="chrome_internal"
src="https://github.com/user-attachments/assets/ed769d77-b635-4a40-a0c5-fbff05af3036"
/>
2026-04-30 10:29:03 -07:00
canvrno-oai a85d265097 /plugins: remove marketplace (#19843)
This PR adds marketplace removal to the /plugins menu, giving users a
way to remove user-configured plugin marketplaces. It adds a `Ctrl+R`
shortcut to remove selected marketplace tabs, a confirmation prompt,
loading and error states, and the app-server request flow needed to
perform marketplace/remove. After a successful removal, the TUI
refreshes config, plugin mentions, user config, and plugin data so the
removed marketplace disappears from the menu and other surfaces in the
TUI.

- Add `Ctrl+R` removal option for user-configured marketplace tabs
- Show marketplace removal confirmation, loading, and error states
- Route `marketplace/remove` through the TUI background request flow
- Refresh config, plugin mentions, and plugin data after successful
removal
- Adds reusable per-tab footer hints so removal guidance only appears on
applicable tabs
- Add test coverage for `Ctrl+R` behavior while plugin search is active

Steps to test:
- Add a marketplace using the TUI /plugins menu
- Use Ctrl+R to remove the marketplace
- Accept the confirmation prompt
- Confirm the marketplace is removed when the process completes.
2026-04-30 10:25:07 -07:00
Michael Bolin 3f96efba7e Merge f6c34628bd into sapling-pr-archive-bolinfest 2026-04-30 10:08:14 -07:00
Michael Bolin f6c34628bd windows-sandbox: isolate allow path computation from legacy policy 2026-04-30 10:08:00 -07:00
Eric Traut c02814c106 Mark goals feature as experimental (#20083)
## Why

The `goals` feature flag is ready to move out of the hidden
under-development bucket and into the user-facing experimental surface.
Marking it experimental lets users discover it through the experimental
features UI while still making clear that it is opt-in.

## What changed

- Changed `goals` from `Stage::UnderDevelopment` to
`Stage::Experimental` in `codex-rs/features/src/lib.rs`.
- Added experimental menu metadata for the feature with the description
`Set a persistent goal Codex can continue over time`.

## Verification

- `cargo test -p codex-features`
2026-04-30 10:06:44 -07:00
Michael Bolin 99ec27846d Merge 2025b5f054 into sapling-pr-archive-bolinfest 2026-04-30 10:02:56 -07:00
Michael Bolin 2025b5f054 docs: avoid stale SandboxPolicy references 2026-04-30 10:02:44 -07:00
Michael Bolin c63b4cf046 Merge c5008f5d11 into sapling-pr-archive-bolinfest 2026-04-30 10:00:15 -07:00
Michael Bolin c5008f5d11 config tests: assert sandbox-mode fallbacks via profiles 2026-04-30 10:00:03 -07:00
Michael Bolin f95b2a537c Merge 110d05accf into sapling-pr-archive-bolinfest 2026-04-30 09:57:14 -07:00
Michael Bolin 110d05accf config tests: assert permission profile runtime state 2026-04-30 09:57:03 -07:00
Michael Bolin b221487c58 Merge b43b0ebcf0 into sapling-pr-archive-bolinfest 2026-04-30 09:53:21 -07:00
Michael Bolin b43b0ebcf0 config tests: derive permission profiles directly 2026-04-30 09:53:01 -07:00
Michael Bolin b7d4dd2cf1 merge commit for archive created by Sapling 2026-04-30 09:47:02 -07:00
Michael Bolin c142392c7f tui tests: assert permission profiles directly 2026-04-30 09:46:38 -07:00
Michael Bolin f3fa7a67a9 config: gate legacy writable roots from profiles 2026-04-30 09:46:38 -07:00
Michael Bolin 8eb1487994 Merge def1b7607e into sapling-pr-archive-bolinfest 2026-04-30 09:39:26 -07:00
Michael Bolin def1b7607e tui tests: assert permission profiles directly 2026-04-30 09:39:15 -07:00
Michael Bolin 0732448a0c Merge 93484640e4 into sapling-pr-archive-bolinfest 2026-04-30 09:32:38 -07:00
Michael Bolin 93484640e4 config: gate legacy writable roots from profiles 2026-04-30 09:32:22 -07:00
Owen Lin 3516cb9751 fix(core): truncate large mcp tool outputs in rollouts (#20260)
## Why
Large MCP tool call outputs can make rollout JSONL files enormous. In
the session that motivated this change, the biggest JSONL records were:
- `event_msg/mcp_tool_call_end`
- `response_item/function_call_output`

both containing the same unbounded MCP payloads - just 3 MCP tool calls
that each were multi-hundred MBs 😱

This PR truncates both of those JSONL records.

## How

#### For `response_item/function_call_output`
Unified exec already bounds tool output before it is injected into
model-facing history, which also keeps the corresponding rollout
`response_item/function_call_output` records small.

MCP should follow the same pattern: truncate the model-facing tool
output at the tool-output boundary, while leaving code-mode/raw hook
consumers alone.

#### For `event_msg/mcp_tool_call_end`
`McpToolCallEnd` also needs its own bounded event copy because it is the
app-server/replay/UI event shape that backs `ThreadItem::McpToolCall`.
Unfortunately this is _not_ downstream of the `ToolOutput` trait.

## Model behavior 
Model behavior is actually unchanged as a result of this PR. 

Before this PR, MCP output was:
1. Converted to `FunctionCallOutput`.
2. Recorded into in-memory history.
3. Truncated by `ContextManager::record_items()` before later model
turns saw it.

After this branch, MCP output is truncated earlier, in
`McpToolOutput::response_payload()`, using the same helper. Then
`ContextManager::record_items()` sees an already-truncated output and
effectively has little/no additional work to do.

So the model should still see the same kind of truncated function-call
output. The practical difference is where truncation happens: earlier,
before rollout persistence/app-server emission can see the giant
payload.

## Verification

- `cargo test -p codex-core mcp_tool_output`
- `cargo test -p codex-core
mcp_tool_call::tests::truncate_mcp_tool_result_for_event`
- `cargo test -p codex-core
mcp_post_tool_use_payload_uses_model_tool_name_args_and_result`
- `just fmt`
- `just fix -p codex-core`
- `git diff --check`
2026-04-30 16:30:43 +00:00
Michael Bolin 1b7bb49e33 Merge f63f05f8a6 into sapling-pr-archive-bolinfest 2026-04-30 09:27:02 -07:00
Michael Bolin f63f05f8a6 windows-sandbox: accept permission profiles from callers 2026-04-30 09:26:53 -07:00
Michael Bolin 5326f9fd1c Merge bb346d3119 into sapling-pr-archive-bolinfest 2026-04-30 09:23:19 -07:00
Michael Bolin bb346d3119 windows-sandbox: accept permission profiles from callers 2026-04-30 09:23:02 -07:00
Michael Bolin 8679f42bae Merge 6a9db12adb into sapling-pr-archive-bolinfest 2026-04-30 09:15:01 -07:00
Michael Bolin 6a9db12adb exec: localize legacy windows sandbox projection 2026-04-30 09:14:47 -07:00
Michael Bolin dd6d3da73b Merge 2cbb225a49 into sapling-pr-archive-bolinfest 2026-04-30 08:58:33 -07:00
Michael Bolin 2cbb225a49 session: stop exposing legacy sandbox policy 2026-04-30 08:58:19 -07:00
Michael Bolin d507eb9ce0 protocol: remove legacy sandbox turn-context overrides 2026-04-30 08:58:19 -07:00
Michael Bolin 184fa5281a Merge b08d404f4e into sapling-pr-archive-bolinfest 2026-04-30 08:54:58 -07:00
Michael Bolin b08d404f4e session: stop exposing legacy sandbox policy 2026-04-30 08:54:43 -07:00
Michael Bolin 7eefd0f3b3 Merge 11f94d436d into sapling-pr-archive-bolinfest 2026-04-30 08:49:59 -07:00
Michael Bolin 11f94d436d protocol: remove legacy sandbox turn-context overrides 2026-04-30 08:49:40 -07:00
Michael Bolin f64b1418d6 Merge dd07fb5a2a into sapling-pr-archive-bolinfest 2026-04-30 08:36:01 -07:00
Michael Bolin dd07fb5a2a protocol: drop legacy sandbox from user turns 2026-04-30 08:35:50 -07:00
Michael Bolin ef15ee9b6d Merge b42ea0a808 into sapling-pr-archive-bolinfest 2026-04-30 08:22:48 -07:00
Michael Bolin b42ea0a808 protocol: require permission profiles for user turns 2026-04-30 08:22:28 -07:00
Michael Bolin 88317965f2 Merge 9c17b2dc03 into sapling-pr-archive-bolinfest 2026-04-30 08:02:43 -07:00
Michael Bolin 9c17b2dc03 protocol: canonicalize turn context permissions 2026-04-30 08:02:30 -07:00
Michael Bolin 4253f271ee Merge 71f7d562cd into sapling-pr-archive-bolinfest 2026-04-30 07:48:44 -07:00