feat(AIC-3439): let wildcard handlers accept only named providers - #136
andrewklatzke wants to merge 1 commit into
Conversation
A LangChain adapter used for one provider no longer has to match every provider, and two scoped wildcards of the same mode can be registered together. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Human message: I think this is a "nice to have" not necessarily "must do it". I'm thinking of situations where, for example, a user might want to use the Google ADK and scope it only to gemini ( You can technically achieve this now by properly including the right subset of handlers, but this makes it more obvious/colocates it with the code if you want to scope them down. tldr; if we think this is confusing or don't want it, we can close it |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ee8f6f0. Configure here.
| else: | ||
| # No compatible handler — skip rather than calling a provider | ||
| # whose allowlist does not include this judge. | ||
| continue |
There was a problem hiding this comment.
Untyped parent judges now skipped
Medium Severity
The new else: continue skips a judge when _provider_matches is false, and that helper is false whenever the parent has no provides_for. A plain callable that routes itself used to run the judge via the default judge_handler = handler assignment. Evaluations still treat a missing provides_for as covering every judge, so graph() with a single untyped handler now drops configured judges with no error.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit ee8f6f0. Configure here.


Summary
providerslist, so a LangChain adapter used only for Bedrock acceptsconfig.provider.name == "Bedrock"and no other provider.[provider, mode]still wins. Among scoped wildcards that contain the name, the shortest list wins, then the earlier registration. An unscoped*is the fallback.provides_forplus the provider set, so two scoped wildcards of the same mode can be registered together. Judges, graph selection, and the evaluations runner use the same order.Test plan
uv run pyteston the client, langchain-messages, and langchain-agents suitesruffandmypyon the touched packagesMade with Cursor