I am getting recently the following error.
Error 03:32:35 PM notify.error CodeCompanion [ERROR] 2025-12-04 15:32:35
Error: bad request: invalid token: unknown stamp "prod-sdc-01"
Error 03:32:35 PM notify.error CodeCompanion [ERROR] 2025-12-04 15:32:35
[chat::_submit_http] Error: {
body = 'bad request: invalid token: unknown stamp "prod-sdc-01"',
exit = 0,
headers = { "content-security-policy: default-src 'none'; sandbox", "content-type: text/plain; charset=utf-8", "strict-transport-security: max-age=31536000", "x-content-type-options: nosniff", "date: Thu, 04 Dec 2025 14:32:35 GMT", "content-length: 56", "x-github-backend: Kubernetes", "x-github-request-id: FBFC:2FCAB:17DDE89:1AE3DCB:69319B83" },
status = 400
}
The chat was before working. The issue started few days ago without me touching any configuration.
The inline completion are still working, only the main chat is broken.
My current config:
# vim: ft=lua
{ extraPackages, pkgs, }: ''
local gheUrl = "https://finapi.ghe.com"
-- copilot-lua
-- Run :Copilot auth
require("copilot").setup({
nes = { enabled = false }, -- TODO: try later
auth_provider_url = gheUrl,
-- nixpkgs node
copilot_node_command = "${pkgs.nodejs_22}/bin/node",
suggestion = { enabled = false },
panel = { enabled = false },
filetypes = {
markdown = true,
help = true,
},
})
-- codecompanion
-- Available models:
-- "claude-sonnet-4"
-- "gemini-2.5-pro"
-- "grok-code-fast-1"
-- "claude-3.5-sonnet"
-- "gpt-5-codex"
-- "gpt-4o"
-- "gpt-5"
-- "claude-sonnet-4.5"
-- "gpt-4.1"
-- "gpt-5-mini"
require("codecompanion").setup({
opts = {
log_level = "TRACE",
},
adapters = {
http = {
copilot_enterprise = function()
local adapter = require("codecompanion.adapters.http.copilot_enterprise")
adapter.opts.provider_url = gheUrl
return adapter
end,
},
},
strategies = {
chat = {
adapter = {
name = "copilot_enterprise",
model = "gpt-5",
},
},
inline = {
adapter = "copilot_enterprise",
model = "gpt-4.1",
},
cmd = {
adapter = "copilot_enterprise",
model = "gpt-4.1",
},
},
})
-- CodeCompanion keymaps
vim.keymap.set("n", "<leader>ac", "<cmd>CodeCompanionChat Toggle<cr>", { desc = "Toggle CodeCompanion Chat" })
vim.keymap.set("v", "<leader>ac", "<cmd>CodeCompanionChat Toggle<cr>", { desc = "Toggle CodeCompanion Chat" })
vim.keymap.set("n", "<leader>aa", "<cmd>CodeCompanionActions<cr>", { desc = "CodeCompanion Actions" })
vim.keymap.set("v", "<leader>aa", "<cmd>CodeCompanionActions<cr>", { desc = "CodeCompanion Actions" })
vim.keymap.set("n", "<leader>ai", "<cmd>CodeCompanion<cr>", { desc = "CodeCompanion Inline" })
vim.keymap.set("v", "<leader>ai", "<cmd>CodeCompanion<cr>", { desc = "CodeCompanion Inline" })
vim.keymap.set("n", "<leader>an", "<cmd>CodeCompanionChat<cr>", { desc = "New CodeCompanion Chat" })
vim.keymap.set("n", "<leader>ar", "<cmd>CodeCompanionChat Add<cr>", { desc = "Add to CodeCompanion Chat" })
vim.keymap.set("v", "<leader>ar", "<cmd>CodeCompanionChat Add<cr>", { desc = "Add selection to CodeCompanion Chat" })
''
Adapter inspection:
03:44:31 PM msg_show.lua_print :lua print(vim.inspect(require("codecompanion.adapters.http.copilot_enterprise"))) {
env = {
api_key = <function 1>
},
features = {
text = true,
tokens = true
},
formatted_name = "Copilot Enterprise",
get_copilot_stats = <function 2>,
handlers = {
chat_output = <function 3>,
form_messages = <function 4>,
form_parameters = <function 5>,
form_tools = <function 6>,
inline_output = <function 7>,
on_exit = <function 8>,
setup = <function 9>,
tokens = <function 10>,
tools = {
format_tool_calls = <function 11>,
output_response = <function 12>
}
},
headers = {
Authorization = "Bearer ${api_key}",
["Content-Type"] = "application/json",
["Copilot-Integration-Id"] = "vscode-chat",
["Editor-Version"] = "Neovim/0.12.0"
},
name = "copilot_enterprise",
opts = {
provider_url = "https://finapi.ghe.com",
stream = true,
tools = true,
vision = true
},
roles = {
llm = "assistant",
tool = "tool",
user = "user"
},
schema = {
max_tokens = {
default = 16384,
desc = "The maximum number of tokens to generate in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length.",
mapping = "parameters",
order = 4,
type = "integer"
},
model = {
choices = <function 13>,
default = "gpt-4.1",
desc = "ID of the model in use. Model availability may depend on you GitHub Enterprise plan.",
mapping = "parameters",
order = 1,
type = "enum"
},
n = {
condition = <function 14>,
default = 1,
desc = "How many chat completions to generate for each prompt.",
mapping = "parameters",
order = 6,
type = "number"
},
temperature = {
condition = <function 15>,
default = 0.1,
desc = "What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.",
mapping = "parameters",
order = 3,
type = "number"
},
top_p = {
condition = <function 16>,
default = 1,
desc = "An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.",
mapping = "parameters",
order = 5,
type = "number"
}
},
show_copilot_stats = <function 17>,
url = "https://api.githubcopilot.com/chat/completions"
}
CodeCompanion debug window:
-- Adapter: "Copilot Enterprise"
-- Buffer Number: 6
-- Following Buffer: "" (1)
local settings = {
model = "gpt-5", -- "gpt-5.1", "claude-haiku-4.5", "gpt-5.1-codex", "gemini-2.5-pro", "gpt-4.1", "gpt-5-mini", "gpt-5.1-codex-mini", "gemini-3-pro-preview", "claude-sonnet-4.5", "gpt-5-codex", "grok-code-fast-1", "gpt-4o", "claude-sonnet-4", "claude-opus-4.5",
temperature = 0.1,
max_tokens = 16384,
top_p = 1,
n = 1,
}
local messages =
{ {
_meta = {
cycle = 1,
id = 59103469,
index = 1,
tag = "system_prompt_from_config"
},
content = "You are an AI programming assistant named \"CodeCompanion\", working within the Neovim text editor.\n\nYou can answer general programming questions and perform the following tasks:\n* Answer general programming questions.\n* Explain how the code in a Neovim buffer works.\n* Review the selected code from a Neovim buffer.\n* Generate unit tests for the selected code.\n* Propose fixes for problems in the selected code.\n* Scaffold code for a new workspace.\n* Find relevant code to the user's query.\n* Propose fixes for test failures.\n* Answer questions about Neovim.\n* Prefer vim.api* methods where possible.\n\nFollow the user's requirements carefully and to the letter.\nUse the context and attachments the user provides.\nKeep your answers short and impersonal, especially if the user's context is outside your core tasks.\nUse Markdown formatting in your answers.\nDO NOT use H1 or H2 headers in your response.\nWhen suggesting code changes or new content, use Markdown code blocks.\nTo start a code block, use 4 backticks.\nAfter the backticks, add the programming language name as the language ID.\nTo close a code block, use 4 backticks on a new line.\nIf the code modifies an existing file or should be placed at a specific location, add a line comment with 'filepath:' and the file path.\nIf you want the user to decide where to place the code, do not add the file path comment.\nIn the code block, use a line comment with '...existing code...' to indicate code that is already present in the file.\nCode block example:\n````languageId\n// filepath: /path/to/file\n// ...existing code...\n{ changed code }\n// ...existing code...\n{ changed code }\n// ...existing code...\n````\nEnsure line comments use the correct syntax for the programming language (e.g. \"#\" for Python, \"--\" for Lua).\nFor code blocks use four backticks to start and end.\nAvoid wrapping the whole response in triple backticks.\nDo not include diff formatting unless explicitly asked.\nDo not include line numbers in code blocks.\n\nWhen given a task:\n1. Think step-by-step and, unless the user requests otherwise or the task is very simple. For complex architectural changes, describe your plan in pseudocode first.\n2. When outputting code blocks, ensure only relevant code is included, avoiding any repeating or unrelated code.\n3. End your response with a short suggestion for the next user turn that directly supports continuing the conversation.\n\nAdditional context:\nAll non-code text responses must be written in the English language.\nThe current date is 2025-12-04.\nThe user's Neovim version is 0.12.0.\nThe user is working on a Linux machine. Please respond with system specific commands if applicable.\n",
opts = {
visible = false
},
role = "system"
}, {
_meta = {
cycle = 1,
id = 1195041320,
index = 2,
sent = true
},
content = "test",
opts = {
visible = true
},
role = "user"
} }
I have also tried :Copilot auth signout and signin again.
I am getting recently the following error.
The chat was before working. The issue started few days ago without me touching any configuration.
The inline completion are still working, only the main chat is broken.
My current config:
Adapter inspection:
CodeCompanion debug window:
I have also tried
:Copilot auth signoutandsigninagain.