-
Notifications
You must be signed in to change notification settings - Fork 6
Improve API endpoint error handling #116
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
Improve API endpoint error handling #116
Conversation
| AI_API_TOKEN=<your_github_token> | ||
| # MCP configs | ||
| GH_TOKEN=<your_github_token> | ||
| CODEQL_DBS_BASE_PATH="/app/my_data/codeql_databases" |
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.
| CODEQL_DBS_BASE_PATH="/app/my_data/codeql_databases" | |
| CODEQL_DBS_BASE_PATH="/app/data/codeql_databases" |
Should we change it to data since we removed my_?
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.
Pull request overview
This PR improves error handling when users supply an unsupported API endpoint by adding a new to_url() method to the AI_API_ENDPOINT_ENUM class and updating error messages throughout the codebase to display supported endpoints in their full URL format.
Key changes:
- Added
to_url()method toAI_API_ENDPOINT_ENUMto convert endpoint values to their full URLs - Enhanced error messages in three locations to list supported endpoints when an unsupported endpoint is provided
- Updated README.md documentation to explicitly show the
AI_API_ENDPOINTconfiguration option
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/seclab_taskflow_agent/capi.py | Added to_url() method to enum class and updated error messages in list_capi_models() and supports_tool_calls() to display supported endpoints |
| src/seclab_taskflow_agent/agent.py | Updated error message in the default model initialization to display supported endpoints |
| README.md | Added AI_API_ENDPOINT configuration example and updated database path example |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| AI_API_MODELS_GITHUB = 'models.github.ai' | ||
| AI_API_GITHUBCOPILOT = 'api.githubcopilot.com' | ||
|
|
||
| def to_url(self): |
Check notice
Code scanning / CodeQL
Explicit returns mixed with implicit (fall through) returns Note
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.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR will improve error handling when a user supplies an unsupported API endpoint to display supported endpoints.
E.g. if AI_API_ENDPOINT is:
.env
The error the agent will show: