Commit Graph
12420 Commits
Author SHA1 Message Date
Michael Bolin fd63861883 rollout: persist turn permission profiles 2026-04-21 10:40:32 -07:00
Michael Bolin 447123caa8 clients: send permission profiles to app-server 2026-04-21 10:40:32 -07:00
Michael Bolin a8aa1b2bf3 app-server: accept permission profile overrides 2026-04-21 10:40:32 -07:00
Michael Bolin c503582661 app-server: expose thread permission profiles 2026-04-21 10:40:32 -07:00
Michael Bolin 8a10b7dd51 core: derive active permission profiles 2026-04-21 10:40:32 -07:00
Michael Bolin cacb5de94e exec-server: carry filesystem sandbox profiles 2026-04-21 10:40:32 -07:00
Michael Bolin 9f863363a1 sandboxing: materialize cwd-relative permission globs 2026-04-21 10:40:25 -07:00
Michael Bolin 54a57a0de6 Merge 1aae3d3b02 into sapling-pr-archive-bolinfest 2026-04-21 10:27:23 -07:00
Michael Bolin 1aae3d3b02 tests: isolate approval fixtures from host rules 2026-04-21 10:26:15 -07:00
Michael Bolin 0d5510c549 shell-escalation: carry resolved permission profiles 2026-04-21 10:25:04 -07:00
Michael Bolin e8c3569a3c mcp: include permission profiles in sandbox state 2026-04-21 10:25:04 -07:00
Michael Bolin 255490b98d tui: carry permission profiles on user turns 2026-04-21 10:25:04 -07:00
Michael Bolin 8d1ce90d59 tui: sync session permission profiles 2026-04-21 10:25:03 -07:00
Michael Bolin 02b498e158 app-server: accept command permission profiles 2026-04-21 10:25:03 -07:00
Michael Bolin fa4dc621f7 protocol: report session permission profiles 2026-04-21 10:25:02 -07:00
Steve Coffey 38ba876ea9 Refresh generated Python app-server SDK types (#18862)
This is the first step in splitting the Python SDK PyPI publish work
into reviewable layers: land the generated SDK refresh by itself before
changing packaging mechanics. The next PRs will make the runtime wheel
publishable, then wire the SDK package/version pinning to that runtime.

## Summary
- Refresh generated Python app-server v2 models and notification
registry from the current schema.
- Update the public API signature expectations for the newly generated
kwargs.

## Stack
- PR 1 of 3 for the Python SDK PyPI publishing split.
- Follow-up PRs will handle runtime wheel publishing mechanics, then
SDK/package version pinning.

## Tests
- `uv run --extra dev pytest` in `sdk/python` -> 51 passed, 37 skipped.
2026-04-21 10:23:27 -07:00
Michael Bolin ff27339587 rollout: persist turn permission profiles 2026-04-21 10:23:20 -07:00
Michael Bolin 4ddcab277b clients: send permission profiles to app-server 2026-04-21 10:23:20 -07:00
Michael Bolin c89723329e app-server: accept permission profile overrides 2026-04-21 10:23:20 -07:00
Michael Bolin 6c59e78192 app-server: expose thread permission profiles 2026-04-21 10:23:20 -07:00
Michael Bolin 2089eb5d64 core: derive active permission profiles 2026-04-21 10:23:20 -07:00
Michael Bolin 5b7a782053 exec-server: carry filesystem sandbox profiles 2026-04-21 10:23:20 -07:00
Michael Bolin f8562bd47b sandboxing: intersect permission profiles semantically (#18275)
## Why

Permission approval responses must not be able to grant more access than
the tool requested. Moving this flow to `PermissionProfile` means the
comparison must be profile-shaped instead of `SandboxPolicy`-shaped, and
cwd-relative special paths such as `:cwd` and `:project_roots` must stay
anchored to the turn that produced the request.

## What changed

This implements semantic `PermissionProfile` intersection in
`codex-sandboxing` for file-system and network permissions. The
intersection accepts narrower path grants, rejects broader grants,
preserves deny-read carve-outs and glob scan depth, and materializes
cwd-dependent special-path grants to absolute paths before they can be
recorded for reuse.

The request-permissions response paths now use that intersection
consistently. App-server captures the request turn cwd before waiting
for the client response, includes that cwd in the v2 approval params,
and core stores the requested profile plus cwd for direct TUI/client
responses and Guardian decisions before recording turn- or
session-scoped grants. The TUI app-server bridge now preserves the
app-server request cwd when converting permission approval params into
core events.

## Verification

- `cargo test -p codex-sandboxing intersect_permission_profiles --
--nocapture`
- `cargo test -p codex-app-server request_permissions_response --
--nocapture`
- `cargo test -p codex-core
request_permissions_response_materializes_session_cwd_grants_before_recording
-- --nocapture`
- `cargo check -p codex-tui --tests`
- `cargo check --tests`
- `cargo test -p codex-tui
app_server_request_permissions_preserves_file_system_permissions`
2026-04-21 10:23:01 -07:00
pakrym-oai 2a226096f6 Split DeveloperInstructions into individual fragments. (#18813)
Split DeveloperInstructions into individual fragments.
2026-04-21 10:22:36 -07:00
pakrym-oai 5fe767e8e1 Refactor app-server config loading into ConfigManager (#18442)
Localize app-server configuration loading in one place.
2026-04-21 10:22:26 -07:00
Eric Traut 4ed722ab8d Move TUI app tests to modules they cover (#18799)
## Summary

The TUI app refactor in #18753 moved the old `app.rs` tests into a
single `app/tests.rs` file. That kept the split mechanically simple, but
it left several focused unit tests far from the modules they exercise.

This PR is a follow-up that moves tests next to the code they cover.

It also adds `tui/src/app/test_support.rs` for shared fixture
construction.

This is just a mechanical refactoring (no functional changes) and does
not affect any production code.
2026-04-21 10:16:51 -07:00
jif-oai 10e1659d4f Stabilize debug clear memories integration test (#18858)
## Why

`debug_clear_memories_resets_state_and_removes_memory_dir` can be flaky
because the test drops its `sqlx::SqlitePool` immediately before
invoking `codex debug clear-memories`. Dropping the pool does not wait
for all SQLite connections to close, so the CLI can race with still-open
test connections.

## What changed

- Await `pool.close()` before spawning `codex debug clear-memories`.
- Close the reopened verification pool before the temp `CODEX_HOME` is
torn down.

## Verification

- `cargo test -p codex-cli --test debug_clear_memories
debug_clear_memories_resets_state_and_removes_memory_dir`
2026-04-21 18:15:37 +01:00
Eric Traut b7fec54354 Queue follow-up input during user shell commands (#18820)
Fixes #17954.

## Why
When a manual shell command like `!sleep 10` is running, submitting
plain text such as `hi` currently sends that text as a steer for the
active shell turn. User shell turns are not steerable like model turns,
so the TUI can remain stuck in `Working` after the shell command
finishes.

## What Changed
- Detect when the only active work is one or more
`ExecCommandSource::UserShell` commands.
- Queue plain submitted input in that state so it drains after the shell
command and shell turn complete.
- Preserve `!cmd` submissions during running work so explicit shell
commands keep their existing behavior.
- Add regression coverage for the `!sleep 10` plus `hi` flow in
`chatwidget::tests::exec_flow::user_message_during_user_shell_command_is_queued_not_steered`.

## Verification
- Manually confirmed hang before the fix and no hang after the fix
2026-04-21 10:13:13 -07:00
Casey ChowandCodex 41652665f5 [codex] Add tmux-aware OSC 9 notifications (#17836)
## Summary
- wrap OSC 9 notifications in tmux's DCS passthrough so terminal
notifications make it through tmux
- use codex-terminal-detection for OSC 9 auto-selection so tmux sessions
inherit the underlying client terminal support
- add focused notification backend tests for plain OSC 9 and
tmux-wrapped output

## Stack
- base PR: #18479
- review order: #18479, then this PR

## Why
Tmux does not forward OSC 9 notifications directly; the sequence has to
be wrapped in tmux's DCS passthrough envelope. Codex also had local
notification heuristics that could miss supported terminals when running
under tmux, even though codex-terminal-detection already knows how to
attribute tmux sessions to the client terminal.

## Validation
- `just fmt`
- `cargo test -p codex-tui` *(currently blocked by an unrelated existing
compile error in `app-server/src/message_processor.rs:754` referencing
`connection_id` out of scope; not caused by this change)*

Co-authored-by: Codex <noreply@openai.com>
2026-04-21 17:10:36 +00:00
Rennie 3a9df58d06 Propagate thread id in MCP tool metadata (#18093)
## Summary
- attach the authoritative Codex thread id to MCP tool request
`_meta.threadId` for model-initiated tool calls
- attach the same thread id for manual `mcpServer/tool/call` requests
before invoking the MCP server
- cover both metadata helper behavior and the manual app-server MCP path
in tests


needed because the Rust app-server is the last place that still has
authoritative knowledge of “this model-generated MCP tool call belongs
to conversation/thread X” before the request leaves Codex and reaches
Hoopa. It adds threadId to MCP request metadata in the model-generated
tool-call path, using sess.conversation_id, and also does the same for
the manual mcpServer/tool/call path.

## Test plan
- `cargo test -p codex-core
mcp_tool_call_thread_id_meta_is_added_to_request_meta --lib`
- `cargo test -p codex-app-server
mcp_server_tool_call_returns_tool_result`

Paired Hoopa consumer PR: https://github.com/openai/openai/pull/833263
2026-04-21 10:09:46 -07:00
Ruslan Nigmatullin 48f82ca7c5 app-server: define device key v2 protocol (#18428)
## Why

Clients need a stable app-server protocol surface for enrolling a local
device key, retrieving its public key, and producing a device-bound
proof.

The protocol reports `protectionClass` explicitly so clients can
distinguish hardware-backed keys from an explicitly allowed OS-protected
fallback. Signing uses a tagged `DeviceKeySignPayload` enum rather than
arbitrary bytes so each signed statement is auditable at the API
boundary.

## What changed

- Added v2 JSON-RPC methods for `device/key/create`,
`device/key/public`, and `device/key/sign`.
- Added request/response types for device-key metadata, SPKI public
keys, protection classes, and ECDSA signatures.
- Added `DeviceKeyProtectionPolicy` with hardware-only default behavior
and an explicit `allow_os_protected_nonextractable` option.
- Added the initial `remoteControlClientConnection` signing payload
variant.
- Regenerated JSON Schema and TypeScript fixtures for app-server
clients.

## Stack

This is PR 1 of 4 in the device-key app-server stack.

## Validation

- `just write-app-server-schema`
- `cargo test -p codex-app-server-protocol`
2026-04-21 10:08:42 -07:00
Michael Bolin b06fc8bd0d core: make test-log a dev dependency (#18846)
The `test-log` crate is only used by `codex-core` tests, so it does not
need
to be part of the normal `codex-core` dependency graph. Keeping
`test-log` in
`dev-dependencies` removes it from normal `codex-core` builds and keeps
the
production dependency set a little smaller.

Verification:

- `cargo tree -p codex-core --edges normal --invert test-log`
- `cargo check -p codex-core --lib`
- `cargo test -p codex-core --lib`
2026-04-21 09:48:31 -07:00
Michael Bolin 5a6128916a merge commit for archive created by Sapling 2026-04-21 09:45:40 -07:00
Michael Bolin fee24f3d5f sandboxing: intersect permission profiles semantically 2026-04-21 09:45:24 -07:00
Michael Bolin ad55e6e55e merge commit for archive created by Sapling 2026-04-21 09:31:06 -07:00
Michael Bolin 9a98ccbefc sandboxing: intersect permission profiles semantically 2026-04-21 09:30:47 -07:00
jif-oai bf2a34b4b2 feat: baseline lib (#18848)
This add with 2 entry point:
* `reset_git_repository` that takes a directory and set it as a new git
root
* `diff_since_latest_init` this returns the diff for a given directory
since the last `reset_git_repository`
2026-04-21 17:24:30 +01:00
Michael Bolin f8f2b36f6b Merge 33512fc391 into sapling-pr-archive-bolinfest 2026-04-21 09:19:21 -07:00
Michael Bolin 33512fc391 tests: isolate approval fixtures from host rules 2026-04-21 09:18:39 -07:00
Michael Bolin 75be5a5aa6 shell-escalation: carry resolved permission profiles 2026-04-21 09:18:39 -07:00
Michael Bolin c30a9a1bb3 mcp: include permission profiles in sandbox state 2026-04-21 09:18:39 -07:00
Michael Bolin 5d1a099dc6 tui: carry permission profiles on user turns 2026-04-21 09:18:39 -07:00
Michael Bolin d63b1b6e11 tui: sync session permission profiles 2026-04-21 09:18:39 -07:00
Michael Bolin a5404eec5f app-server: accept command permission profiles 2026-04-21 09:18:39 -07:00
Michael Bolin fc7c450fa5 protocol: report session permission profiles 2026-04-21 09:18:39 -07:00
Michael Bolin 4740fa239e rollout: persist turn permission profiles 2026-04-21 09:18:39 -07:00
Michael Bolin c013a964b0 clients: send permission profiles to app-server 2026-04-21 09:18:39 -07:00
Michael Bolin 0d7a36cf44 app-server: accept permission profile overrides 2026-04-21 09:18:39 -07:00
Michael Bolin 16f3fe45a1 app-server: expose thread permission profiles 2026-04-21 09:18:39 -07:00
Michael Bolin 07d5e86758 core: derive active permission profiles 2026-04-21 09:18:39 -07:00