Add in-process app server and wire up exec to use it#14005
Add in-process app server and wire up exec to use it#14005etraut-openai merged 25 commits intomainfrom
Conversation
Add a minimal in-process runtime mode in `codex-app-server` and wire typed client request handling through `MessageProcessor` with session-source injection. This introduces startup handshake, bounded channels, typed in-process events, and shutdown behavior for embedded app-server usage. Introduce the new `codex-app-server-client` crate as the shared facade for in-process startup, request/notify APIs, typed request decoding, and server-request resolution. This centralizes client behavior for later TUI and exec migration while keeping transport-backed app-server paths intact.
Route `codex-exec` through `InProcessAppServerClient` instead of using direct `ThreadManager` and `CodexThread` wiring. This moves startup, resume, turn start, review start, interrupt, and shutdown through the app-server path while keeping existing exec behavior working under the current protocol constraints. Restore exec-specific auth and request handling needed for parity, including `CODEX_API_KEY` env loading, local handling of app-server server requests, config-aware start/resume params, scoped error tracking, and foreground-turn `Ctrl-C` interruption.
Keep `ClientRequest` request-id extraction local to `app-server` instead of extending `codex-app-server-protocol`, and remove the extra `JSONRPCErrorError` trait impls that were only needed by that drift. Add focused regression coverage for in-process lag/bootstrap handling in `codex-app-server-client` and `codex-exec` so the client contract stays explicit while protocol parity with `main` is preserved.
Cover `ClientRequest::PluginList` in `codex-rs/app-server/src/app_server_tracing.rs` so the tracing helper stays exhaustive as the app-server protocol evolves. This fixes the `codex-app-server` compile failure that was breaking `rust-ci` across the full matrix. The change is intentionally narrow: it updates the request-id extractor used by in-process tracing without changing protocol or runtime behavior.
Remove the redundant `Into::into` on `default_effort` and the needless borrows around `sandbox_policy.get()` in `codex-rs/exec/src/lib.rs`. These were the remaining `clippy` failures in the `Lint/Build` matrix after the protocol-compatibility fixes landed. The change is intentionally tiny and keeps the generated request payloads unchanged while letting `rust-ci` finish the `codex-exec` lint pass.
Extend `client_request_id` to include the v2 `command/exec/*` request variants added upstream so the rebased branch stays exhaustive and keeps compiling.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f440091d3a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c746138254
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 794087d58a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7c07f4ec8f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 29b2c65c03
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8eb062b90
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 23bb3258c3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 183e73e7ee
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b4cf3df4cf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This is a subset of PR #13636. See that PR for a full overview of the architectural change.
This PR implements the in-process app server and modifies the non-interactive "exec" entry point to use the app server.