fix(tabby-agent): only send tabby/chat feature registration to VS Code LSP Clients#4487
Open
datGryphon wants to merge 1 commit intoTabbyML:mainfrom
Open
Conversation
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
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. ¯\_(ツ)_/¯ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes Neovim 0.12 crash where
tabby/chatregistration sent viaclient/registerCapabilitycaused 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- ExtractedgetClientType(clientInfo)fromtelemetry.tsinto a shared utility with aClientTypeunion type ("vscode" | "intellij" | "vim" | "unknown")src/telemetry.ts- Use the sharedgetClientTypeinstead of the private methodsrc/http/tabbyApiClient.ts- Store and exposeclientInfoviagetClientInfo()getter (previously only used it to builduserAgentString)src/chat/index.ts-syncFeatureRegistration()gatestabby/chatregistration behindgetClientType(...) === "vscode"Verification
Related
Fixes #4486, vim-tabby#40