Repository navigation
refactor(cloud_auth): deduplicate repeated logic - #3607
Conversation
PR Summary by QodoDeduplicate cloud authentication helper logic
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require review
Tip of the day💡 Did you know, you can route each action level your way: inline, summary, both, or drop |
IsmaelMartinez
left a comment
There was a problem hiding this comment.
Thanks for keeping both extractions this tight. Approving: they are behaviour-preserving.
I rebuilt each rebind the old way and the new way and compared __code__, __name__, __defaults__, __kwdefaults__, __closure__, __qualname__ and __dict__. Identical, and the kwdefaults copy is still a copy rather than the native dict. The signature guard raises the same RuntimeError with the same message.
Coverage over the existing suite reaches all four rebind call sites and both guard call sites, so this is exercised rather than merely compiling.
What
claude_auth.py.Changes
Each commit extracts one helper and updates its call sites:
_rebind_to_globals(native, native_globals)FunctionTyperebind plus__kwdefaults__copy (Azure OIDC token exchange, theentracompanion factory,resolve_captured,initialize)_require_http_auth_signature(original)api_key/headers/litellm_paramsparameter check guardingvalidate_environmentTesting
PYTHONPATH=. uv run pytest tests/unittest ================== 9193 passed, 33 skipped, 1 xfailed, 833 warnings in 74.94s (0:01:14) ==================uv run ruff check pr_agent/algo/ai_handlers/cloud_auth.py All checks passed!