Skip to content

cloud-tasks: split the mock client out of cloud-tasks-client#16456

Merged
bolinfest merged 1 commit intomainfrom
pr16456
Apr 1, 2026
Merged

cloud-tasks: split the mock client out of cloud-tasks-client#16456
bolinfest merged 1 commit intomainfrom
pr16456

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented Apr 1, 2026

Why

codex-cloud-tasks-client was mixing two different roles: the real HTTP client and the mock implementation used by tests and local mock mode. Keeping both in the same crate forced Cargo feature toggles and Bazel crate_features just to pick an implementation.

This change keeps codex-cloud-tasks-client focused on the shared API surface and real backend client, and moves the mock implementation into its own crate so we can remove those feature permutations cleanly.

What changed

  • add a new codex-cloud-tasks-mock-client crate that owns MockClient
  • remove the mock and online features from codex-cloud-tasks-client
  • make codex-cloud-tasks-client unconditionally depend on codex-backend-client and export HttpClient directly
  • gate the mock-mode path in codex-cloud-tasks behind #[cfg(debug_assertions)], so release builds always initialize the real HTTP client
  • update codex-cloud-tasks and its tests to use codex-cloud-tasks-mock-client::MockClient wherever mock behavior is needed
  • remove the matching Bazel crate_features override and shrink the manifest verifier allowlist accordingly

How tested

  • cargo test -p codex-cloud-tasks-client
  • cargo test -p codex-cloud-tasks-mock-client
  • cargo test -p codex-cloud-tasks

Stack created with Sapling. Best reviewed with ReviewStack.

bolinfest added a commit that referenced this pull request Apr 1, 2026
## Why

We already enforce workspace metadata and lint inheritance for
`codex-rs` manifests, but we still allow new crate features to slip into
the workspace. That makes it too easy to add more Cargo-only feature
permutations while we are trying to eliminate them.

## What changed

- extend `verify_cargo_workspace_manifests.py` to reject new
`[features]` tables in workspace crates
- reject new optional dependencies that create implicit crate features
- reject new workspace-to-workspace `features = [...]` activations and
`default-features = false`
- add a narrow temporary allowlist for the existing feature-bearing
manifests and internal feature activations
- make the allowlist self-shrinking so a follow-up removal has to delete
its corresponding exception


---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/16455).
* #16457
* #16456
* __->__ #16455
Base automatically changed from pr16455 to main April 1, 2026 18:06
@bolinfest bolinfest force-pushed the pr16456 branch 2 times, most recently from c042246 to 65ed50f Compare April 1, 2026 18:37
@bolinfest bolinfest changed the title cloud-tasks: remove cloud-tasks-client crate features cloud-tasks: split the mock client out of cloud-tasks-client Apr 1, 2026
## Why

`codex-cloud-tasks-client` was still using Cargo features to select its HTTP and mock implementations. That leaks feature permutations into both Cargo and Bazel for a crate that does not need them.

## What changed

- delete the `online` and `mock` crate features from `codex-cloud-tasks-client`
- make `codex-backend-client` unconditional and always export both `HttpClient` and `MockClient`
- remove the internal `features = ["mock", "online"]` activation from `codex-cloud-tasks`
- remove the matching Bazel `crate_features` override
- shrink the manifest verifier allowlist to match the remaining exceptions
@bolinfest bolinfest merged commit 9f0be14 into main Apr 1, 2026
39 of 49 checks passed
@bolinfest bolinfest deleted the pr16456 branch April 1, 2026 19:09
@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant