Commit Graph
14233 Commits
Author SHA1 Message Date
Michael Bolin e0ce75b201 merge commit for archive created by Sapling 2026-04-28 23:50:59 -07:00
Michael Bolin acdc76a0f8 permissions: expose active profile metadata 2026-04-28 23:50:17 -07:00
Michael Bolin 4846377216 merge commit for archive created by Sapling 2026-04-28 22:47:33 -07:00
Michael Bolin a70a0d91ca permissions: expose active profile metadata 2026-04-28 22:47:26 -07:00
Michael Bolin 8e5addb952 merge commit for archive created by Sapling 2026-04-28 21:41:23 -07:00
Michael Bolin 8cae849aba permissions: expose active profile metadata 2026-04-28 21:41:14 -07:00
Michael Bolin d9d77866e2 merge commit for archive created by Sapling 2026-04-28 21:30:53 -07:00
Michael Bolin 44b2e362fe permissions: expose active profile metadata 2026-04-28 21:30:46 -07:00
Michael Bolin a83071f45d merge commit for archive created by Sapling 2026-04-28 21:29:37 -07:00
Michael Bolin 1fff1e046f permissions: expose active profile metadata 2026-04-28 21:29:22 -07:00
Michael Bolin b4d83212e9 Merge 9d8708a70c into sapling-pr-archive-bolinfest 2026-04-28 20:51:26 -07:00
Michael Bolin 9d8708a70c permissions: expose active profile metadata 2026-04-28 20:51:18 -07:00
Michael Bolin 8f3e20aba6 merge commit for archive created by Sapling 2026-04-28 20:47:53 -07:00
Michael Bolin 0bc22bd61d permissions: expose active profile metadata 2026-04-28 20:47:44 -07:00
Michael Bolin f2ac84ae58 merge commit for archive created by Sapling 2026-04-28 19:59:35 -07:00
Michael Bolin e2ae150346 permissions: expose active profile metadata 2026-04-28 19:59:28 -07:00
Michael Bolin 9a4b662ff6 merge commit for archive created by Sapling 2026-04-28 19:56:01 -07:00
Michael Bolin bd7080bdb9 permissions: expose active profile metadata 2026-04-28 19:55:45 -07:00
Michael Bolin d881d9105b Merge 9e4bfa31a4 into sapling-pr-archive-bolinfest 2026-04-28 19:48:21 -07:00
Michael Bolin 9e4bfa31a4 tests: add no-wait helper for apply patch event tests 2026-04-28 19:46:18 -07:00
Michael Bolin f4329369d2 Merge 2c797bdd84 into sapling-pr-archive-bolinfest 2026-04-28 19:44:46 -07:00
Michael Bolin 2c797bdd84 permissions: expose active profile metadata 2026-04-28 19:44:38 -07:00
Michael Bolin e6db1a9442 linux-sandbox: switch helper plumbing to PermissionProfile (#20106)
## Why

`PermissionProfile` is the canonical runtime permission model in the
Rust workspace, but the Linux sandbox helper still accepted a legacy
`SandboxPolicy` plus separate filesystem and network policy flags. That
translation layer made the helper interface harder to reason about and
left `linux-sandbox`-specific callers and tests coupled to the legacy
policy representation.

This change moves the helper onto `PermissionProfile` directly so the
Linux sandbox plumbing matches the rest of the permission stack.

## What changed

- changed `codex-linux-sandbox` to accept `--permission-profile` and
derive the runtime filesystem and network policies internally
- updated the in-process seccomp and legacy Landlock path in
`codex-rs/linux-sandbox` to operate on `PermissionProfile`
- updated Linux sandbox argv construction in `codex-rs/sandboxing`,
`codex-rs/core`, and the CLI debug sandbox path to pass the canonical
profile instead of serializing compatibility policy projections
- simplified the Linux sandbox tests to build the exact permission
profile under test, including the managed-proxy path and
direct-runtime-enforcement carveout coverage
- removed helper-local `SandboxPolicy` usage from `bwrap` tests where
`FileSystemSandboxPolicy` is already the value being exercised

## Testing

- `cargo test -p codex-sandboxing`
- `cargo test -p codex-linux-sandbox` (on this macOS host, the crate
compiled cleanly and its Linux-only tests were cfg-gated)
- `cargo test -p codex-core --no-run`
- `cargo test -p codex-cli --no-run`
2026-04-28 19:43:44 -07:00
Celia Chen 80fb0704ee feat: update Bedrock Mantle endpoint and GPT-5.4 model ID (#20109)
## Summary

Amazon Bedrock Mantle's OpenAI-compatible endpoint now lives under
`/openai/v1`, and the GPT-5.4 Mantle model ID no longer uses the `-cmb`
suffix. This updates Codex's built-in Bedrock provider configuration so
generated providers and the static Bedrock catalog use the current
endpoint and model ID.

## Changes

- Update the Bedrock Mantle base URL from
`https://bedrock-mantle.{region}.api.aws/v1` to
`https://bedrock-mantle.{region}.api.aws/openai/v1`.
- Update the Amazon Bedrock default base URL in
`codex-model-provider-info`.
- Change the Bedrock GPT-5.4 catalog slug from `openai.gpt-5.4-cmb` to
`openai.gpt-5.4`.
- Align provider and catalog tests with the new URL and model ID.

## Test Plan

- Manual smoke test:

  ```shell
  target/debug/codex \
      -m openai.gpt-5.4 \
      -c 'model_provider="amazon-bedrock"' \
      -c 'model_providers.amazon-bedrock.aws.region="us-west-2"'
  ```
2026-04-29 01:37:21 +00:00
Celia Chen 8c47e36504 feat: expose provider capability bounds to app server clients (#20049)
follow up of #19442. The app server now exposes provider-derived bounds
through a new v2 `modelProvider/read` method. The response reports the
configured provider map key as `modelProvider` and returns the effective
capability booleans so clients can align their UI with the same
provider-owned limits used by core.
2026-04-29 01:36:19 +00:00
canvrno-oai 4c39ad33cb Fix plugin list workspace settings test isolation (#20086)
Fixes test that often fails locally when running `cargo test`
- Add an app-server test helper that combines managed-config isolation
with custom env overrides.
- Isolate `HOME` / `USERPROFILE` in plugin-list workspace settings tests
so host home marketplaces do not affect results.
2026-04-28 18:34:38 -07:00
Michael Bolin b5167907ef merge commit for archive created by Sapling 2026-04-28 18:29:00 -07:00
Michael Bolin 2bc25571ee linux-sandbox: use PermissionProfile in helper 2026-04-28 18:28:45 -07:00
Michael Bolin b69942010e Merge 4a41f9124f into sapling-pr-archive-bolinfest 2026-04-28 18:26:05 -07:00
Michael Bolin cddd0523f8 merge commit for archive created by Sapling 2026-04-28 18:25:32 -07:00
Michael Bolin 3a8940f03e tests: add no-wait helper for apply patch event tests 2026-04-28 18:25:09 -07:00
Michael Bolin 4a41f9124f linux-sandbox: use PermissionProfile in helper 2026-04-28 18:24:22 -07:00
Michael Bolin cb68be2a8f Merge 46f2ed235c into sapling-pr-archive-bolinfest 2026-04-28 18:11:57 -07:00
Michael Bolin 46f2ed235c permissions: expose active profile metadata 2026-04-28 18:11:42 -07:00
canvrno-oai 24be9ac0a4 Restore TUI working status after steer message is set (#19939)
Fix for #19925

Restore the `Working` indicator after a streamed final answer finishes
when a user steer message is sent.
Add regression coverage for long output plus a mid-stream steer:
`cargo test -p codex-tui
final_answer_completion_restores_status_indicator_for_pending_steer`

Duplication/testing steps:
1. Start a new thread and ask for a long response.
2. While the response is streaming, submit a steer message.
3. When the first response finishes, observe whether `Working...` is
shown while waiting for the steer message response.
2026-04-28 18:10:40 -07:00
Michael Bolin c9f7c88f3d fix: restore live event submit path for apply patch tests (#20108)
## Summary

This fixes the CI regression introduced by
[#20040](https://github.com/openai/codex/pull/20040).

That PR migrated several `apply_patch_cli` tests from direct
`codex.submit(Op::UserTurn { ... })` calls to `harness.submit(...)`.
`harness.submit()` waits for `TurnComplete` before returning, which
drains the same event stream that these tests use to assert `TurnDiff`,
`PatchApplyUpdated`, and related live events. The regressed tests then
timed out waiting for events that had already been consumed.

This change restores a no-wait submit path for the event-observing
`apply_patch_cli` tests so they can watch the turn stream directly
again.

## What Changed

- added a local `submit_without_wait(...)` helper in
`codex-rs/core/tests/suite/apply_patch_cli.rs`
- switched the `apply_patch_cli` tests that assert live turn events back
to that helper
- left the profile-backed `harness.submit(...)` migration in place for
tests that only care about final filesystem or tool output state

## Why macOS Looked Green

In the failing run
[25084487331](https://github.com/openai/codex/actions/runs/25084487331),
`//codex-rs/core:core-all-test` was cached on macOS, so the regressed
tests were not rerun there. The Linux GNU, Linux MUSL, and Windows Bazel
jobs reran the target and exposed the failure.

## Verification

- `cargo test -p codex-core apply_patch_ -- --nocapture`
- previously failing local cases now pass again:
  - `apply_patch_cli_move_without_content_change_has_no_turn_diff`
  - `apply_patch_turn_diff_for_rename_with_content_change`
  - `apply_patch_aggregates_diff_across_multiple_tool_calls`
2026-04-28 18:09:20 -07:00
Michael Bolin 24636f8220 Merge 8e6a120966 into sapling-pr-archive-bolinfest 2026-04-28 18:05:13 -07:00
Michael Bolin 8e6a120966 fix: restore raw submit path for apply patch event tests 2026-04-28 18:04:53 -07:00
Michael Bolin a3fce11511 Merge b2dfa64af7 into sapling-pr-archive-bolinfest 2026-04-28 18:00:58 -07:00
Michael Bolin b2dfa64af7 linux-sandbox: use PermissionProfile in helper 2026-04-28 18:00:52 -07:00
Michael Bolin 04ebb14df4 merge commit for archive created by Sapling 2026-04-28 18:00:13 -07:00
Michael Bolin af42be1dfb permissions: expose active profile metadata 2026-04-28 17:59:52 -07:00
Celia Chen f8fe96d548 feat: disable capabilities by model provider (#19442)
## Why

Unsupported features must fail closed and Codex must not expose
OpenAI-hosted fallback paths when the active provider cannot support
them. In practice, Bedrock should not surface app connectors, MCP
servers, tool search/suggestions, image generation, web search, or JS
REPL until those paths are explicitly supported for that provider.

This PR moves that decision into provider-owned capability metadata
instead of scattering Bedrock-specific checks across callers.

## What changed

- Adds `ProviderCapabilities` to `codex-model-provider`, with default
support for existing providers and a Bedrock override that disables
unsupported launch surfaces.
- Adds `ToolCapabilityBounds` to `codex-tools` so provider capability
limits can clamp otherwise-enabled tool config.
- Applies capability bounds when building session and review-thread tool
config.
- Routes MCP/app connector configuration through
`McpManager::mcp_config`, which filters configured MCP servers and app
connectors based on the active provider.
- Updates app-server MCP list/read paths to use the filtered MCP config.
- Adds coverage for default provider capabilities, Bedrock disabled
capabilities, and optional tool-surface clamping.

## Testing

built locally and verified that bedrock responses api now return without
errors calling unsupported tools.
2026-04-28 17:51:30 -07:00
Michael Bolin 3b82b447ea Merge d75dde3ae5 into sapling-pr-archive-bolinfest 2026-04-28 17:50:26 -07:00
Michael Bolin d75dde3ae5 linux-sandbox: use PermissionProfile in helper 2026-04-28 17:50:09 -07:00
Michael Bolin 074ad0843e merge commit for archive created by Sapling 2026-04-28 17:46:59 -07:00
Michael Bolin cba177d26a permissions: expose active profile metadata 2026-04-28 17:46:45 -07:00
alexsong-oai cb8b1bbcd6 Support detect and import MCP, Subagents, hooks, commands from external (#19949)
## Why
This PR expands the migration path so Codex can detect and import MCP
server config, hooks, commands, and subagents configs in a Codex-native
shape.

## What changed

- Added a `codex-external-agent-migration` crate that owns conversion
logic for external-agent MCP servers, hooks, commands, and subagents.
- Extended the app-server external-agent config detection/import API
with migration item types for MCP server config, hooks, commands, and
subagents.

## Migration strategy

The migration is intentionally conservative: Codex only imports
external-agent config that can be represented safely in Codex today.
Unsupported or ambiguous config is skipped instead of being partially
translated into behavior that may not match the source system.

- **MCP servers**: import supported stdio and HTTP MCP server
definitions into `mcp_servers`. Disabled servers and servers filtered
out by source `enabledMcpjsonServers` / `disabledMcpjsonServers` are
skipped. Project-scoped MCP entries from `.claude.json` are included
when they match the repo path.
- **Hooks**: import only supported command hooks into
`.codex/hooks.json`. Unsupported hook features such as conditional
groups, async handlers, prompt/http hooks, or unknown fields are
skipped. Referenced hook scripts are copied into `.codex/hooks/`,
preserving any existing target scripts.
- **Commands**: import supported external commands as Codex skills under
`.agents/skills/source-command-*`. Commands that rely on source runtime
expansion such as `$ARGUMENTS`, `$1`, `@file` references, shell
interpolation, or colliding generated names are skipped.
- **Subagents**: import valid subagent Markdown files into
`.codex/agents/*.toml` when they have the minimum Codex agent fields.
Source model names are not migrated, so imported agents keep the user’s
Codex default model; compatible reasoning effort and sandbox mode are
migrated when present.
- **Skills and project guidance**: copy missing skill directories into
`.agents/skills` and migrate `CLAUDE.md` guidance into `AGENTS.md`,
rewriting source-agent terminology to Codex terminology where
appropriate.
- **Detection details**: detected migration items include lightweight
details for UI preview, such as MCP server names, hook event names,
generated command skill names, and subagent names. Import still
recomputes from disk instead of trusting details as the source of truth.

- Adds focused coverage for the new migration behavior and app-server
import flow.

## Verification

- `cargo test -p codex-external-agent-migration`
- `cargo test -p codex-hooks`
- `cargo test -p codex-app-server external_agent_config`
- `just bazel-lock-check`
2026-04-29 00:45:24 +00:00
Michael Bolin 074252c756 merge commit for archive created by Sapling 2026-04-28 17:42:52 -07:00
Michael Bolin afbc30db0e permissions: expose active profile metadata 2026-04-28 17:42:35 -07:00