Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure OAI in v0.8.63-vscode got Error: Error parsing response body: SyntaxError: Unexpected token 'A', "Authorizat"... is not valid JSON #3424

Open
3 tasks done
lyajedi opened this issue Dec 17, 2024 · 3 comments
Assignees
Labels
area:configuration Relates to configuration options ide:vscode Relates specifically to VS Code extension kind:bug Indicates an unexpected problem or unintended behavior "needs-triage"

Comments

@lyajedi
Copy link

lyajedi commented Dec 17, 2024

Before submitting your bug report

Relevant environment info

- OS: macOS
- Continue version: v0.8.63 and v0.9.245
- IDE version: VSCode 1.96.0
- Model: Azure OpenAI GPT-4o
- config.json:
  
    {
      "model": "gpt-4o-20240806",
      "contextLength": 128000,
      "title": "GPT-4o",
      "systemMessage": "You are an expert software developer. You give helpful and concise responses.",
      "apiKey": "...",
      "apiBase": "...",
      "apiVersion": "2024-09-01-preview",
      "apiType": "azure",
      "provider": "azure",
      "useLegacyCompletionsEndpoint": false,
      "deployment": "gpt-4o-20240806"
    },

Description

We have our own API server and auth service for Azure OpenAI, the apikey used in the config is actually a JWT (with 2 dots in it to split the header, payload and signature), not sure if something added from 0.8.63 that parses the apiKey and breaks json body.

0.8.63 and the latest prerelease 0.9.245 both have this error, haven't tried any other prerelease versions but suppose to be the same error.

Rollback to 0.8.61 and any versions before are ok without any error.

To reproduce

No response

Log output

ERR [Extension Host] Error handling webview message: {
  "msg": {
    "messageId": "7ffda989-d52d-40a6-9331-c428151fff3b",
    "messageType": "llm/streamChat",
    "data": {
      "messages": [
        {
          "role": "system",
          "content": "When generating new code:\n\n1. Always produce a single code block.\n2. Never separate the code into multiple code blocks.\n3. Only include the code that is being added.\n4. Replace existing code with a \"lazy\" comment like this: \"// ... existing code ...\"\n5. The \"lazy\" comment must always be a valid comment in the current context (e.g. \"<!-- ... existing code ... -->\" for HTML, \"// ... existing code ...\" for JavaScript, \"{/* ... existing code */}\" for TSX, etc.)\n6. You must always provide 1-2 lines of context above and below a \"lazy\" comment\n7. If the user submits a code block that contains a filename in the language specifier, always include the filename in any code block you generate based on that file. The filename should be on the same line as the language specifier in your code block.\n\nExample 1:\nInput:\n.js\nimport addition from \"addition\"\n\nclass Calculator {\n  constructor() {\n    this.result = 0;\n  }\n    \n  add(number) {\n    this.result += number;\n    return this;\n  }\n}\n\nUser request: Add a subtract method\n\nOutput:\n```javascript test.js\n// ... existing code ...\nimport subtraction from \"subtraction\"\n\nclass Calculator {\n  // ... existing code ...\n  \n  subtract(number) {\n    this.result -= number;\n    return this;\n  }\n}\n```\n\nExample 2:\nInput:\n```javascript test.js (6-9)\nfunction helloWorld() {}\n```\n\nOutput:\n```javascript test.js\nfunction helloWorld() {\n  // New code here\n}\n```\n\nAlways follow these guidelines when generating code responses.\n\nWhen using tools, follow the following guidelines:\n- Avoid calling tools unless they are absolutely necessary. For example, if you are asked a simple programming question you do not need web search. As another example, if the user asks you to explain something about code, do not create a new file."
        },
        {
          "role": "user",
          "content": [
            {
              "type": "text",
              "text": "Hi"
            }
          ]
        },
        {
          "role": "assistant",
          "content": ""
        }
      ],
      "title": "GPT-4o",
      "completionOptions": {}
    }
  }
}

Error: Error parsing response body: SyntaxError: Unexpected token 'A', "Authorizat"... is not valid JSON
@dosubot dosubot bot added area:configuration Relates to configuration options ide:vscode Relates specifically to VS Code extension kind:bug Indicates an unexpected problem or unintended behavior labels Dec 17, 2024
@ctwardy
Copy link
Contributor

ctwardy commented Dec 17, 2024

Looks related to #3388 and #3427 .

@Patrick-Erichsen
Copy link
Collaborator

Hi folks, thanks for the notice here. Tracking updates to this issue, and other related issues with Azure after the 0.8.63 release, in this thread: #3477

@sestinj
Copy link
Contributor

sestinj commented Dec 20, 2024

See here: #3477 (comment)

This is solved in a new release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:configuration Relates to configuration options ide:vscode Relates specifically to VS Code extension kind:bug Indicates an unexpected problem or unintended behavior "needs-triage"
Projects
None yet
Development

No branches or pull requests

5 participants