Repository navigation
refactor(litellm_ai_handler): deduplicate config coercion, API key capture, and AWS region resolution - #3320
Conversation
… scope Move the _as_int and _as_list helpers out of the OpenRouter extra-body builder and next to the existing module-level _as_bool, dropping the duplicated nested _as_bool with passing default=True
PR Summary by QodoDeduplicate LiteLLM configuration and credential resolution
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1.
|
…lm_ai_handler Fix conflict by accepting our changes Conflicts: pr_agent/algo/ai_handlers/litellm_ai_handler.py
|
Code review by qodo was updated up to the latest commit f4fe817 |
the latest main branch no more used this function
|
Code review by qodo was updated up to the latest commit 0d3fe3a |
|
Even after merging the latest main branch all test still passible PYTHONPATH=. uv run pytest tests/unittest
7829 passed, 33 skipped, 1 xfailed, 829 warnings in 51.22suv run ruff check --fix pr_agent/algo/ai_handlers/litellm_ai_handler.py
All checks passed!uv run pre-commit run --files pr_agent/algo/ai_handlers/litellm_ai_handler.py
check for added large files..............................................Passed
check python ast.........................................................Passed
check for case conflicts.................................................Passed
check json...........................................(no files to check)Skipped
check for merge conflicts................................................Passed
check toml...........................................(no files to check)Skipped
check yaml...........................................(no files to check)Skipped
check illegal windows names..........................(no files to check)Skipped
check for broken symlinks............................(no files to check)Skipped
debug statements (python)................................................Passed
detect destroyed symlinks................................................Passed
fix end of files.........................................................Passed
mixed line ending........................................................Passed
trim trailing whitespace.................................................Passed
Lint GitHub Actions workflow files...................(no files to check)Skipped
ruff check...............................................................Passed |
IsmaelMartinez
left a comment
There was a problem hiding this comment.
Thanks for the tidy-up, and for folding Qodo's _as_int point into the same commit.
Checked behaviour rather than shape: the OpenRouter controls, the AWS credential precedence and the per-provider key capture give identical results on main and on this branch across every input combination I could construct, and the full suite is exactly baseline.
Approving now that CI has run.
|
Thank you so much for your review and approve! |
What
Refactoring for
pr_agent/algo/ai_handlers/litellm_ai_handler.py.Duplication removal and extraction.
Changes
_as_bool) and move (_as_intand_as_list) as class-wise helperUnit Test and Lint
PYTHONPATH=. uv run pytest tests/unittest 7745 passed, 33 skipped, 1 xfailed, 829 warnings in 56.98suv run ruff check --fix pr_agent/algo/ai_handlers/litellm_ai_handler.py All checks passed!