Skip to content

don't fail on unknown default model#172

Closed
p- wants to merge 1 commit intomainfrom
p--dontfail-on-unknown-default-model
Closed

don't fail on unknown default model#172
p- wants to merge 1 commit intomainfrom
p--dontfail-on-unknown-default-model

Conversation

@p-
Copy link
Contributor

@p- p- commented Mar 19, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 19, 2026 06:35
@p- p- closed this Mar 19, 2026
Copy link
Contributor

Copilot AI left a 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 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” ValueError with a fallback default_model string for unknown endpoints.
  • Minor formatting adjustments to logging.debug(...) and OpenAIChatCompletionsModel(...) calls.
Comments suppressed due to low confidence (1)

src/seclab_taskflow_agent/agent.py:46

  • This change alters behavior for unsupported AI_API_ENDPOINT values (it no longer raises at import-time), but there’s no test coverage asserting the new behavior. Adding a unit test that sets an unsupported AI_API_ENDPOINT and 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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants