Skip to content

Downgrade model fallback log from warning to debug#8773

Merged
Light2Dark merged 1 commit intomainfrom
Light2Dark/model-fallback-log
Mar 19, 2026
Merged

Downgrade model fallback log from warning to debug#8773
Light2Dark merged 1 commit intomainfrom
Light2Dark/model-fallback-log

Conversation

@Light2Dark
Copy link
Copy Markdown
Collaborator

@Light2Dark Light2Dark commented Mar 19, 2026

📝 Summary

Issue from Discord. It's quite common to have a custom provider which isn't in pydantic AI's registry. The UI works and we shouldn't log a warning.

📋 Checklist

  • I have read the contributor guidelines.
  • Tests have been added for the changes made. (No tests needed — logging level change)
  • Documentation has been updated where applicable. (No docs changes needed)
  • Pull request title is a good summary of the changes.

When custom providers fall back to OpenAIChatModel due to an unrecognized
model name, it's not an error condition — the UI works fine. Downgrading to
debug level prevents noisy console warnings for expected behavior.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 19, 2026 15:45
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Mar 19, 2026 3:46pm

Request Review

@Light2Dark Light2Dark added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Mar 19, 2026
Copy link
Copy Markdown
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 reduces console noise in the server-side AI provider integration by downgrading the “model not found → fallback to OpenAIChatModel” log from WARNING to DEBUG when a custom provider’s model name isn’t recognized by pydantic-ai’s model registry.

Changes:

  • Change the fallback log level from warning to debug for infer_model(...) UserError cases.
  • Clarify the log message to indicate the fallback is due to pydantic-ai model registry lookup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Light2Dark Light2Dark merged commit f36f68a into main Mar 19, 2026
53 of 55 checks passed
@Light2Dark Light2Dark deleted the Light2Dark/model-fallback-log branch March 19, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants