-
Notifications
You must be signed in to change notification settings - Fork 6
Change default API endpoint to models.github.ai/inference and rename COPILOT_API_ENDPOINT to AI_API_ENDPOINT #94
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -11,6 +11,7 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import tempfile | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from pathlib import Path | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import yaml | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import os | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from seclab_taskflow_agent.available_tools import AvailableTools | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| class TestYamlParser: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -104,5 +105,48 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| assert 'globals' in taskflow | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| assert taskflow['globals']['test_var'] == 'default_value' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| class TestAPIEndpoint: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """Test API endpoint configuration.""" | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @staticmethod | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| def _reload_capi_module(): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """Helper method to reload the capi module.""" | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import importlib | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import seclab_taskflow_agent.capi | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Check noticeCode scanning / CodeQL Module is imported with 'import' and 'import from' Note test
Module 'seclab_taskflow_agent.capi' is imported with both 'import' and 'import from'.
Copilot AutofixAI 1 day ago To fix this problem, we should remove all instances of
Suggested changeset
1
tests/test_yaml_parser.py
Copilot is powered by AI and may make mistakes. Always verify output.
Positive FeedbackNegative Feedback
Refresh and try again.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| importlib.reload(seclab_taskflow_agent.capi) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+115
to
+116
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import seclab_taskflow_agent.capi | |
| importlib.reload(seclab_taskflow_agent.capi) | |
| capi_mod = importlib.import_module("seclab_taskflow_agent.capi") | |
| importlib.reload(capi_mod) |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test claims to verify that the default API endpoint is set to models.github.ai/inference but only checks that AI_API_ENDPOINT exists and is a string. Consider asserting the actual default value when the environment variable is not set, or update the test description to match what it actually tests. For example:
def test_default_api_endpoint(self):
"""Test that default API endpoint is models.github.ai/inference when env var is not set."""
# Clear any existing env var
original_env = os.environ.pop('AI_API_ENDPOINT', None)
try:
self._reload_capi_module()
from seclab_taskflow_agent.capi import AI_API_ENDPOINT
assert AI_API_ENDPOINT == 'https://models.github.ai/inference'
finally:
if original_env is not None:
os.environ['AI_API_ENDPOINT'] = original_env
self._reload_capi_module()
Check failure
Code scanning / CodeQL
Potentially uninitialized local variable Error
Copilot Autofix
AI 1 day ago
To eliminate the risk (and to satisfy static analysis tools), the local variable
models_catalogshould be initialized before being used in line 30. The best way to fix this while preserving existing behavior is to definemodels_catalogasNonebefore thematchblock. Then, after the control flow, perform a check to ensure it was set for supported cases, and if not, raise an appropriate error. This ensures that the variable is always defined prior to its usage and makes control flow more robust and readable. Only lines in the region of themodels_catalogassignment inlist_capi_modelsneed changing.