-
Notifications
You must be signed in to change notification settings - Fork 436
Fix: correctly pass api_base and add --max-run-time CLI argument in main_full_repo #319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
@cuso4huang Thank you for putting this PR and issue together. Are you able to post a sample run output from the command line (including the command that you used to run this)? |
Hi,this is the result (qodo) cuso4@cuso4 qodo-cover (main) $ poetry run cover-agent-full-repo \
--project-language="python" \
--project-root="/home/cuso4/qodo-cover/templated_tests/python_fastapi" \
--code-coverage-report-path="/home/cuso4/qodo-cover/templated_tests/python_fastapi/coverage.xml" \
--test-command="coverage run -m pytest /home/cuso4/qodo-cover/templated_tests/python_fastapi/tests --cov=/home/cuso4/qodo-cover/templated_tests/python_fastapi/app --cov-report=xml --cov-report=term" \
--model="openai/deepseek-chat" \
--api-base="https://api.deepseek.com"
============
Test files to be extended:
/home/cuso4/qodo-cover/templated_tests/python_fastapi/tests/test_app.py
============
Initializing language server...
LSP server initialized.
/home/cuso4/miniconda3/envs/qodo/lib/python3.11/site-packages/tree_sitter/__init__.py:36: FutureWarning: Language(path, name) is deprecated. Use Language(ptr, name) instead.
warn("{} is deprecated. Use {} instead.".format(old, new), FutureWarning)
Context files for test file '/home/cuso4/qodo-cover/templated_tests/python_fastapi/tests/test_app.py':
/home/cuso4/qodo-cover/templated_tests/python_fastapi/app/app.py
Analyzing test file against context files...
Printing results from LLM model...
is_this_a_unit_test: 1
main_file: |
app/app.py Test file:
2025-04-24 09:38:39,672 - cover_agent.UnitTestValidator - INFO - Running build/test command to generate coverage report: "coverage run -m pytest tests/test_app.py --cov=/home/cuso4/qodo-cover/templated_tests/python_fastapi/app --cov-report=xml --cov-report=term"
|
@cuso4huang we're ready to merge but I see there are conflicts. Can you rebase and resolve please? |
Sorry @cuso4huang can you rebase once more? You’re next in the queue. |
@cuso4huang Thanks for the rebase. I am noticing that the unit tests are failing. Did you take a look after rebasing? |
User description
What this PR does
This PR fixes two issues encountered when running the
main_full_repo
entry point:api_base
not passed toAICaller
:The CLI argument
--api_base
was accepted but never passed intoAICaller
, making it ineffective.✅ Fixed by modifying the initialization of
AICaller
to includeapi_base
.Missing
--max-run-time
argument:The CLI argument parser
parse_args_full_repo
did not include--max-run-time
, which led to runtime errors like:'Namespace' object has no attribute 'max_run_time'
✅ Added the missing argument to
argparse
.Optionally, I also added
max_tokens
manually to theAICaller
init call with a default value (8192
) to avoid instantiation errors.Suggested labels:
bug
,CLI
,enhancement
Let me know if any changes are needed — happy to update!
PR Type
Bug fix, Enhancement
Description
Fixed missing
api_base
argument inAICaller
initialization.Added
--max-run-time
argument to CLI parser with default value.Set default
max_tokens
value inAICaller
initialization.Changes walkthrough 📝
main_full_repo.py
Fix `AICaller` initialization with additional arguments
cover_agent/main_full_repo.py
api_base
andmax_tokens
arguments toAICaller
initialization.AICaller
with required parameters.utils.py
Add `--max-run-time` argument to CLI parser
cover_agent/utils.py
--max-run-time
argument to CLI parser.--max-run-time
.