From e4e7b6621ea7ddae17d98d98187ae33bf924b61c Mon Sep 17 00:00:00 2001 From: Jannik Donker Date: Tue, 17 Nov 2026 17:18:39 +0100 Subject: [PATCH] hide the API-key providers from the codecompanion adapter picker The `ga` picker now lists only Claude Code and Antigravity. Every built-in HTTP adapter is hidden after setup, so new presets in later releases stay hidden too; hidden adapters still work by name. Co-Authored-By: Claude Opus 5.5 --- lua/ai.lua | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/lua/ai.lua b/lua/ai.lua index 44bd0b6..12c3845 100644 --- a/lua/ai.lua +++ b/lua/ai.lua @@ -114,15 +114,9 @@ require("codecompanion").setup({ }) end, }, - http = { - -- The defaults (web search/fetch backends) plus the inline-only agent. - opts = { - hidden = { - duckduckgo = true, jina = true, markitdown = true, tavily = true, - antigravity_inline = true, - }, - }, - }, + -- Merged into the default hidden list. All HTTP adapters get hidden + -- after setup() below; this one is an agent, so it's listed here. + http = { opts = { hidden = { antigravity_inline = true } } }, }, interactions = { @@ -170,6 +164,15 @@ require("codecompanion").setup({ }, }) +-- The `ga` picker shows only Claude Code and Antigravity: hide every +-- built-in HTTP (API-key) provider, including ones added in later releases. +-- The hidden list is read whenever the picker opens, and hidden adapters +-- still work by name (cmd/background use anthropic, web tools duckduckgo). +local http_adapters = require("codecompanion.config").adapters.http +for name in pairs(http_adapters) do + if name ~= "opts" and name ~= "extend" then http_adapters.opts.hidden[name] = true end +end + -- Progress float while an inline edit runs (see lua/ai_status.lua). require("ai_status").setup()