Skip to content

improve custom OpenAI Compatible model URL resolution#1074

Merged
lramos15 merged 2 commits intomicrosoft:mainfrom
DGideas:bugfix_resolveCustomOAIUrl
Sep 24, 2025
Merged

improve custom OpenAI Compatible model URL resolution#1074
lramos15 merged 2 commits intomicrosoft:mainfrom
DGideas:bugfix_resolveCustomOAIUrl

Conversation

@DGideas
Copy link
Contributor

@DGideas DGideas commented Sep 21, 2025

In this commit, I

  • Update resolveCustomOAIUrl function to handle URLs with existing version patterns
  • Remove special handling for /v1 to support any version number (v1, v2, v4, etc.)

Related Issue: microsoft/vscode#267616 (comment)

Step to validate:

  1. Add the following config to settings.json
	"github.copilot.chat.customOAIModels": {
		"GLM-4.5": {
			"name": "GLM 4.5",
			"url": "https://api.z.ai/api/coding/paas/v4",
			"maxInputTokens": 131200,
			"maxOutputTokens": 96000,
			"requiresAPIKey": true,
			"thinking": true,
			"toolCalling": true,
			"vision": false,
		},
	}
  1. After apply this patch, Copilot Chat shouldn't show any error message when works with this model endpoint

…version paths

- Update resolveCustomOAIUrl function to handle URLs with existing version patterns
- Remove special handling for /v1 to support any version number (v1, v2, v4, etc.)
@DGideas
Copy link
Contributor Author

DGideas commented Sep 21, 2025

Before this fix:
image

After this fix:
image

@vs-code-engineering vs-code-engineering bot added this to the September 2025 milestone Sep 23, 2025
@lramos15 lramos15 enabled auto-merge September 24, 2025 11:47
@lramos15 lramos15 added this pull request to the merge queue Sep 24, 2025
Merged via the queue into microsoft:main with commit 9e89034 Sep 24, 2025
6 checks passed
@DGideas DGideas deleted the bugfix_resolveCustomOAIUrl branch September 24, 2025 12:06
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.

4 participants