Skip to content

fix: Track configured auth for turn errors#245

Merged
benbrandt merged 9 commits into
mainfrom
fix-auth-errors
Jun 26, 2026
Merged

fix: Track configured auth for turn errors#245
benbrandt merged 9 commits into
mainfrom
fix-auth-errors

Conversation

@benbrandt

Copy link
Copy Markdown
Member

Closes #244

@anvilpete

Copy link
Copy Markdown

Many thanks for this @benbrandt!

I did some quick testing, and it seems to work well.
However, 401 errors look a bit wonky:

{
  "jsonrpc": "2.0",
  "id": 3,
  "error": {
    "code": -32603,
    "message": "Internal error: Reconnecting... 5/5",
    "data": {
      "message": "Reconnecting... 5/5",
      "codexErrorInfo": {
        "responseStreamDisconnected": { "httpStatusCode": 401 }
      },
      "additionalDetails": "unexpected status 401 Unauthorized: Incorrect API key provided: fdsa. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: a11b34cebba09505-LHR, request id: req_79cc489e2bac4c1ea0ecb796ab39ab94"
    }
  }
}

In the original Zed implementation, the text now in additionalDetails was in data.message.

Another difference from the Zed implementation: the top-level message previously matched the definition in the JSON-RPC spec exactly, and additional detail was in data.message. So the error would have looked like:

{
  "jsonrpc": "2.0",
  "id": 3,
  "error": {
    "code": -32603,
    "message": "Internal error",
    "data": {
      "message": "unexpected status 401 Unauthorized: Incorrect API key provided: fdsa. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: a11b34cebba09505-LHR, request id: req_79cc489e2bac4c1ea0ecb796ab39ab94",
...

@anvilpete

Copy link
Copy Markdown

(the exact shape probably isn't too important, but it would be nice to avoid the "Reconnecting... 5/5")

@benbrandt

Copy link
Copy Markdown
Member Author

great catch thanks, fixing

@benbrandt benbrandt merged commit b7c78dd into main Jun 26, 2026
5 checks passed
@benbrandt benbrandt deleted the fix-auth-errors branch June 26, 2026 12:14
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.

AuthRequired error usage not consistent with other implementations

2 participants