Skip to content

Azure routing and webview protocol stability issues (minimal diff attached) #12554

@tombrant

Description

@tombrant

Before submitting your bug report

Relevant environment info

- OS: Windows 11
- Continue version: 1.3.38
- IDE version: VSCode
- Model: GPT-5.4 and GPT-5-mini
- config:
  
name: Local Config
version: 1.0.0
schema: v1

defaultModel: Azure GPT-5.4
rateLimits:
  maxTokensPerMinute: 70000
  maxRequestsPerMinute: 50

experimental:
  disableParallelRequests: true
  retryDelayMs: 500
  
models:
  - name: Azure GPT‑5‑Mini
    provider: azure
    model: gpt-5-mini
    apiBase: https://<REDACTED>-aoai-eastus2a.openai.azure.com/
    deployment: gpt-5-mini
    apiVersion: 2025-04-01-preview
    contextLength: 16384
    maxTokens: 8192
    truncate: false
    apiKey: <REDACTED>
  
  - name: Azure GPT-5.4
    provider: azure
    model: gpt-5.4
    apiBase: https://<REDACTED>-aoai-eastus2b.openai.azure.com/
    deployment: gpt-5.4
    apiVersion: 2025-01-01-preview
    contextLength: 200000
    maxTokens: 16384
    truncate: false
    apiKey: <REDACTED>
  
  OR link to agent in Continue hub:

Description

Azure OpenAI requests are routed to incorrect endpoints, resulting in 404 errors and cascading failures inside _streamChat. Additionally, malformed webview messages and unsafe error‑handling paths can crash the extension host. I’ve attached a minimal diff (diff_full.txt) that resolves these issues locally without altering non‑Azure behavior. I’m not submitting a PR, but the patch may be useful for evaluation.

diff_full.txt

Azure routing falls back to OpenAI‑style endpoints (/chat/completions) instead of Azure deployment endpoints, causing 404s. Webview protocol handling can also crash due to malformed messages and unsafe stringify/includes operations.

Additional information
The attached diff includes:

Correct Azure endpoint construction in _getEndpoint

Removal of request‑body pollution in _streamChat

Guards for malformed webview messages

Safe stringify and safe includes

No changes to non‑Azure providers or architecture

The patch is intentionally minimal and localized.

To reproduce

  1. Configure Continue to use an Azure OpenAI deployment.
  2. Trigger any LLM request (chat, autocomplete, describe).
  3. Observe the request URL in logs.
  4. Note the 404 error and subsequent extension host errors.

Malformed webview messages can also trigger crashes during normal usage.

Log output

POST https://<resource>.openai.azure.com/chat/completions
404 Resource Not Found

Error handling webview message:
TypeError: Cannot read properties of undefined (reading 'includes')

TypeError: Converting circular structure to JSON
    at JSON.stringify (<anonymous>)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:configurationRelates to configuration optionsarea:integrationIntegrations (context providers, model providers, etc.)ide:vscodeRelates specifically to VS Code extensionkind:bugIndicates an unexpected problem or unintended behavioros:windowsHappening specifically on Windows

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions