Immutable transform wrapping for providers#2913
Conversation
Extract _WrappedProvider from base.py into wrapped_provider.py for better file organization.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f8c61ace12
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughAggregateProvider is now exposed publicly and enhanced to support adding providers via add_provider(provider, *, namespace: str = ""), with internal storage renamed from Possibly related PRs
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Apply tool renames before namespace so they're scoped to the mounted provider only. This prevents renames from leaking to other providers' tools when mounting without a namespace. Order is now: rename → namespace (so foo → bar with namespace="x" → x_bar)
Providers can now be wrapped with transforms immutably via
wrap_transform(), enabling the same provider instance to be used in multiple aggregators with different namespaces.Key changes:
Provider.wrap_transform(transform)returns a new_WrappedProviderthat layers the transform on top without mutating the originalAggregateProvidersimplified to a plain.providerslist, usingwrap_transform(Namespace(...))for namespacingFastMCPProviderwhen added to an aggregator (prevents accidentally bypassing middleware)AggregateProvider, removing duplicate aggregation logic