Skip to content

[codex] Remove async_trait from first-party code - #27475

Merged
anp-oai merged 2 commits into
mainfrom
codex/remove-async-trait-or-cancel-ext
Jun 12, 2026
Merged

[codex] Remove async_trait from first-party code#27475
anp-oai merged 2 commits into
mainfrom
codex/remove-async-trait-or-cancel-ext

Conversation

@anp-oai

@anp-oai anp-oai commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Why

First-party async traits should expose their Send contracts explicitly without requiring async_trait. This completes the migration pattern established in #27303 and #27304.

What changed

  • Replaced the remaining first-party async_trait traits with native return-position impl Future + Send where statically dispatched and explicit boxed Send futures where object safety is required.
  • Kept implementations behavior-preserving, outlining existing async bodies into inherent methods where that keeps the diff reviewable.
  • Removed all direct first-party async-trait dependencies and the workspace dependency declaration.
  • Added a cargo-deny policy that permits async-trait only through the remaining transitive wrapper crates.
  • Updated rand from 0.8.5 to 0.8.6 to resolve RUSTSEC-2026-0097 and keep the full cargo-deny check passing.

Validation

  • just test -p codex-exec-server: 216 passed, 2 skipped.
  • just test -p codex-model-provider: 39 passed.
  • just test -p codex-core and just test: changed tests passed; remaining failures are environment-sensitive suites unrelated to this migration.
  • cargo deny check
  • just fix
  • just fmt
  • cargo shear
  • just bazel-lock-check

@anp-oai
anp-oai marked this pull request as ready for review June 10, 2026 21:31
@anp-oai
anp-oai force-pushed the codex/remove-async-trait-or-cancel-ext branch 2 times, most recently from 040f405 to 8032d71 Compare June 10, 2026 22:31
@anp-oai anp-oai changed the title [codex] Remove async_trait from OrCancelExt [codex] Remove async_trait from utility traits Jun 10, 2026
@anp-oai
anp-oai force-pushed the codex/remove-async-trait-or-cancel-ext branch from 8032d71 to 6234049 Compare June 11, 2026 18:32
@anp-oai
anp-oai requested a review from a team as a code owner June 11, 2026 18:32
@anp-oai anp-oai changed the title [codex] Remove async_trait from utility traits [codex] Remove async_trait from first-party code Jun 11, 2026
@anp-oai
anp-oai force-pushed the codex/remove-async-trait-or-cancel-ext branch from 6234049 to 933139a Compare June 11, 2026 18:47

@bolinfest bolinfest left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for getting this cleanup over the finish line!

Comment thread codex-rs/app-server/src/mcp_refresh.rs Outdated
@anp-oai
anp-oai force-pushed the codex/remove-async-trait-or-cancel-ext branch 5 times, most recently from 968c1a4 to d97ca26 Compare June 11, 2026 23:35
anp-oai added 2 commits June 12, 2026 00:15
Use native async trait return types where possible and explicit boxed futures for object-safe traits. Remove all direct first-party async-trait dependencies.
@anp-oai
anp-oai force-pushed the codex/remove-async-trait-or-cancel-ext branch from d97ca26 to 4df5f02 Compare June 12, 2026 00:16
@anp-oai
anp-oai merged commit 5a56caf into main Jun 12, 2026
46 checks passed
@anp-oai
anp-oai deleted the codex/remove-async-trait-or-cancel-ext branch June 12, 2026 01:16
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 12, 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.

2 participants