-
Notifications
You must be signed in to change notification settings - Fork 484
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.pyTest 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_repoentry point:api_basenot passed toAICaller:The CLI argument
--api_basewas accepted but never passed intoAICaller, making it ineffective.✅ Fixed by modifying the initialization of
AICallerto includeapi_base.Missing
--max-run-timeargument:The CLI argument parser
parse_args_full_repodid 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_tokensmanually to theAICallerinit call with a default value (8192) to avoid instantiation errors.Suggested labels:
bug,CLI,enhancementLet me know if any changes are needed — happy to update!
PR Type
Bug fix, Enhancement
Description
Fixed missing
api_baseargument inAICallerinitialization.Added
--max-run-timeargument to CLI parser with default value.Set default
max_tokensvalue inAICallerinitialization.Changes walkthrough 📝
main_full_repo.py
Fix `AICaller` initialization with additional argumentscover_agent/main_full_repo.py
api_baseandmax_tokensarguments toAICallerinitialization.AICallerwith required parameters.utils.py
Add `--max-run-time` argument to CLI parsercover_agent/utils.py
--max-run-timeargument to CLI parser.--max-run-time.