Closed
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the agent’s default-model selection logic so the module no longer raises at import time when AI_API_ENDPOINT is an unrecognized host, shifting toward a more tolerant configuration approach.
Changes:
- Replace the “unsupported endpoint”
ValueErrorwith a fallbackdefault_modelstring for unknown endpoints. - Minor formatting adjustments to
logging.debug(...)andOpenAIChatCompletionsModel(...)calls.
Comments suppressed due to low confidence (1)
src/seclab_taskflow_agent/agent.py:46
- This change alters behavior for unsupported
AI_API_ENDPOINTvalues (it no longer raises at import-time), but there’s no test coverage asserting the new behavior. Adding a unit test that sets an unsupportedAI_API_ENDPOINTand verifies importing/initializing the agent uses an env-provided model (or emits the expected warning / raises a clear initialization-time error) would prevent regressions.
case _:
default_model = "please-set-default-model-via-env"
DEFAULT_MODEL = os.getenv("COPILOT_DEFAULT_MODEL", default=default_model)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| f"Unsupported Model Endpoint: {api_endpoint}\n" | ||
| f"Supported endpoints: {[e.to_url() for e in AI_API_ENDPOINT_ENUM]}" | ||
| ) | ||
| default_model = "please-set-default-model-via-env" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.