Skip to content

fix(tabby-agent): only send tabby/chat feature registration to VS Code LSP Clients#4487

Open
datGryphon wants to merge 1 commit into
TabbyML:mainfrom
datGryphon:fix/tabby-agent-neovim-lsp-client-feature-crash
Open

fix(tabby-agent): only send tabby/chat feature registration to VS Code LSP Clients#4487
datGryphon wants to merge 1 commit into
TabbyML:mainfrom
datGryphon:fix/tabby-agent-neovim-lsp-client-feature-crash

Conversation

@datGryphon

@datGryphon datGryphon commented Apr 28, 2026

Copy link
Copy Markdown

Summary

Fixes Neovim 0.12 crash where tabby/chat registration sent via client/registerCapability caused a LuaJIT panic (table index is nil) because it is a VS Code-specific method not recognized by Neovim's LSP client.

Changes

  • src/utils/clientType.ts - Extracted getClientType(clientInfo) from telemetry.ts into a shared utility with a ClientType union type ("vscode" | "intellij" | "vim" | "unknown")

  • src/telemetry.ts - Use the shared getClientType instead of the private method

  • src/http/tabbyApiClient.ts - Store and expose clientInfo via getClientInfo() getter (previously only used it to build userAgentString)

  • src/chat/index.ts - syncFeatureRegistration() gates tabby/chat registration behind getClientType(...) === "vscode"

Verification

  • Builds, all 84 tests pass, lint clean
  • Tested locally with Neovim 0.12, completions working again through vim-tabby

Related

Fixes #4486, vim-tabby#40

ChatFeature was sending 'tabby/chat' registration to all LSP clients
regardless of type, causing Neovim 0.12+ to crash with 'table index
is nil' on unknown methods in client/registerCapability.

Extract getClientType() from telemetry.ts into a new shared util.
Store clientInfo on TabbyApiClient and expose publically.
ChatFeature uses new util and clientInfo to gate registration call.

Fixes TabbyML#4486, vim-tabby#40
@datGryphon

datGryphon commented Apr 28, 2026

Copy link
Copy Markdown
Author

I'm also looking at if/how this should be addressed at the neovim lsp client level. I'm still investigating the source of the regression on that end.

Anyway it feels like a two sided problem. Something is being sent that is unsupported, and something unsupported is not being handled properly. ¯\_(ツ)_/¯

@datGryphon datGryphon changed the title fix: only send tabby/chat feature registration to VS Code LSP Clients fix(tabby-agent): only send tabby/chat feature registration to VS Code LSP Clients Apr 29, 2026
@datGryphon

datGryphon commented May 11, 2026

Copy link
Copy Markdown
Author

Bumping this with the added detail that this was addressed on the neovim side after I submitted an issue, but the potential for this to be reintroduced will persist while tabby-agent continues to send tabby/chat to lsp clients which are known to be unable to support it.

Edit: clarification, grammar

@wsxiaoys wsxiaoys requested a review from icycodes May 12, 2026 02:24
@wsxiaoys

Copy link
Copy Markdown
Member

Thanks for the PR - LG from my side

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.

Neovim LSP Client Crashing on unhandled tabby/chat feature registration

2 participants