Streamline thread resume and fork handlers#19495
Merged
pakrym-oai merged 2 commits intomainfrom Apr 27, 2026
Merged
Conversation
f0dde8e to
7799914
Compare
58cf3c8 to
5308b02
Compare
7799914 to
fd812db
Compare
a548a0f to
d8792fc
Compare
a48337c to
cdb702f
Compare
d8792fc to
67e573a
Compare
cdb702f to
eea7c29
Compare
67e573a to
9dfa99f
Compare
9dfa99f to
eaf38ae
Compare
820705f to
5b5b247
Compare
eaf38ae to
13117fc
Compare
5b5b247 to
eb6945d
Compare
13117fc to
8053487
Compare
eb6945d to
d75151a
Compare
0f3ad06 to
c55f80b
Compare
d75151a to
0a6b2e1
Compare
c55f80b to
b236a5e
Compare
## Why The MCP request handlers had repeated local JSON-RPC error emission around validation and manager calls. Returning those errors directly makes the normal response path much easier to scan. ## What Changed - Streamlined model list, experimental feature list, MCP refresh, status, OAuth, resource read, and tool call handlers in `codex-rs/app-server/src/codex_message_processor.rs`. - Kept existing error codes and messages while replacing nested `send_error`/`return` branches with returned JSON-RPC errors where that flattens control flow. - Preserved MCP tool-call metadata behavior. ## Verification - `cargo check -p codex-app-server` - `cargo test -p codex-app-server --test all v2::mcp_resource -- --test-threads=1` - `cargo test -p codex-app-server --test all v2::mcp_tool -- --test-threads=1` - `cargo test -p codex-app-server --test all v2::mcp_server_status -- --test-threads=1`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Thread resume and fork had some of the deepest error-handling indentation in this area because helpers emitted request errors directly. Returning those failures gives the handlers a single request boundary while preserving the async pending-resume behavior.
What Changed
codex-rs/app-server/src/codex_message_processor.rsto returnResultvalues for validation and view loading failures.Verification
cargo check -p codex-app-servercargo test -p codex-app-server --test all v2::thread_resume -- --test-threads=1cargo test -p codex-app-server --test all v2::thread_fork -- --test-threads=1