Skip to content

Streamline thread resume and fork handlers#19495

Merged
pakrym-oai merged 2 commits intomainfrom
pakrym/appserver-errors-thread-resume-fork
Apr 27, 2026
Merged

Streamline thread resume and fork handlers#19495
pakrym-oai merged 2 commits intomainfrom
pakrym/appserver-errors-thread-resume-fork

Conversation

@pakrym-oai
Copy link
Copy Markdown
Collaborator

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

  • Converted thread resume helpers in codex-rs/app-server/src/codex_message_processor.rs to return Result values for validation and view loading failures.
  • Applied the same pattern to thread fork request handling.
  • Simplified pending resume error construction by using the shared JSON-RPC error helpers.

Verification

  • cargo check -p codex-app-server
  • cargo test -p codex-app-server --test all v2::thread_resume -- --test-threads=1
  • cargo test -p codex-app-server --test all v2::thread_fork -- --test-threads=1

@pakrym-oai pakrym-oai force-pushed the pakrym/appserver-errors-thread-read branch from f0dde8e to 7799914 Compare April 25, 2026 03:09
@pakrym-oai pakrym-oai force-pushed the pakrym/appserver-errors-thread-resume-fork branch from 58cf3c8 to 5308b02 Compare April 25, 2026 03:09
@pakrym-oai pakrym-oai marked this pull request as ready for review April 25, 2026 04:00
@pakrym-oai pakrym-oai force-pushed the pakrym/appserver-errors-thread-read branch from 7799914 to fd812db Compare April 25, 2026 04:10
@pakrym-oai pakrym-oai force-pushed the pakrym/appserver-errors-thread-resume-fork branch 2 times, most recently from a548a0f to d8792fc Compare April 25, 2026 04:15
@pakrym-oai pakrym-oai force-pushed the pakrym/appserver-errors-thread-read branch 2 times, most recently from a48337c to cdb702f Compare April 26, 2026 23:08
@pakrym-oai pakrym-oai force-pushed the pakrym/appserver-errors-thread-resume-fork branch from d8792fc to 67e573a Compare April 26, 2026 23:08
@pakrym-oai pakrym-oai force-pushed the pakrym/appserver-errors-thread-read branch from cdb702f to eea7c29 Compare April 26, 2026 23:15
@pakrym-oai pakrym-oai force-pushed the pakrym/appserver-errors-thread-resume-fork branch from 67e573a to 9dfa99f Compare April 26, 2026 23:15
@pakrym-oai pakrym-oai force-pushed the pakrym/appserver-errors-thread-resume-fork branch from 9dfa99f to eaf38ae Compare April 27, 2026 17:22
@pakrym-oai pakrym-oai force-pushed the pakrym/appserver-errors-thread-read branch from 820705f to 5b5b247 Compare April 27, 2026 18:45
@pakrym-oai pakrym-oai force-pushed the pakrym/appserver-errors-thread-resume-fork branch from eaf38ae to 13117fc Compare April 27, 2026 18:45
@pakrym-oai pakrym-oai force-pushed the pakrym/appserver-errors-thread-read branch from 5b5b247 to eb6945d Compare April 27, 2026 20:38
@pakrym-oai pakrym-oai force-pushed the pakrym/appserver-errors-thread-resume-fork branch from 13117fc to 8053487 Compare April 27, 2026 20:38
@pakrym-oai pakrym-oai force-pushed the pakrym/appserver-errors-thread-read branch from eb6945d to d75151a Compare April 27, 2026 21:01
@pakrym-oai pakrym-oai force-pushed the pakrym/appserver-errors-thread-resume-fork branch 2 times, most recently from 0f3ad06 to c55f80b Compare April 27, 2026 21:19
@pakrym-oai pakrym-oai force-pushed the pakrym/appserver-errors-thread-read branch from d75151a to 0a6b2e1 Compare April 27, 2026 21:19
Base automatically changed from pakrym/appserver-errors-thread-read to main April 27, 2026 21:30
@pakrym-oai pakrym-oai force-pushed the pakrym/appserver-errors-thread-resume-fork branch from c55f80b to b236a5e Compare April 27, 2026 21:31
## 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`
@pakrym-oai pakrym-oai merged commit 739ab6b into main Apr 27, 2026
25 checks passed
@pakrym-oai pakrym-oai deleted the pakrym/appserver-errors-thread-resume-fork branch April 27, 2026 22:04
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 27, 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