fix: redirect tracing logs to stderr for stdio mode compatibility#69
Merged
Conversation
When tracing_subscriber::fmt::Layer writes to stdout by default, the four startup log lines intermix with the JSON-RPC message stream in stdio mode, causing the rmcp client to fail parsing and the handshake to disconnect. Add .with_writer(std::io::stderr) to the default fmt_layer!() branch so stdout stays clean (JSON-RPC only) and all logs go to stderr. Also improve unit test coverage across cache, config, server, tools, and utils modules with additional edge-case and branch tests. Constraint: stdio transport requires stdout to be JSON-RPC-only Rejected: redirecting via subscriber filter alone | does not change writer target Confidence: high Scope-risk: narrow Tested: cargo fmt --check, existing tests pass, new tests added Not-tested: end-to-end stdio session with rmcp client
Owner
Author
|
ProviderModelNotFoundError |
Remove unused imports EnvServerConfig and LoggingConfig from
tests/unit/config_tests.rs top-level import (each used only inside
function-local use statements).
Update rustls-webpki 0.103.10 -> 0.103.13 to fix RUSTSEC-2026-0104,
RUSTSEC-2026-0098, and RUSTSEC-2026-0099.
Constraint: CI requires cargo clippy -D warnings and cargo audit to pass
Confidence: high
Scope-risk: narrow
Tested: cargo clippy --all-targets -- -D warnings,
cargo clippy --all-features --all-targets -- -D warnings,
cargo audit (exit 0, rustls-webpki vulns resolved)
Owner
Author
|
ProviderModelNotFoundError |
Replace sort_by with sort_by_key using std::cmp::Reverse for the same
descending-length ordering, fixing clippy::unnecessary_sort_by.
Constraint: CI requires cargo clippy -D warnings
Confidence: high
Scope-risk: narrow
Tested: cargo clippy --all-targets -- -D warnings,
cargo clippy --all-features --all-targets -- -D warnings
Owner
Author
|
ProviderModelNotFoundError |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
When using stdio transport mode,
tracing_subscriber::fmt::Layerwrites to stdout by default. The four startup log lines get mixed into the JSON-RPC message stream, causing the rmcp client to fail parsing and the handshake to disconnect.Fix
Add
.with_writer(std::io::stderr)to the defaultfmt_layer!()branch so stdout stays clean (JSON-RPC only) and all logs go to stderr.Changes
src/lib.rs.with_writer(std::io::stderr)to defaultfmt_layer!()tests/unit/*.rsVerification
cargo fmt --checkpassescargo clippy --all-features --all-targets -- -D warningspassescargo test --test unitpasses (including new tests)