Commit Graph

10954 Commits

Author SHA1 Message Date
Michael Bolin
e4fbb2ce0c Merge ba017c605a into sapling-pr-archive-bolinfest 2026-04-02 08:27:46 -07:00
Michael Bolin
ba017c605a ci: upload compact Bazel execution logs 2026-04-02 08:27:31 -07:00
Michael Bolin
e238542d54 Merge 8ccb31a65e into sapling-pr-archive-bolinfest 2026-04-02 01:41:48 -07:00
Michael Bolin
8ccb31a65e refactor: move shell and snapshot code out of codex-core 2026-04-02 01:41:31 -07:00
Michael Bolin
c1d18ceb6f [codex] Remove codex-core config type shim (#16529)
## Why

This finishes the config-type move out of `codex-core` by removing the
temporary compatibility shim in `codex_core::config::types`. Callers now
depend on `codex-config` directly, which keeps these config model types
owned by the config crate instead of re-expanding `codex-core` as a
transitive API surface.

## What Changed

- Removed the `codex-rs/core/src/config/types.rs` re-export shim and the
`core::config::ApprovalsReviewer` re-export.
- Updated `codex-core`, `codex-cli`, `codex-tui`, `codex-app-server`,
`codex-mcp-server`, and `codex-linux-sandbox` call sites to import
`codex_config::types` directly.
- Added explicit `codex-config` dependencies to downstream crates that
previously relied on the `codex-core` re-export.
- Regenerated `codex-rs/core/config.schema.json` after updating the
config docs path reference.
2026-04-02 01:19:44 -07:00
Michael Bolin
f0de985865 merge commit for archive created by Sapling 2026-04-02 00:59:34 -07:00
Michael Bolin
17a1a48815 config: remove codex-core config type shim 2026-04-02 00:58:39 -07:00
Michael Bolin
da3177871c Merge cfe9a9dba7 into sapling-pr-archive-bolinfest 2026-04-02 00:56:17 -07:00
Michael Bolin
cfe9a9dba7 config: remove codex-core config type shim 2026-04-02 00:56:07 -07:00
Michael Bolin
228962d154 Merge ec0c4005fe into sapling-pr-archive-bolinfest 2026-04-02 00:49:41 -07:00
Michael Bolin
e846fed2b1 fix: move some test utilities out of codex-rs/core/src/tools/spec.rs (#16524)
The `#[cfg(test)]` in `codex-rs/core/src/tools/spec.rs` smelled funny to
me and it turns out these members were straightforward to move.
2026-04-02 00:49:37 -07:00
Michael Bolin
ec0c4005fe core: prune low-value tests 2026-04-02 00:49:23 -07:00
Michael Bolin
f32a5e84bf [codex] Move config types into codex-config (#16523)
## Why

`codex-rs/core/src/config/types.rs` is a plain config-type module with
no dependency on `codex-core`. Moving it into `codex-config` shrinks the
core crate and gives config-only consumers a more natural dependency
boundary.

## What Changed

- Added `codex_config::types` with the moved structs, enums, constants,
and unit tests.
- Kept `codex_core::config::types` as a compatibility re-export to avoid
a broad call-site migration in this PR.
- Switched notice-table writes in `core/src/config/edit.rs` to a local
`NOTICE_TABLE_KEY` constant.
- Added the `wildmatch` runtime dependency and `tempfile` test
dependency to `codex-config`.
2026-04-02 00:39:20 -07:00
Michael Bolin
07a269417a merge commit for archive created by Sapling 2026-04-02 00:32:05 -07:00
Michael Bolin
866d1f5247 fix: move some test utilities out of codex-rs/core/src/tools/spec.rs 2026-04-02 00:31:53 -07:00
Michael Bolin
5131e0de45 Move tool registry plan tests into codex-tools (#16521)
## Why

#16513 moved pure tool-registry planning into `codex-tools`, but much of
the corresponding spec/feature-gating coverage still lived in
`codex-core`. That leaves the tests for planner behavior in the crate
that no longer owns that logic and makes the next extraction steps
harder to review.

## What

Move the planner-only `spec_tests.rs` coverage into
`codex-rs/tools/src/tool_registry_plan_tests.rs` and wire it up from
`codex-rs/tools/src/tool_registry_plan.rs` using the crate-local `#[path
= "tool_registry_plan_tests.rs"] mod tests;` pattern.

The `codex-core` test file now keeps the core-side integration checks:
router-visible model tool lists, namespaced handler alias registration,
shell adapter behavior, and MCP schema edge cases that still exercise
the `core` binding layer.

## Verification

- `cargo test -p codex-tools`
- `cargo test -p codex-core tools::spec::tests`
2026-04-02 00:26:51 -07:00
Michael Bolin
127d60b2bd Merge dadfca7a94 into sapling-pr-archive-bolinfest 2026-04-02 00:18:33 -07:00
Michael Bolin
dadfca7a94 Move tool registry plan tests into codex-tools 2026-04-02 00:18:27 -07:00
Michael Bolin
828b837235 Extract tool registry planning into codex-tools (#16513)
## Why
This is a larger step in the `codex-core` -> `codex-tools` migration
called out in `AGENTS.md`.

`codex-rs/core/src/tools/spec.rs` had become mostly pure tool-spec
assembly plus handler registration. That made it hard to move more of
the tool-definition layer into `codex-tools`, because the runtime
binding and the crate-independent planning logic were still interleaved
in one function.

Splitting those concerns gives `codex-tools` ownership of the
declarative registry plan while keeping `codex-core` responsible for
instantiating concrete handlers.

## What Changed
- Add a `codex-tools` registry-plan layer in
`codex-rs/tools/src/tool_registry_plan.rs` and
`codex-rs/tools/src/tool_registry_plan_types.rs`.
- Move feature-gated tool-spec assembly, MCP/dynamic tool conversion,
tool-search aliases, and code-mode nested-plan expansion into
`codex-tools`.
- Keep `codex-rs/core/src/tools/spec.rs` as the core-side adapter that
maps each planned handler kind to concrete runtime handler instances.
- Update `spec_tests.rs` to import the moved `codex_tools` symbols
directly instead of relying on top-level `spec.rs` re-exports.

This is intended to be a straight refactor with no behavior change and
no new test surface.

## Verification
- `cargo test -p codex-tools`
- `cargo test -p codex-core tools::spec::tests`

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/16513).
* #16521
* __->__ #16513
2026-04-02 00:18:18 -07:00
Michael Bolin
97992df196 Merge fedd450c2a into sapling-pr-archive-bolinfest 2026-04-02 00:17:16 -07:00
Michael Bolin
fedd450c2a config: move core config types into codex-config 2026-04-02 00:17:12 -07:00
Michael Bolin
f7f2efec71 Merge f3d181e256 into sapling-pr-archive-bolinfest 2026-04-02 00:13:06 -07:00
Michael Bolin
f3d181e256 config: move core config types into codex-config 2026-04-02 00:12:41 -07:00
Michael Bolin
6509f018c1 merge commit for archive created by Sapling 2026-04-01 23:55:59 -07:00
Michael Bolin
a826920cd3 Move tool registry plan tests into codex-tools 2026-04-01 23:55:49 -07:00
Michael Bolin
f1cc81fbc5 Extract tool registry planning into codex-tools 2026-04-01 23:55:49 -07:00
Michael Bolin
bec1ea6330 merge commit for archive created by Sapling 2026-04-01 23:48:57 -07:00
Michael Bolin
9a207b21cf Extract tool registry planning into codex-tools 2026-04-01 23:48:05 -07:00
Michael Bolin
3893453a9d Merge 98eb3a70d2 into sapling-pr-archive-bolinfest 2026-04-01 23:38:05 -07:00
Michael Bolin
98eb3a70d2 core: prune low-value tests 2026-04-01 23:38:00 -07:00
Michael Bolin
a300284397 merge commit for archive created by Sapling 2026-04-01 23:36:01 -07:00
Michael Bolin
52e779d35d fix: add update to Cargo.lock that was missed in #16512 (#16516)
This PR updates `Cargo.lock` to remove `codex-core` from
`mcp_test_support`, which corresponds to
`codex-rs/mcp-server/tests/common/Cargo.toml`. As noted in #16512, it
updated that crate to drop its `codex-core` dependency.
2026-04-01 23:33:41 -07:00
Michael Bolin
f8e5441897 core: prune low-value tests 2026-04-01 23:31:32 -07:00
Michael Bolin
8a74713f06 Merge bdfec7fe7f into sapling-pr-archive-bolinfest 2026-04-01 23:25:54 -07:00
Michael Bolin
bdfec7fe7f fix: add update to Cargo.lock that was missed in #16512 2026-04-01 23:15:56 -07:00
Michael Bolin
96579cd59a Merge 8e7b90b94b into sapling-pr-archive-bolinfest 2026-04-01 23:06:56 -07:00
Michael Bolin
8e7b90b94b Extract tool registry planning into codex-tools 2026-04-01 23:06:43 -07:00
Michael Bolin
aa2403e2eb core: remove cross-crate re-exports from lib.rs (#16512)
## Why

`codex-core` was re-exporting APIs owned by sibling `codex-*` crates,
which made downstream crates depend on `codex-core` as a proxy module
instead of the actual owner crate.

Removing those forwards makes crate boundaries explicit and lets leaf
crates drop unnecessary `codex-core` dependencies. In this PR, this
reduces the dependency on `codex-core` to `codex-login` in the following
files:

```
codex-rs/backend-client/Cargo.toml
codex-rs/mcp-server/tests/common/Cargo.toml
```

## What

- Remove `codex-rs/core/src/lib.rs` re-exports for symbols owned by
`codex-login`, `codex-mcp`, `codex-rollout`, `codex-analytics`,
`codex-protocol`, `codex-shell-command`, `codex-sandboxing`,
`codex-tools`, and `codex-utils-path`.
- Delete the `default_client` forwarding shim in `codex-rs/core`.
- Update in-crate and downstream callsites to import directly from the
owning `codex-*` crate.
- Add direct Cargo dependencies where callsites now target the owner
crate, and remove `codex-core` from `codex-rs/backend-client`.
2026-04-01 23:06:24 -07:00
Michael Bolin
47bf411c68 merge commit for archive created by Sapling 2026-04-01 22:42:24 -07:00
Michael Bolin
c15c45d61b fix: eliminate re-exports in codex-rs/core/lib.rs 2026-04-01 22:42:08 -07:00
Michael Bolin
c952b73961 Merge 79da168be9 into sapling-pr-archive-bolinfest 2026-04-01 22:40:11 -07:00
Michael Bolin
79da168be9 fix: eliminate re-exports in codex-rs/core/lib.rs 2026-04-01 22:40:03 -07:00
Michael Bolin
9f71d57a65 Extract code-mode nested tool collection into codex-tools (#16509)
## Why
This is another small step in the `codex-core` -> `codex-tools`
migration described in `AGENTS.md`.

`core/src/tools/spec.rs` and `core/src/tools/code_mode/mod.rs` were both
hand-rolling the same pure transformation: convert visible `ToolSpec`s
into code-mode nested tool definitions, then sort and deduplicate by
tool name. That logic does not depend on core runtime state or handlers,
so keeping it in `codex-core` makes `spec.rs` harder to peel out later
than it needs to be.

## What Changed
- Add `collect_code_mode_tool_definitions()` to
`codex-rs/tools/src/code_mode.rs`.
- Reuse that helper from `codex-rs/core/src/tools/spec.rs` when
assembling the `exec` tool description.
- Reuse the same helper from `codex-rs/core/src/tools/code_mode/mod.rs`
when exposing nested tool metadata to the code-mode runtime.

This is intended to be a straight refactor with no behavior change and
no new test surface.

## Verification
- `cargo test -p codex-tools`
- `cargo test -p codex-core tools::spec::tests`
- `cargo test -p codex-core code_mode_only_`
2026-04-01 22:17:55 -07:00
Michael Bolin
ac776a53bc Merge 33ba279a49 into sapling-pr-archive-bolinfest 2026-04-01 21:55:35 -07:00
Michael Bolin
33ba279a49 Extract code-mode nested tool shaping into codex-tools 2026-04-01 21:55:28 -07:00
Michael Bolin
cc97982bbb core: use codex-mcp APIs directly (#16510)
## Why

`codex-mcp` already owns the shared MCP API surface, including `auth`,
`McpConfig`, `CODEX_APPS_MCP_SERVER_NAME`, and tool-name helpers in
[`codex-rs/codex-mcp/src/mcp/mod.rs`](f61e85dbfb/codex-rs/codex-mcp/src/mcp/mod.rs (L1-L35)).
Re-exporting that surface from `codex_core::mcp` gives downstream crates
two import paths for the same API and hides the real crate dependency.

This PR keeps `codex_core::mcp` focused on the local `McpManager`
wrapper in
[`codex-rs/core/src/mcp.rs`](f61e85dbfb/codex-rs/core/src/mcp.rs (L13-L40))
and makes consumers import shared MCP APIs from `codex_mcp` directly.

## What

- Remove the `codex_mcp::mcp` re-export surface from `core/src/mcp.rs`.
- Update `codex-core` internals plus `codex-app-server`, `codex-cli`,
and `codex-tui` test code to import MCP APIs from `codex_mcp::mcp`
directly.
- Add explicit `codex-mcp` dependencies where those crates now use that
API surface, and refresh `Cargo.lock`.

## Verification

- `just bazel-lock-check`
- `cargo test -p codex-core -p codex-cli -p codex-tui`
  - `codex-cli` passed.
- `codex-core` still fails five unrelated config tests in
`core/src/config/config_tests.rs` (`approvals_reviewer_*` and
`smart_approvals_alias_*`).
- A broader `cargo test -p codex-core -p codex-app-server -p codex-cli
-p codex-tui` run previously hung in `codex-app-server` test
`in_process_start_uses_requested_session_source_for_thread_start`.
2026-04-01 21:55:22 -07:00
Michael Bolin
64f745cc86 Merge f61e85dbfb into sapling-pr-archive-bolinfest 2026-04-01 21:49:23 -07:00
Michael Bolin
f61e85dbfb core: import MCP APIs from codex-mcp 2026-04-01 21:49:08 -07:00
Michael Bolin
d648014716 Merge 85b6be0503 into sapling-pr-archive-bolinfest 2026-04-01 21:46:30 -07:00
Michael Bolin
85b6be0503 Extract code-mode nested tool shaping into codex-tools 2026-04-01 21:27:03 -07:00