Skip to content

fix(copilot): guard empty models[].url in custom endpoint and show clear config error - #333702

Open
Birarpanjot Singh Kanwer (arpankanwer) wants to merge 2 commits into
microsoft:mainfrom
arpankanwer:fix/custom-endpoint-url-empty-333701
Open

fix(copilot): guard empty models[].url in custom endpoint and show clear config error#333702
Birarpanjot Singh Kanwer (arpankanwer) wants to merge 2 commits into
microsoft:mainfrom
arpankanwer:fix/custom-endpoint-url-empty-333701

Conversation

@arpankanwer

Copy link
Copy Markdown

Fixes #333701

Problem

Custom Endpoint wizard saves endpoint as name leaving models[].url="".
createOpenAIEndPoint then calls url.includes() on empty/undefined → TypeError: Cannot read properties of undefined (reading 'includes') at extension.js:1598:8522

// Bad - wizard writes
{ "name": "http://localhost:20128/v1", "models": [{ "url": "" }] }

Fix

Test

Repro with bad JSON:

  • Before: TypeError at aFi(...extension.js:1598:8522)
  • After: Custom endpoint model 'or-free' is missing required 'models[].url'. Please configure a valid http(s) URL in chatLanguageModels.json...

Validated:

  • node /tmp/repro_333701_without_fix.js → TypeError
  • node /tmp/repro_333701_with_fix.js → clear error + valid URLs still resolve correctly

…ear config error

Wizard was saving endpoint as group name leaving models[].url empty,
causing TypeError: Cannot read properties of undefined (reading 'includes')
in createOpenAIEndPoint. Validate url, handle undefined in
hasExplicitApiPath/inferApiTypeFromUrl, and throw clear error pointing
to chatLanguageModels.json.

Fixes microsoft#333701
Copilot AI balanced review requested due to automatic review settings September 1, 2026 02:19

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.

@arpankanwer

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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.

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.

Custom Endpoint wizard saves the endpoint as the group name and leaves models[].url empty

3 participants