fix: gate Error::invalid_argument on the module feature - #38
Conversation
The `invalid_argument` constructor is only used by the TinyBus adapter, which is compiled only when the `module` feature is enabled. Adding a `#[cfg]` attribute prevents a dead-code warning or unused function error in builds without that feature. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Without the module feature nothing constructs InvalidArgument, so the constructor tripped dead_code. Compile it only with the adapter (and tests). Co-authored-by: Medulla <medulla@tinyhumans.ai>
Tiny Sweeper reviewTiny Sweeper reviewed this change across 6 lane(s) and found 0 active actionable finding(s). Detailed lane evidence and any incomplete work are listed below. State: Incomplete Review snapshot
Completeness: Incomplete What changedThe review could not produce a supported behavioral summary; inspect the cited changed surface and lane details below. FeaturesNone identified with supported citations. TestsNo supported feature-to-test mapping was produced. Test execution is not inferred. FindingsNo active actionable findings. Could not review: crates/tinymcp/src/error/mod.rs Before merge
How this fits togetherflowchart LR
n0["Error<br/>changed"]:::changed
n1["one_of_every_variant"]:::impacted
n2["assorted_other_errors"]:::impacted
n3["Result"]:::impacted
n4["oauth_challenge_error"]:::impacted
n5["bare_unauthorized_error"]:::impacted
n6["invalid_argument"]:::impacted
n1 -->|uses| n0
n1 -->|calls| n2
n1 -->|calls| n4
n1 -->|calls| n6
n2 -->|uses| n0
n3 -->|uses| n0
n4 -->|uses| n0
n5 -->|uses| n0
classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Agent review detailscritique
security
tests
commits
description
e2e
Evidence and run details
|
Codex Review SummaryThis 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. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe crate-private ChangesError constructor gating
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~3 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The constructor remains available to the module and test code that use it, while being omitted from builds that need neither. No actionable merge risk was identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
A rabbit checks the error gate, Comment |
There was a problem hiding this comment.
tinysweeper found nothing blocking, but could not review everything, so this is not an approval: crates/tinymcp/src/error/mod.rs.
$0.0018 · 13,808 in / 5,603 out · 5,632 cached (41%) · deepseek/deepseek-v4-flash
tests: $0.0012 · 9,110 in / 3,627 out · 3,840 cached (42%) · deepseek/deepseek-v4-flash
description: $0.0003 · 3,310 in / 689 out · 1,280 cached (39%) · deepseek/deepseek-v4-flash
Fixes the dead_code warning for
Error::invalid_argumentin builds without themodulefeature (its only non-test callers are in the TinyBus adapter). Compiled underany(feature = "module", test); no#[allow]. Default and all-features clippy on the workspace is clean; no-default-features lib tests pass (732).Summary by CodeRabbit