Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jun 8, 2025

The Azure OpenAI client was using an older API version that doesn't support the o4-mini model deployment, causing a 400 Bad Request error:

Error: Completion error: POST https://azureopenai-ineast.openai.azure.com/openai/deployments/o4-mini/chat/completions
RESPONSE 400: 400 Bad Request ERROR CODE: BadRequest
{
  "error": {
    "code": "BadRequest",
    "message": "Model o4-mini is enabled only for api versions 2024-12-01-preview and later"
  }
}

Changes:

  • Added APIVersion: "2024-12-01-preview" to ClientOptions when creating Azure OpenAI clients
  • Imported github.com/Azure/azure-sdk-for-go/sdk/azcore/policy package for client configuration
  • Added test to verify API version is set correctly
  • Only affects Azure OpenAI clients; OpenAI clients remain unchanged

The fix is minimal and surgical, targeting only the Azure client creation path while preserving all existing functionality.

Fixes #23.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: megamanics <10250297+megamanics@users.noreply.github.com>
Copilot AI changed the title [WIP] issue Fix Azure OpenAI API version for o4-mini model compatibility Jun 8, 2025
Copilot AI requested a review from megamanics June 8, 2025 11:48
@megamanics megamanics marked this pull request as ready for review June 8, 2025 11:50
@megamanics megamanics merged commit 674104f into main Jun 8, 2025
7 checks passed
@megamanics megamanics deleted the copilot/fix-23 branch June 8, 2025 11:50
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.

issue

2 participants