copilot-sdk icon indicating copy to clipboard operation
copilot-sdk copied to clipboard

gpt-5-mini not being recognized as valid model argument even though it works when set to default model in CLI

Open LaishGlenberg opened this issue 9 months ago • 3 comments

EDIT: It seems the issue is caused by my vpn, when active the fallback happens, when disabled gpt-5-mini is used as expected.

I keep trying to use gpt-5-mini as the model argument to the SDK session but for some reason it keeps falling back to my default model in CLI meaning it's not being recognized as a valid model. I've tried both gpt-5-mini and gpt-5 mini and both have resulted in a fallback. I know that gpt-5-mini is offered in the CLI because it's listed in /models, when I set it as my default it asked me to set the reasoning mode, this gave me the idea to try gpt-5-mini-medium but this also resulted in a fallback. With gpt-5-mini as my default, I was able to use it in the sdk and I can definitely confirm that it is under the ID "gpt-5-mini" from the usage event logs

[event] { "type": "assistant.usage", "data": { "model": "gpt-5-mini", "inputTokens": 9155, "outputTokens": 125, "cacheReadTokens": 1536, "cacheWriteTokens": 0, "cost": 0, "duration": 7120, "initiator": "user", "apiCallId": ...

So I can only use it when it's set as my default model since the actual model argument "gpt-5-mini" always falls back to the default model. Not sure if this is a bug or what's going on, FYI gpt-4.1 works fine as the model argument.

LaishGlenberg avatar Feb 10 '26 15:02 LaishGlenberg

Thanks for opening this issue! I've labeled it as a bug and added needs-info since we need a few more details to investigate:

  1. Which SDK are you using? (Node.js, Python, Go, or .NET)
  2. What version of the SDK and Copilot CLI? (run copilot --version to check CLI version)
  3. Can you share the minimal code snippet that reproduces the issue showing how you're passing the model parameter?

From your description, it seems like the SDK might not be properly recognizing gpt-5-mini as a valid model identifier and falling back to your default. The fact that it works when set as your default CLI model confirms the model itself is valid, so this appears to be an SDK-side validation or parameter passing issue.

AI generated by Issue Triage Agent

github-actions[bot] avatar Feb 10 '26 15:02 github-actions[bot]

I discovered the issue seems to be related to my vpn, after disabling the vpn the fallback behavior with gpt-5-mini disappeared and everything began working properly. When enabling the vpn the fallback issue reappeared. Again, throughout this gpt-4.1 worked fine when being passed to the model param and did not exhibit fallback behavior.

Here are my specs:

  1. Using the Node.js SDK
  2. Running GitHub Copilot CLI 0.0.406. and @github/[email protected]
  3. Snippet: const session = await client.createSession({ model: "gpt-5-mini", });

LaishGlenberg avatar Feb 10 '26 15:02 LaishGlenberg

After updating to [email protected] the issue has been fixed and gpt-5-mini model argument works with both vpn disabled and enabled.

LaishGlenberg avatar Feb 10 '26 17:02 LaishGlenberg