Commit Graph
10951 Commits
Author SHA1 Message Date
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 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`](https://github.com/openai/codex/blob/f61e85dbfb5373cde6827d232ac8ea447c237e81/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`](https://github.com/openai/codex/blob/f61e85dbfb5373cde6827d232ac8ea447c237e81/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
Michael Bolin 1b5a16f05e Extract request_user_input normalization into codex-tools (#16503)
## Why
This is another incremental step in the `codex-core` -> `codex-tools`
migration called out in `AGENTS.md`: keep pure tool-definition and
wire-shaping logic out of `codex-core` so the core crate can stay
focused on runtime orchestration.

`request_user_input` already had its spec and mode-availability helpers
in `codex-tools` after #16471. The remaining argument validation and
normalization still lived in the core runtime handler, which left that
tool split across the two crates.

## What Changed
- Export `REQUEST_USER_INPUT_TOOL_NAME` and
`normalize_request_user_input_args()` from
`codex-rs/tools/src/request_user_input_tool.rs`.
- Use that `codex-tools` surface from `codex-rs/core/src/tools/spec.rs`
and `codex-rs/core/src/tools/handlers/request_user_input.rs`.
- Keep the core handler responsible for payload parsing, session
dispatch, cancellation handling, and response serialization.

This is intended to be a straight refactor with no behavior change.

## Verification
- `cargo test -p codex-tools`
- `cargo test -p codex-core request_user_input`
2026-04-01 21:18:45 -07:00
Michael Bolin 7c1c633f3f core: use codex-tools config types directly (#16504)
## Why

`codex-rs/tools/src/lib.rs` already defines the [canonical `codex_tools`
export
surface](https://github.com/openai/codex/blob/bf081b9e286e620d25c1d61cf0f38f74a0f982ce/codex-rs/tools/src/lib.rs#L83-L88)
for `ToolsConfig`, `ToolsConfigParams`, and the shell backend config
types. Re-exporting those same types from `core/src/tools/spec.rs` gives
`codex-core` two import paths for one API and blurs which crate owns
those config definitions.

This PR removes that duplicate path so `codex-core` callsites depend on
`codex_tools` directly.

## What

- Remove the five `codex_tools` re-exports from
`core/src/tools/spec.rs`.
- Update `codex-core` production and test callsites to import
`ShellCommandBackendConfig`, `ToolsConfig`, `ToolsConfigParams`,
`UnifiedExecShellMode`, and `ZshForkConfig` from `codex_tools`.

## Verification

- Ran `cargo test -p codex-core`.
- The package run is currently red in five unrelated config tests in
`core/src/config/config_tests.rs` (`approvals_reviewer_*` and
`smart_approvals_alias_*`), while the tool/spec and shell tests touched
by this import cleanup passed.
2026-04-01 21:16:44 -07:00
Eric Traut e19b351364 Fix paste-driven bottom pane completion teardown (#16202)
Fix paste-driven bottom-pane completion teardown (#16192)

`BottomPane::handle_paste()` could leave a completed modal flow mounted
while re-enabling the composer, putting the TUI in an inconsistent state
where stale views could still affect rendering and input routing. Align
the paste path with the existing key-driven completion logic by tearing
down the active modal flow before restoring composer input, and add a
regression test covering the stacked-view case that exposed the bug.

Big thanks to @iqdoctor for identifying the root cause for this issue.
2026-04-01 22:03:13 -06:00