Commit Graph
13105 Commits
Author SHA1 Message Date
Michael Bolin 2b8b5e6a4d Merge e154f63289 into sapling-pr-archive-bolinfest 2026-04-25 13:48:01 -07:00
Michael Bolin e154f63289 permissions: finish profile-backed app surfaces 2026-04-25 13:47:43 -07:00
Michael Bolin de2513e69f permissions: remove core legacy policy round trips 2026-04-25 13:47:43 -07:00
Michael Bolin 0f8b2257ec permissions: migrate approval and sandbox consumers to profiles 2026-04-25 13:47:43 -07:00
Michael Bolin b5b6f7023e permissions: derive compatibility policies from profiles 2026-04-25 13:47:43 -07:00
Michael Bolin 71ce35708b permissions: make runtime config profile-backed 2026-04-25 13:47:43 -07:00
Michael Bolin f41306b4f3 test: isolate remote thread store regression from plugin warmups (#19593)
Follow-up to #19266.

## Why


`thread_start_with_non_local_thread_store_does_not_create_local_persistence`
is meant to catch accidental local thread persistence when a non-local
thread store is configured. The Windows flake reported in [this
BuildBuddy
invocation](https://app.buildbuddy.io/invocation/0b75dde4-6828-4e7b-a35b-e45b73fb005d)
showed that the assertion was tripping on an unexpected top-level `.tmp`
entry:

```diff
 {
+    ".tmp",
     "config.toml",
     "installation_id",
     "memories",
     "skills",
 }
```

That `.tmp` does not appear to come from `tempfile::TempDir`; it comes
from unrelated plugin startup work that can legitimately materialize
`codex_home/.tmp`, including the startup remote plugin sync marker in
[`core/src/plugins/startup_sync.rs`](https://github.com/openai/codex/blob/bce74c70ce058982534507330ff33f7b196708ef/codex-rs/core/src/plugins/startup_sync.rs#L13-L15)
and the curated plugin snapshot under
[`.tmp/plugins`](https://github.com/openai/codex/blob/bce74c70ce058982534507330ff33f7b196708ef/codex-rs/core-plugins/src/startup_sync.rs#L25-L26).

That makes the regression race unrelated background startup tasks
instead of validating the thread-store invariant it was added to cover.
Rather than weakening the assertion to allow arbitrary `.tmp` entries,
this change isolates the test from plugin warmups so it can stay strict
about unexpected local thread persistence artifacts.

## What changed

- disable plugins in the generated config used by
`app-server/tests/suite/v2/remote_thread_store.rs`
- keep the existing `codex_home` assertions unchanged so the test still
fails if local session or sqlite persistence is introduced

## Verification

- `cargo test -p codex-app-server
suite::v2::remote_thread_store::thread_start_with_non_local_thread_store_does_not_create_local_persistence
-- --exact`
2026-04-25 20:45:31 +00:00
Michael Bolin a525b49d3a Merge 6fe18bbbff into sapling-pr-archive-bolinfest 2026-04-25 13:26:58 -07:00
Michael Bolin 6fe18bbbff test: isolate remote thread store persistence regression 2026-04-25 13:26:44 -07:00
Eric Traut bce74c70ce Restore persisted model provider on thread resume (#19287)
Fixes #15219.

## Why

`thread/resume` should continue a persisted thread with the same model
provider that created the thread. The app server already restores the
persisted model and reasoning effort before resuming, but it was leaving
`model_provider` unset. If a user created a thread with one provider and
later switched their active profile to another provider, resumed
encrypted history could be sent to the wrong endpoint and fail with
`invalid_encrypted_content`.

The thread metadata already records the original provider, so resume
should apply it when the caller has not explicitly requested a different
model/provider/reasoning configuration.

## What changed

This updates `merge_persisted_resume_metadata` in
`app-server/src/codex_message_processor.rs` to copy
`ThreadMetadata::model_provider` into `ConfigOverrides::model_provider`
alongside the persisted model.

The existing resume metadata tests now also assert that:

- the persisted provider is restored for normal resume
- explicit model, provider, or reasoning-effort overrides still prevent
persisted resume metadata from being applied
- a thread with no persisted model or reasoning effort still resumes
with its persisted provider

## Verification

- `cargo test -p codex-app-server` passed the app-server unit tests,
including the updated resume metadata coverage. The broader integration
portion of that command failed in an unrelated environment-sensitive
skills-budget warning assertion, where this run saw 8 omitted skills
instead of the expected 7.
- `just fix -p codex-app-server` completed successfully.
2026-04-25 12:40:00 -07:00
Michael Bolin 952250df6e Merge d958f52151 into sapling-pr-archive-bolinfest 2026-04-25 10:25:10 -07:00
Michael Bolin d958f52151 permissions: finish profile-backed app surfaces 2026-04-25 10:24:56 -07:00
Michael Bolin 7937eb324d permissions: remove core legacy policy round trips 2026-04-25 10:24:56 -07:00
Michael Bolin d55d33b129 permissions: migrate approval and sandbox consumers to profiles 2026-04-25 10:24:56 -07:00
Michael Bolin f64334a799 permissions: derive compatibility policies from profiles 2026-04-25 10:24:56 -07:00
Michael Bolin 48d74e7b6e permissions: make runtime config profile-backed 2026-04-25 10:24:56 -07:00
Michael Bolin 88f300d74d fix: increase Bazel timeout to 45 minutes (#19578)
Unfortunately, if most of the build graph is invalidated such that there
are few cache hits, the Windows Bazel build for all the tests often
takes more than `30` minutes, so this PR increases the timeout to `45`
minutes until we set up distributed builds.
2026-04-25 10:03:01 -07:00
Michael Bolin 3743eab63e Merge f2d627f15e into sapling-pr-archive-bolinfest 2026-04-25 09:56:43 -07:00
Michael Bolin f2d627f15e fix: increase Bazel timeout to 45 minutes 2026-04-25 09:56:37 -07:00
Michael Bolin 3993859337 merge commit for archive created by Sapling 2026-04-25 09:17:30 -07:00
Michael Bolin 47ce60e3e4 permissions: finish profile-backed app surfaces 2026-04-25 09:08:06 -07:00
Michael Bolin 93f49ada50 permissions: remove core legacy policy round trips 2026-04-25 09:08:06 -07:00
Michael Bolin 66783f3e8f permissions: migrate approval and sandbox consumers to profiles 2026-04-25 09:08:06 -07:00
Michael Bolin c8335d27f2 permissions: derive compatibility policies from profiles 2026-04-25 09:08:06 -07:00
Michael Bolin cdbbfa4bc1 permissions: make runtime config profile-backed 2026-04-25 09:07:56 -07:00
Michael Bolin 0997360123 Merge 5801f386bd into sapling-pr-archive-bolinfest 2026-04-25 08:57:46 -07:00
Michael Bolin 5801f386bd permissions: finish profile-backed app surfaces 2026-04-25 08:57:28 -07:00
Michael Bolin 54081971f7 permissions: remove core legacy policy round trips 2026-04-25 08:57:28 -07:00
Michael Bolin 08fc3d2942 permissions: migrate approval and sandbox consumers to profiles 2026-04-25 08:57:28 -07:00
Michael Bolin 6ceba5b9ab permissions: derive compatibility policies from profiles 2026-04-25 08:57:27 -07:00
Michael Bolin 61bde65dbf permissions: make runtime config profile-backed 2026-04-25 08:57:27 -07:00
Michael Bolin 3fd1d42c43 merge commit for archive created by Sapling 2026-04-25 08:48:30 -07:00
Michael Bolin c90fb0c5f7 permissions: finish profile-backed app surfaces 2026-04-25 08:40:02 -07:00
Michael Bolin af09a5cfc3 permissions: remove core legacy policy round trips 2026-04-25 08:40:02 -07:00
Michael Bolin c9ff2ef3b8 permissions: migrate approval and sandbox consumers to profiles 2026-04-25 08:40:01 -07:00
Michael Bolin ac08756b88 permissions: derive compatibility policies from profiles 2026-04-25 08:40:01 -07:00
Michael Bolin 6fe1c20aec permissions: make runtime config profile-backed 2026-04-25 08:38:14 -07:00
Ahmed Ibrahim 022f81df1f [codex] Order codex-mcp items by visibility (#19526)
## Why

The visibility cleanup in the base PR reduced what `codex-mcp` exposes,
but several files still made reviewers read private support machinery
before the public or crate-facing entry points. This ordering pass makes
each file easier to scan: exported API first, crate-visible MCP
internals next, then private helpers in breadth-first order from the
higher-level MCP flows to leaf utilities.

## What Changed

- Reordered `codex-mcp` exports so the runtime, configuration, snapshot,
auth, and helper surfaces are grouped by visibility and reader
importance.
- Moved public and crate-visible MCP items ahead of private helpers in
the auth, MCP planning/snapshot, connection manager, and tool-name
modules.
- Kept the change mechanical, with no behavior changes intended.

## Verification

- `cargo check -p codex-mcp`
2026-04-25 07:17:30 -07:00
Ahmed Ibrahim 706490ab1b [codex] Prune unused codex-mcp API and duplicate helpers (#19524)
## Why

`codex-mcp` currently exposes more API than the rest of the workspace
uses. Some of that surface is simply visibility that can be tightened,
and some of it is public helper code that remains compiler-valid because
it is exported even though no workspace caller uses it.

That distinction matters: Rust does not warn on exported API just
because the current workspace does not call it. This PR intentionally
treats those exported-but-workspace-unreferenced paths as stale
`codex-mcp` surface. The main example is MCP skill dependency
collection, where the active implementation now lives in
`codex-rs/core/src/mcp_skill_dependencies.rs`; keeping the older
`codex-mcp` copy makes it unclear which implementation owns skill MCP
installation.

## What Changed

- Pruned unused `codex-mcp` re-exports from `codex-mcp/src/lib.rs`.
- Removed non-runtime helper methods from `McpConnectionManager` so it
stays focused on live MCP clients.
- Made `ToolPluginProvenance` lookup methods crate-private.
- Removed workspace-unreferenced snapshot wrapper APIs and
qualified-tool grouping helpers.
- Deleted the duplicate `codex-mcp` skill dependency module and tests
now that skill MCP dependency handling is owned by `core`.

## Verification

- `cargo check -p codex-mcp`
2026-04-25 06:36:07 -07:00
Matthew Zeng 6e838a19fa Enable unavailable dummy tools by default (#19459)
## Summary
- Mark `unavailable_dummy_tools` as a stable feature and enable it by
default
- Update the feature registry test to match the new default state

## Testing
- `just fmt`
- `cargo test -p codex-features`
2026-04-25 08:46:57 +00:00
Eric Traut a2db6f97fb Fix codex-rs README grammar (#19514)
## Why

Issue #19418 points out a small grammar issue in `codex-rs/README.md`
under "Code Organization." The current sentence says "we hope this to
be," which reads awkwardly.

Fixes #19418.

## What changed

Updated the `core/` crate description so the sentence reads "we hope
this becomes a library crate."

## Verification

Documentation-only change. Reviewed the Markdown diff.
2026-04-24 23:31:47 -07:00
Dylan Hurd f5497f4d65 Split approval matrix test groups (#19454)
## Why

Recent `main` CI repeatedly timed out in:

- `codex-core::all suite::approvals::approval_matrix_covers_all_modes`

It failed in runs
[24909500958](https://github.com/openai/codex/actions/runs/24909500958),
[24908076251](https://github.com/openai/codex/actions/runs/24908076251),
[24906197645](https://github.com/openai/codex/actions/runs/24906197645),
[24905823212](https://github.com/openai/codex/actions/runs/24905823212),
[24903439629](https://github.com/openai/codex/actions/runs/24903439629),
[24903336028](https://github.com/openai/codex/actions/runs/24903336028),
and
[24898949647](https://github.com/openai/codex/actions/runs/24898949647).

The failure pattern was a 60s Linux remote timeout. Logs showed many
approval scenarios completing before the single matrix test timed out.

## Root Cause

`approval_matrix_covers_all_modes` packed every approval/sandbox/tool
scenario into one test case. That made the test vulnerable to normal CI
variance: one slow scenario or a slow process startup could push the
whole monolithic case past the 60s per-test timeout. It also hid which
part of the matrix was slow because the runner only reported the one
large matrix test.

## What Changed

- Keep the shared `scenarios()` table as the single source of approval
matrix coverage.
- Use one `#[test_case]` per `ScenarioGroup` to generate five async
Tokio tests: danger/full-access, read-only, workspace-write,
apply-patch, and unified-exec.
- Keep the group runner small and add per-scenario error context so a
failure still reports the specific scenario name.

## Why This Should Be Reliable

Each scenario group now has its own test harness timeout instead of
sharing one timeout window with the full matrix. That removes the long
sequential loop from a single test while keeping the implementation
compact and easy to scan.

The tests still run through the same scenario definitions and runner, so
this preserves coverage. `test-case` already composes with
`#[tokio::test]` in this crate and is already available for test code.

## Verification

- `cargo test -p codex-core --test all approval_matrix_ -- --list`
- `cargo test -p codex-core --test all approval_matrix_`
2026-04-24 21:38:27 -07:00
Michael Bolin 30462ddd65 Merge f41f6727bc into sapling-pr-archive-bolinfest 2026-04-24 21:23:30 -07:00
Michael Bolin f41f6727bc permissions: finish profile-backed app surfaces 2026-04-24 21:23:18 -07:00
Michael Bolin 3b0b96bfc5 permissions: remove core legacy policy round trips 2026-04-24 21:23:18 -07:00
Michael Bolin 828b90d9e8 permissions: migrate approval and sandbox consumers to profiles 2026-04-24 21:23:18 -07:00
Michael Bolin 02de52f20e permissions: derive compatibility policies from profiles 2026-04-24 21:23:18 -07:00
Michael Bolin 2cc36a13c8 permissions: make runtime config profile-backed 2026-04-24 21:23:18 -07:00
Eric Traut f1c963d77e Add goal TUI UX (5 / 5) (#18077)
Adds the TUI user experience for goals on top of the core runtime from
PR 4.

## Why

Users need a direct TUI control surface for long-running goals. The UI
should make the current goal visible, support common goal actions
without waiting for a model turn, and avoid confusing end-of-turn
notifications while an active goal is immediately continuing.

## What changed

- Added `/goal` summary rendering for the current goal, including
active, paused, budget-limited, and complete states.
- Added `/goal <objective>` creation/replacement through the app-server
goal API rather than a model prompt.
- Added `/goal clear`, `/goal pause`, and `/goal unpause` command
variants.
- Added a confirmation menu when the user enters a new goal while
another goal already exists.
- Updated `/goal` help and summary tip text so it reflects the supported
command variants without advertising slash-command token budgets.
- Added footer/statusline goal indicators, including elapsed time and
token budget display when a budget exists from API/tool-created goals.
- Consumes goal updated/cleared notifications so the TUI stays in sync
with external app-server changes.
- Suppresses end-of-turn desktop notifications only when a goal is still
active and follow-up work is expected.
- Preserves slash-command history behavior and avoids leaking queued
`/goal` state into unrelated submissions.

## Verification

- Added TUI unit and snapshot coverage for goal command availability,
summary rendering, control commands, replacement menu behavior,
status/footer display, notification handling, and command history.
2026-04-24 21:16:45 -07:00
Eric Traut 4167628622 Add goal core runtime (4 / 5) (#18076)
Adds the core runtime behavior for active goals on top of the model
tools from PR 3.

## Why

A long-running goal should be a core runtime concern, not something
every client has to implement. Core owns the turn lifecycle, tool
completion boundaries, interruptions, resume behavior, and token usage,
so it is the right place to account progress, enforce budgets, and
decide when to continue work.

## What changed

- Centralized goal lifecycle side effects behind
`Session::goal_runtime_apply(GoalRuntimeEvent::...)`.
- Starts goal continuation turns only when the session is idle; pending
user input and mailbox work take priority.
- Accounts token and wall-clock usage at turn, tool, mutation,
interrupt, and resume boundaries; `get_thread_goal` remains read-only.
- Preserves sub-second wall-clock remainder across accounting boundaries
so long-running goals do not drift downward over time.
- Treats token budget exhaustion as a soft stop by marking the goal
`budget_limited` and injecting wrap-up steering instead of aborting the
active turn.
- Suppresses budget steering when `update_goal` marks a goal complete.
- Pauses active goals on interrupt and auto-reactivates paused goals
when a thread resumes outside plan mode.
- Suppresses repeated automatic continuation when a continuation turn
makes no tool calls.
- Added continuation and budget-limit prompt templates.

## Verification

- Added focused core coverage for continuation scheduling, accounting
boundaries, budget-limit steering, completion accounting, interrupt
pause behavior, resume auto-activation, and wall-clock remainder
accounting.
2026-04-24 21:16:00 -07:00