refactor(server): move content-parse adapter into tools#376
Merged
randomparity merged 1 commit intoMay 29, 2026
Conversation
`mcp/content.rs` held async wrappers over `rimap_content::parse_message` (`parse_message_async`, `walk_attachment_parts_async`, `classify_content_error`) guarded by `PARSE_SEMAPHORE`. It touches no JSON-RPC, catalog, audit, or wire concern and is consumed only by `crate::tools::retrieval`, so it belonged under `tools`, not the protocol layer. Relocate it to `crate::tools::content_parse` (pure `git mv`), narrow the module to `pub(crate)` since every caller is in-crate, and repoint `fetch_message` and `download_attachment`. The shared `spawn_blocking_panic_error` helper stays in `mcp` — `audit_envelope` and `tools::retrieval::sandbox` also use it. Its now-stale "every mcp/* wrapper" doc and the moved file's bare intra-doc link to it are updated. Closes #332
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.
mcp/content.rsheld the async wrappers overrimap_content::parse_message(parse_message_async,walk_attachment_parts_async,classify_content_error) guarded byPARSE_SEMAPHORE. It touches no JSON-RPC, catalog, audit, or wire concern and is consumed only bycrate::tools::retrieval, so it belonged undertools, not the protocol layer.This relocates it to
crate::tools::content_parse(puregit mv, zero content change), narrows the module topub(crate)since every caller is in-crate, and repointsfetch_messageanddownload_attachment.The shared
spawn_blocking_panic_errorhelper stays inmcp—audit_envelopeandtools::retrieval::sandboxalso use it. Its now-stale "everymcp/*wrapper" doc and the moved file's bare intra-doc link to it (which would otherwise become an unresolved-linkcargo docwarning after the move) are updated to the qualified path.Verification:
cargo clippy -p rimap-server --all-targets --all-featurescleancargo doc --no-deps --document-private-itemsintroduces no new warningscontent_parseunit tests passCloses #332
🤖 Generated with Claude Code