Skip to content

Fix BYOK providers whose model ID is 'auto' - #23026

Closed
pol-rivero wants to merge 1 commit into
desktop:developmentfrom
desktop-plus:fix-byok-auto
Closed

pol-rivero wants to merge 1 commit into
desktop:developmentfrom
desktop-plus:fix-byok-auto

Conversation

@pol-rivero

Copy link
Copy Markdown
Contributor

Description

Some OpenAI-compatible routers expose a model literally named auto. If you choose that model for a custom provider, commit message generation fails with:

Authentication failed with provider at https://<provider>/v1 (HTTP 403).
  Check your COPILOT_PROVIDER_API_KEY or COPILOT_PROVIDER_BEARER_TOKEN.

The credentials are valid. The Copilot runtime treats the session model auto as its own automatic model selection and sends a built-in model (claude-sonnet-4 in my testing) to the provider instead.

Changes in my PR:

  • Always send the provider's model ID explicitly via provider.wireModel.
  • When the model ID is auto, give the session a different model name (byok-auto) so the runtime doesn't apply its auto selection. The provider still receives auto.

Screenshots

N/A

Release notes

Notes:

@pol-rivero
pol-rivero requested a review from a team as a code owner October 15, 2026 19:21
@pol-rivero
pol-rivero requested review from babakks and a balanced review from Copilot October 15, 2026 19:21
@github-actions github-actions Bot added external Pull request originating outside of the Desktop core team needs-triage labels Oct 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added ready-for-review Pull Requests that are ready to be reviewed by the maintainers and removed needs-triage labels Oct 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your pull request! While it doesn't meet all of our standard requirements, it appears to be a small, focused contribution and has been routed to the team for review.

Note: We still encourage linking to an issue with the help wanted label when possible, as it helps us prioritize and track contributions.

@sergiou87

Copy link
Copy Markdown
Member

Thanks @pol-rivero ! What router offers auto as option? I would love to reproduce the problem before accepting the PR 🙏

@pol-rivero

pol-rivero commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor Author

The original (downstream) bug report is desktop-plus#291, and the reporter was using a self-hosted instance of LiteLLM. They assured me that auto was the default name for the model, so I considered the bug important enough to upstream the fix.
However, I'm now verifying the LiteLLM docs and I can't find that auto model anywhere. The auto-routing docs use model_name: smart-router. The only mention of exactly "auto" is in https://docs.litellm.ai/docs/providers/fireworks_ai, but I doubt that's what they meant. Maybe the reporter misunderstood my question... 😅

At least, the fix in the PR can still be useful if the user voluntarily types auto as the model name when configuring whichever router they use (even if it's not the default value).

@pol-rivero

Copy link
Copy Markdown
Contributor Author

The reporter has confirmed that they changed the model name from the one proposed in the official tutorial (smart-router) to auto.
Please see desktop-plus#291 (comment)

@sergiou87

Copy link
Copy Markdown
Member

Thank you @pol-rivero !! After some work with Copilot on this, it suggested a different implementation that I liked better, so I went ahead and submitted a different PR: #23059

I tagged you as co-author of the commit and will try to keep you as contributor when this gets released, I hope you don't mind!

Thank you again 🙇‍♂️ 💖

@sergiou87 sergiou87 closed this Oct 22, 2026
@pol-rivero

Copy link
Copy Markdown
Contributor Author

Sure thing, thanks for looking into this! :)

@pol-rivero
pol-rivero deleted the fix-byok-auto branch October 25, 2026 09:45
@millonbigs-cpu millonbigs-cpu mentioned this pull request Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external Pull request originating outside of the Desktop core team ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants