avante.nvim icon indicating copy to clipboard operation
avante.nvim copied to clipboard

bug: azure got 401

Open emxxjnm opened this issue 7 months ago • 1 comments

Describe the bug

after this commit 56576c2481d82af8710d2111fef6cb2ecc57da32, azure got 401 response

To reproduce

No response

Expected behavior

No response

Installation method

Use lazy.nvim:

{
  "yetone/avante.nvim",
  event = "VeryLazy",
  lazy = false,
  version = false, -- set this if you want to always pull the latest change
  opts = {
    -- add any opts here
  },
  -- if you want to build from source then do `make BUILD_FROM_SOURCE=true`
  build = "make",
  -- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows
  dependencies = {
    "nvim-treesitter/nvim-treesitter",
    "stevearc/dressing.nvim",
    "nvim-lua/plenary.nvim",
    "MunifTanjim/nui.nvim",
  },
}

Environment

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
    -- add any other plugins here
  },
})

emxxjnm avatar May 29 '25 02:05 emxxjnm

Under configuration with only Azure settings as shown below, openai provider still loads first, causing azure.parse_api_key to not be nil. As a result, avante always ends up fetching OPENAI_API_KEY instead of AZURE_OPENAI_API_KEY

{
  "yetone/avante.nvim",
  event = "VeryLazy",
  lazy = false,
  version = false, -- set this if you want to always pull the latest change
  opts = {
    azure = {
      endpoint = "https://<your-resource-name>.openai.azure.com",
      deployment = "gpt-4o", 
      api_version = "2025-01-01-preview",
      max_completion_tokens = 16384, 
    },
  },
  -- if you want to build from source then do `make BUILD_FROM_SOURCE=true`
  build = "make",
  -- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows
  dependencies = {
    "nvim-treesitter/nvim-treesitter",
    "stevearc/dressing.nvim",
    "nvim-lua/plenary.nvim",
    "MunifTanjim/nui.nvim",
  },
}

emxxjnm avatar May 29 '25 03:05 emxxjnm

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Jun 29 '25 02:06 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Jul 05 '25 02:07 github-actions[bot]