Skip to content

Version 1.1.50 broke @ai-sdk/openai-compatible auth #12049

Closed

Description

@feiwhang

Description

Unauthorized: Failed to maybeAuthenticate with headers: host: [...], content-type: [application/json], user-agent: [opencode/1.1.50 ai-sdk/provider-utils/3.0.20 runtime/bun/1.3.5], accept: [*/*], accept-encoding: [gzip, deflate, br, zstd]

Downgrade to 1.1.49 solves the problem.

Plugins

No response

OpenCode version

1.1.50

Steps to reproduce

  1. Upgrade to 1.1.50
  2. Set up @ai-sdk/openai-compatible providers
  3. Start chat

Screenshot and/or share link

No response

Operating System

macOS

Terminal

iTerm2

Activity

  1. 5trongHust commented on Feb 4, 2026

    @5trongHust

    how can i downgrade to 1.1.49 . use opencode upgrade

  2. rekram1-node commented on Feb 4, 2026

    @rekram1-node
    Contributor

    can u share opencode debug config?

  3. rekram1-node commented on Feb 4, 2026

    @rekram1-node
    Contributor

    Are you overriding apikey, or auth headers in your opencode.json?

  4. magicpose commented on Feb 4, 2026

    @magicpose

    Are you overriding apikey, or auth headers in your opencode.json?

    I'm having the same issue. It was working fine, but after upgrading to version 1.1.50, it stopped working.

    opencode debug config
    {
      "$schema": "https://opencode.ai/config.json",
      "provider": {
        "myprovider": {
          "name": "TDAI",
          "npm": "@ai-sdk/openai-compatible",
          "models": {
            "claude-4-5-sonnet": {
              "name": "claude-4-5-sonnet"
            },
            "gpt-5-chat": {
              "name": "gpt-5-chat"
            },
            "gemini-3-pro-preview": {
              "name": "gemini-3-pro-preview"
            }
          },
          "options": {
            "baseURL": "https://ai2-api.xxxxx.com/v1",
            "headers": {
              "Authorization": "Bearer sk-xxxxxxxxxx"
            }
          }
        }
      },
      "agent": {},
      "mode": {},
      "plugin": [],
      "command": {},
      "username": "xiaowei",
      "keybinds": {
        "leader": "ctrl+x",
        "app_exit": "ctrl+c,ctrl+d,<leader>q",
        "editor_open": "<leader>e",
        "theme_list": "<leader>t",
        "sidebar_toggle": "<leader>b",
        "scrollbar_toggle": "none",
        "username_toggle": "none",
        "status_view": "<leader>s",
        "session_export": "<leader>x",
        "session_new": "<leader>n",
        "session_list": "<leader>l",
        "session_timeline": "<leader>g",
        "session_fork": "none",
        "session_rename": "ctrl+r",
        "session_delete": "ctrl+d",
        "stash_delete": "ctrl+d",
        "model_provider_list": "ctrl+a",
        "model_favorite_toggle": "ctrl+f",
        "session_share": "none",
        "session_unshare": "none",
        "session_interrupt": "escape",
        "session_compact": "<leader>c",
        "messages_page_up": "pageup,ctrl+alt+b",
        "messages_page_down": "pagedown,ctrl+alt+f",
        "messages_line_up": "ctrl+alt+y",
        "messages_line_down": "ctrl+alt+e",
        "messages_half_page_up": "ctrl+alt+u",
        "messages_half_page_down": "ctrl+alt+d",
        "messages_first": "ctrl+g,home",
        "messages_last": "ctrl+alt+g,end",
        "messages_next": "none",
        "messages_previous": "none",
        "messages_last_user": "none",
        "messages_copy": "<leader>y",
        "messages_undo": "<leader>u",
        "messages_redo": "<leader>r",
        "messages_toggle_conceal": "<leader>h",
        "tool_details": "none",
        "model_list": "<leader>m",
        "model_cycle_recent": "f2",
        "model_cycle_recent_reverse": "shift+f2",
        "model_cycle_favorite": "none",
        "model_cycle_favorite_reverse": "none",
        "command_list": "ctrl+p",
        "agent_list": "<leader>a",
        "agent_cycle": "tab",
        "agent_cycle_reverse": "shift+tab",
        "variant_cycle": "ctrl+t",
        "input_clear": "ctrl+c",
        "input_paste": "ctrl+v",
        "input_submit": "return",
        "input_newline": "shift+return,ctrl+return,alt+return,ctrl+j",
        "input_move_left": "left,ctrl+b",
        "input_move_right": "right,ctrl+f",
        "input_move_up": "up",
        "input_move_down": "down",
        "input_select_left": "shift+left",
        "input_select_right": "shift+right",
        "input_select_up": "shift+up",
        "input_select_down": "shift+down",
        "input_line_home": "ctrl+a",
        "input_line_end": "ctrl+e",
        "input_select_line_home": "ctrl+shift+a",
        "input_select_line_end": "ctrl+shift+e",
        "input_visual_line_home": "alt+a",
        "input_visual_line_end": "alt+e",
        "input_select_visual_line_home": "alt+shift+a",
        "input_select_visual_line_end": "alt+shift+e",
        "input_buffer_home": "home",
        "input_buffer_end": "end",
        "input_select_buffer_home": "shift+home",
        "input_select_buffer_end": "shift+end",
        "input_delete_line": "ctrl+shift+d",
        "input_delete_to_line_end": "ctrl+k",
        "input_delete_to_line_start": "ctrl+u",
        "input_backspace": "backspace,shift+backspace",
        "input_delete": "ctrl+d,delete,shift+delete",
        "input_undo": "ctrl+-,super+z",
        "input_redo": "ctrl+.,super+shift+z",
        "input_word_forward": "alt+f,alt+right,ctrl+right",
        "input_word_backward": "alt+b,alt+left,ctrl+left",
        "input_select_word_forward": "alt+shift+f,alt+shift+right",
        "input_select_word_backward": "alt+shift+b,alt+shift+left",
        "input_delete_word_forward": "alt+d,alt+delete,ctrl+delete",
        "input_delete_word_backward": "ctrl+w,ctrl+backspace,alt+backspace",
        "history_previous": "up",
        "history_next": "down",
        "session_child_cycle": "<leader>right",
        "session_child_cycle_reverse": "<leader>left",
        "session_parent": "<leader>up",
        "terminal_suspend": "ctrl+z",
        "terminal_title_toggle": "none",
        "tips_toggle": "<leader>h"
      }
    }
    
    Image
  5. rekram1-node commented on Feb 4, 2026

    @rekram1-node
    Contributor

    Ah I see what could cause fixing

  6. rekram1-node commented on Feb 4, 2026

    @rekram1-node
    Contributor

    Cutting release, for those that are getting this u can work around by not being "double authed" (having api key in ur auth.json file from an auth login or /connect AND having the auth headers in opencode.json)

    I merged someones PR that claimed to fix an issue w/ headers and it introduced bugs. Need to add more testing in this area to catch future issues

  7. rekram1-node commented on Feb 4, 2026

    @rekram1-node
    Contributor
  8. rekram1-node commented on Feb 4, 2026

    @rekram1-node
    Contributor

    If u are using homebrew make sure you use our tap:
    brew install anomalyco/tap/opencode otherwise you won't be up to date

  9. feiwhang commented on Feb 4, 2026

    @feiwhang
    Author

    Confirm this is fixed in 1.1.51

  10. rekram1-node commented on Feb 4, 2026

    @rekram1-node
    Contributor

    I'm really disappointed that this release made it out, so im going to go hard on testing soon.

    Apologies again yall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions