Skip to content

fix(codecompanion): compatibility with v19#276

Closed
powerman wants to merge 1 commit into
ravitemer:mainfrom
powerman:fix-codecompanion-19
Closed

fix(codecompanion): compatibility with v19#276
powerman wants to merge 1 commit into
ravitemer:mainfrom
powerman:fix-codecompanion-19

Conversation

@powerman
Copy link
Copy Markdown
Contributor

Description

Fixes compatibility with CodeCompanion v19.

Related Issue(s)

Fixes #275

Screenshots

Checklist

  • I've read the contributing guidelines and have adhered to them in this PR
  • I've updated the README and/or relevant docs pages
  • I've run make test to ensure all tests pass
  • I've run make format to format the code
  • I've run make docs to update the vimdoc pages

@georgeharker
Copy link
Copy Markdown

Seems like a straightforward patch. Would love to see this merged!

@kekscode
Copy link
Copy Markdown

kekscode commented Mar 1, 2026

I tried to temporarily switch to this branch but got problems with the mcphub binary download so a fast merge would be very much appreciated.

@powerman
Copy link
Copy Markdown
Contributor Author

powerman commented Mar 1, 2026

I tried to temporarily switch to this branch but got problems with the mcphub binary download so a fast merge would be very much appreciated.

If you're using Lazy then you can use https://github.com/polirritmico/lazy-local-patcher.nvim plus save the patch file into your Neovim config to get patched MCPHub.

@kekscode
Copy link
Copy Markdown

kekscode commented Mar 1, 2026

I tried to temporarily switch to this branch but got problems with the mcphub binary download so a fast merge would be very much appreciated.

If you're using Lazy then you can use https://github.com/polirritmico/lazy-local-patcher.nvim plus save the patch file into your Neovim config to get patched MCPHub.

That's a real handy workaround. I'll have a look into this. Thanks for pointing that out!

Update: The polirritmico/lazy-local-patcher.nvim works well as a temporary workaround. If someone needs this, too, i have now a patch file:
/Users/<user>/.config/nvim/patches/mcphub.nvim/01-refactoring-compatibility.patch

with the content:

diff --git a/lua/mcphub/extensions/codecompanion/variables.lua b/lua/mcphub/extensions/codecompanion/variables.lua
index 2a15a55..20c7e14 100644
--- a/lua/mcphub/extensions/codecompanion/variables.lua
+++ b/lua/mcphub/extensions/codecompanion/variables.lua
@@ -14,7 +14,7 @@ function M.register(opts)
         return
     end

-    local cc_variables = config.interactions.chat.variables
+    local cc_variables = config.interactions.chat.editor_context

     -- Remove existing MCP variables
     for key, value in pairs(cc_variables) do

@powerman
Copy link
Copy Markdown
Contributor Author

powerman commented Mar 2, 2026

Replaced by #279.

@powerman powerman closed this Mar 2, 2026
oyoshot added a commit to oyoshot/dotfiles that referenced this pull request Apr 12, 2026
mcphub.nvim currently crashes on startup with CodeCompanion v19 because CodeCompanion renamed chat variables to editor_context. The upstream reports are ravitemer/mcphub.nvim#275 and ravitemer/mcphub.nvim#278.

PR ravitemer/mcphub.nvim#276 was closed in favor of #279. #279 is still open and not merged, so use the upstream-recommended temporary workaround, make_vars = false.

This keeps MCP tools and slash commands enabled, but disables MCP resources as CodeCompanion # context until the upstream v19 compatibility patch lands.
oyoshot added a commit to oyoshot/dotfiles that referenced this pull request Apr 13, 2026
* chore(nvim): update APIs for 0.12

* fix(nvim): skip write autocmds for special buffers

* chore(mise): add textlint tools

* fix(nvim): disable mcphub vars for codecompanion v19

mcphub.nvim currently crashes on startup with CodeCompanion v19 because CodeCompanion renamed chat variables to editor_context. The upstream reports are ravitemer/mcphub.nvim#275 and ravitemer/mcphub.nvim#278.

PR ravitemer/mcphub.nvim#276 was closed in favor of #279. #279 is still open and not merged, so use the upstream-recommended temporary workaround, make_vars = false.

This keeps MCP tools and slash commands enabled, but disables MCP resources as CodeCompanion # context until the upstream v19 compatibility patch lands.

* chore(mise): remove default npm packages
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.

Crash on startup with codecompanion v19 — nil passed to pairs() in variables.lua

3 participants