Repository navigation
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@connor4312 is on triage rotation this week and is the reviewer for this one. Labels come from the PR labeler. Please review the change. Automated triage. Labels are a first pass and the assigned maintainer has the final say. |
jokemanfire
left a comment
There was a problem hiding this comment.
Verified at head 99c900a3, base c78f2764.
- base + the new test file -> compile error
E0599: no method named max_line_length(the entry point genuinely does not exist yet) - head ->
cargo test -p rmcp --features client,transport-child-process --test test_child_process_max_line_length= 3 passed, including the line above the 16 MiB default cargo fmt --all -- --checkclean
Read the wiring: the new field defaults to DEFAULT_MAX_LINE_LENGTH, is forwarded to AsyncRwTransport::new(...).with_max_line_length(...) in spawn(); TokioChildProcess::new is untouched. Only the stdout transport is a read path, so applying it there is the complete change. The shell-generated child avoids argv limits, which is why the 16 MiB case works.
One nit, not blocking: max_line_length(0) is accepted, and then every line is discarded and receive() never yields a message, which looks identical to a server that sends nothing. Either document "must be greater than zero" or clamp/assert in the setter. The doc pointer to with_max_line_length also carries the usize::MAX unbounded note, so callers can find it.
The remaining half of #1513 (failing the pending request instead of waiting for the timeout) is correctly deferred to the #1471 shape.
|
Thanks for checking. Zero comes from with_max_line_length on the underlying transport, which accepts it the same way. Added "must be greater than zero" to the doc comment on both setters. |
Part of #1513
Problem
TokioChildProcessreads the child's stdout throughAsyncRwTransportwith the default 16 MiB line limit, and the builder gives no way to change it. A client that expects larger responses from a stdio server can't raise the limit.Change
TokioChildProcessBuilder::max_line_length(usize)sets the limit on the child's stdout transport (AsyncRwTransport::with_max_line_length). The default staysDEFAULT_MAX_LINE_LENGTH.TokioChildProcess::newis unchanged.The other half of #1513, failing the pending request right away instead of waiting for the timeout, needs the request id from the dropped line, so it fits after #1471.
Tests
crates/rmcp/tests/test_child_process_max_line_length.rs(unix): a child prints a notification of a given size and then a short one.max_line_length(1024): the 4 KB line is dropped and the short one still arrivesmax_line_length(DEFAULT_MAX_LINE_LENGTH + 2048): a line over 16 MiB arrivescargo +nightly fmt --all -- --check,cargo clippy --all-targets --all-features -- -D warningsandcargo test -p rmcp --all-features --libpass.This PR was written primarily by Claude Code.