Commit Graph
9686 Commits
Author SHA1 Message Date
Michael Bolin 275e62fcc7 Merge 4151578f30 into sapling-pr-archive-bolinfest 2026-03-06 11:58:22 -08:00
Michael Bolin 4151578f30 fix bazel build 2026-03-06 11:58:15 -08:00
Michael Bolin 488875f24d fix: move unit tests in codex-rs/core/src/codex.rs into their own file (#13783)
This is analogous to https://github.com/openai/codex/pull/13780.
2026-03-06 11:56:49 -08:00
Michael Bolin 28ac254700 merge commit for archive created by Sapling 2026-03-06 11:51:37 -08:00
Michael Bolin 5cd0fd920a config: add v3 filesystem permission profiles 2026-03-06 11:51:31 -08:00
Michael Bolin e0cd259424 merge commit for archive created by Sapling 2026-03-06 11:35:27 -08:00
Michael Bolin 656480dbd9 Merge 177d7b09d9 into sapling-pr-archive-bolinfest 2026-03-06 11:28:29 -08:00
Michael Bolin 177d7b09d9 fix: move unit tests in codex-rs/core/src/codex.rs into their own file 2026-03-06 11:28:18 -08:00
Michael Bolin 4688783f85 linux-sandbox: honor split filesystem policies in bwrap 2026-03-06 11:27:47 -08:00
Michael Bolin 7a24003777 protocol: keep root carveouts sandboxed 2026-03-06 11:27:47 -08:00
Michael Bolin 5e998de5bc sandboxing: preserve denied paths when widening permissions 2026-03-06 11:27:47 -08:00
Michael Bolin ff2d93e5c2 linux-sandbox: plumb split sandbox policies through helper 2026-03-06 11:27:47 -08:00
Michael Bolin 6f3174887b seatbelt: honor split filesystem sandbox policies 2026-03-06 11:27:46 -08:00
Michael Bolin 11575e0233 safety: honor filesystem policy carveouts in apply_patch 2026-03-06 11:27:46 -08:00
Michael Bolin 1d1e0badae protocol: derive effective file access from filesystem policies 2026-03-06 11:27:46 -08:00
Michael Bolin 6eea1b035f sandboxing: plumb split sandbox policies through runtime 2026-03-06 11:27:46 -08:00
Michael Bolin 88d8e1d1aa config: add v3 filesystem permission profiles 2026-03-06 11:27:45 -08:00
Michael Bolin 39869f7443 fix: move unit tests in codex-rs/core/src/config/mod.rs into their own file (#13780)
At over 7,000 lines, `codex-rs/core/src/config/mod.rs` was getting a bit
unwieldy.

This PR does the same type of move as
https://github.com/openai/codex/pull/12957 to put unit tests in their
own file, though I decided `config_tests.rs` is a more intuitive name
than `mod_tests.rs`.

Ultimately, I'll codemod the rest of the codebase to follow suit, but I
want to do it in stages to reduce merge conflicts for people.
2026-03-06 11:21:58 -08:00
Charley CunninghamandCodex ad98504d74 Reduce SQLite log retention to 10 days (#13781)
## Summary
- reduce the SQLite-backed log retention window from 90 days to 10 days

## Testing
- just fmt
- cargo test -p codex-state

Co-authored-by: Codex <noreply@openai.com>
2026-03-06 11:15:28 -08:00
sayan-oai 8a54d3caaa feat: structured plugin parsing (#13711)
#### What

Add structured `@plugin` parsing and TUI support for plugin mentions.

- Core: switch from plain-text `@display_name` parsing to structured
`plugin://...` mentions via `UserInput::Mention` and
`[$...](plugin://...)` links in text, same pattern as apps/skills.
- TUI: add plugin mention popup, autocomplete, and chips when typing
`$`. Load plugin capability summaries and feed them into the composer;
plugin mentions appear alongside skills and apps.
- Generalize mention parsing to a sigil parameter, still defaults to `$`

<img width="797" height="119" alt="image"
src="https://github.com/user-attachments/assets/f0fe2658-d908-4927-9139-73f850805ceb"
/>

Builds on #13510. Currently clients have to build their own `id` via
`plugin@marketplace` and filter plugins to show by `enabled`, but we
will add `id` and `available` as fields returned from `plugin/list`
soon.

####Tests

Added tests, verified locally.
2026-03-06 11:08:36 -08:00
Michael Bolin 45bc4bf6ba merge commit for archive created by Sapling 2026-03-06 11:08:17 -08:00
Michael Bolin 84db80f616 fix: move unit tests in codex-rs/core/src/config/mod.rs into their own file 2026-03-06 11:08:06 -08:00
Michael Bolin e0676d4311 merge commit for archive created by Sapling 2026-03-06 11:05:02 -08:00
Michael Bolin 7f7a180110 merge commit for archive created by Sapling 2026-03-06 11:02:37 -08:00
Michael Bolin a05ed06409 fix: move unit tests in codex-rs/core/src/config/mod.rs into their own file 2026-03-06 11:02:29 -08:00
jif-oai 0e41a5c4a8 chore: improve DB flushing (#13620)
This branch:
* Avoid flushing DB when not necessary
* Filter events for which we perfom an `upsert` into the DB
* Add a dedicated update function of the `thread:updated_at` that is
lighter

This should significantly reduce the DB lock contention. If it is not
sufficient, we can de-sync the flush of the DB for `updated_at`
2026-03-06 19:58:14 +01:00
Michael Bolin f05a0a3210 linux-sandbox: honor split filesystem policies in bwrap 2026-03-06 10:54:33 -08:00
Michael Bolin d3e5080d04 protocol: keep root carveouts sandboxed 2026-03-06 10:54:33 -08:00
Michael Bolin a86cbebf52 sandboxing: preserve denied paths when widening permissions 2026-03-06 10:54:33 -08:00
Charley CunninghamandCodex 4e6c6193a1 Move sqlite logs to a dedicated database (#13772)
## Summary
- move sqlite log reads and writes onto a dedicated `logs_1.sqlite`
database to reduce lock contention with the main state DB
- add a dedicated logs migrator and route `codex-state-logs` to the new
database path
- leave the old `logs` table in the existing state DB untouched for now

## Testing
- just fmt
- cargo test -p codex-state

---------

Co-authored-by: Codex <noreply@openai.com>
2026-03-06 10:54:20 -08:00
Michael Bolin 5b731acf15 merge commit for archive created by Sapling 2026-03-06 10:53:16 -08:00
Michael Bolin c88ee7f2eb fix: move unit tests in codex-rs/core/src/config/mod.rs into their own file 2026-03-06 10:53:10 -08:00
Michael Bolin 3db879892d linux-sandbox: plumb split sandbox policies through helper 2026-03-06 10:52:42 -08:00
Michael Bolin 3e354add15 seatbelt: honor split filesystem sandbox policies 2026-03-06 10:51:14 -08:00
Michael Bolin a6a9651774 safety: honor filesystem policy carveouts in apply_patch 2026-03-06 10:51:14 -08:00
Michael Bolin a7c157b38d protocol: derive effective file access from filesystem policies 2026-03-06 10:51:14 -08:00
Michael Bolin 5d339bdf3d sandboxing: plumb split sandbox policies through runtime 2026-03-06 10:51:13 -08:00
Michael Bolin 1ad84c7c00 merge commit for archive created by Sapling 2026-03-06 10:49:41 -08:00
Michael Bolin 6a12780b85 fix: move unit tests in codex-rs/core/src/config/mod.rs into their own file 2026-03-06 10:49:30 -08:00
Michael Bolin 856bce7c28 config: add v3 filesystem permission profiles 2026-03-06 10:41:39 -08:00
Ruslan Nigmatullin 51fcdc760d app-server: Emit thread/name/updated event globally (#13674) 2026-03-06 10:25:18 -08:00
Owen Lin 3449e00bc9 feat(otel, core): record turn TTFT and TTFM metrics in codex-core (#13630)
### Summary
This adds turn-level latency metrics for the first model output and the
first completed agent message.
- `codex.turn.ttft.duration_ms` starts at turn start and records on the
first output signal we see from the model. That includes normal
assistant text, reasoning deltas, and non-text outputs like tool-call
items.
- `codex.turn.ttfm.duration_ms` also starts at turn start, but it
records when the first agent message finishes streaming rather than when
its first delta arrives.

### Implementation notes
The timing is tracked in codex-core, not app-server, so the definition
stays consistent across CLI, TUI, and app-server clients.

I reused the existing turn lifecycle boundary that already drives
`codex.turn.e2e_duration_ms`, stored the turn start timestamp in turn
state, and record each metric once per turn.

I also wired the new metric names into the OTEL runtime metrics summary
so they show up in the same in-memory/debug snapshot path as the
existing timing metrics.
2026-03-06 10:23:48 -08:00
Michael Bolin eb253a40b0 merge commit for archive created by Sapling 2026-03-06 10:12:26 -08:00
Owen Lin 6c98a59dbd fix(app-server): fix turn_start_shell_zsh_fork_executes_command_v2 flake (#13770)
This fixes a flaky `turn_start_shell_zsh_fork_executes_command_v2` test.

The interrupt path can race with the follow-up `/responses` request that
reports the aborted tool call, so the test now allows that extra no-op
response instead of assuming there will only ever be one request. The
assertions still stay focused on the behavior the test actually cares
about: starting the zsh-forked command correctly.

Testing:
- `just fmt`
- `cargo test -p codex-app-server --test all
suite::v2::turn_start_zsh_fork::turn_start_shell_zsh_fork_executes_command_v2
-- --exact --nocapture`
2026-03-06 10:10:16 -08:00
Charley CunninghamandCodex cb1a182bbe Clarify sandbox permission override helper semantics (#13703)
## Summary
Today `SandboxPermissions::requires_additional_permissions()` does not
actually mean "is `WithAdditionalPermissions`". It returns `true` for
any non-default sandbox override, including `RequireEscalated`. That
broad behavior is relied on in multiple `main` callsites.

The naming is security-sensitive because `SandboxPermissions` is used on
shell-like tool calls to tell the executor how a single command should
relate to the turn sandbox:
- `UseDefault`: run with the turn sandbox unchanged
- `RequireEscalated`: request execution outside the sandbox
- `WithAdditionalPermissions`: stay sandboxed but widen permissions for
that command only

## Problem
The old helper name reads as if it only applies to the
`WithAdditionalPermissions` variant. In practice it means "this command
requested any explicit sandbox override."

That ambiguity made it easy to read production checks incorrectly and
made the guardian change look like a standalone `main` fix when it is
not.

On `main` today:
- `shell` and `unified_exec` intentionally reject any explicit
`sandbox_permissions` request unless approval policy is `OnRequest`
- `exec_policy` intentionally treats any explicit sandbox override as
prompt-worthy in restricted sandboxes
- tests intentionally serialize both `RequireEscalated` and
`WithAdditionalPermissions` as explicit sandbox override requests

So changing those callsites from the broad helper to a narrow
`WithAdditionalPermissions` check would be a behavior change, not a pure
cleanup.

## What This PR Does
- documents `SandboxPermissions` as a per-command sandbox override, not
a generic permissions bag
- adds `requests_sandbox_override()` for the broad meaning: anything
except `UseDefault`
- adds `uses_additional_permissions()` for the narrow meaning: only
`WithAdditionalPermissions`
- keeps `requires_additional_permissions()` as a compatibility alias to
the broad meaning for now
- updates the current broad callsites to use the accurately named broad
helper
- adds unit coverage that locks in the semantics of all three helpers

## What This PR Does Not Do
This PR does not change runtime behavior. That is intentional.

---------

Co-authored-by: Codex <noreply@openai.com>
2026-03-06 09:57:48 -08:00
jif-oai c8f4b5bc1e feat: limit number of rows per log (#13763)
avoid DB explosion. This is a temp solution
2026-03-06 18:51:42 +01:00
jif-oai f891f516a5 feat: drop discrepency metrics (#13753) 2026-03-06 18:32:25 +01:00
Michael Bolin 99e9bc1705 merge commit for archive created by Sapling 2026-03-06 09:28:35 -08:00
Michael Bolin 9979e72a09 refactor: route zsh-fork through unified exec 2026-03-06 09:28:31 -08:00
Michael Bolin 9b7549970d linux-sandbox: honor split filesystem policies in bwrap 2026-03-06 09:26:32 -08:00