Dynamic registration attempted without capability check, crash when client returns "no handler" error for `client/registerCapability`
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- backend-api-design, tooling
Research direction
Start with the initialization/initialized exchange and the client/registerCapability request shown in the issue, then inspect the TypeScript source behind out/index.js and the vscode-jsonrpc connection path mentioned in the stack trace. Done means unsupported dynamic registration is avoided and a -32601 registration response no longer crashes the server; verify with the OpenCode reproduction or a focused protocol test.
Written by the indexing model from the issue text.
Description
Describe the bug
When connecting to clients that do not support dynamic registration for workspace/didChangeConfiguration, MATLAB-language-server attempts to dynamically register anyways and crashes if the client replies -32601 (no handler). This was observed with OpenCode v1.0.33.
Steps to reproduce
- Start matlab-language-server with a client (such as OpenCode v1.0.33) that:
- does not advertise
capabilities.workspace.didChangeConfiguration.dynamicRegistration: true - responds to
client/registerCapabilitywith-32601(no handler)
- does not advertise
- Complete initialize/initialized.
- Server unconditionally sends
client/registerCapabilityforworkspace/didChangeConfiguration. - Client replies with "no handler" error; server crashes due to unhandled registration failure.
Expected behavior
- Only attempt dynamic registration when
dynamicRegistrationset to true. - Treat registration errors as non-fatal and continue.
Environment
- MATLAB-language-server Version: v1.3.6
- MATLAB Version: R2025b Update 1 (25.2.0.3042426) 64-bit (glnxa64)
- OS Version: Ubuntu 24.04.3 LTS as devcontainer (mcr.microsoft.com/devcontainers/base:ubuntu-24.04) with MATLAB feature (ghcr.io/mathworks/devcontainer-features/matlab)
- Language Server Client: OpenCode v1.0.33.
Additional information
Example traffic between `opencode` and `matlab-langauge-server`
Example traffic between opencode and matlab-langauge-server
stdin:
Content-Length: 608
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"rootUri":"file:///workspaces/agentic-matlab-example","processId":27266,"workspaceFolders":[{"name":"workspace","uri":"file:///workspaces/agentic-matlab-example"}],"initializationOptions":{"MATLAB":{"installPath":"/opt/matlab/R2025b","indexWorkspace":false,"matlabConnectionTiming":"onStart","telemetry":false,"signIn":true,"prewarmGraphics":false}},"capabilities":{"window":{"workDoneProgress":true},"workspace":{"configuration":true},"textDocument":{"synchronization":{"didOpen":true,"didChange":true},"publishDiagnostics":{"versionSupport":true}}}}}Content-Length: 52
{"jsonrpc":"2.0","method":"initialized","params":{}}Content-Length: 245
{"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{"MATLAB":{"installPath":"/opt/matlab/R2025b","indexWorkspace":false,"matlabConnectionTiming":"onStart","telemetry":false,"signIn":true,"prewarmGraphics":false}}}}Content-Length: 9598
{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///workspaces/agentic-matlab-example/pronav_intercept.m","languageId":"objective-c","version":0,"text":"%% pronav_intercept.m\n%\n% This script simulates and visualizes ..."}}}Content-Length: 103
{"jsonrpc":"2.0","id":0,"error":{"code":-32601,"message":"Unhandled method client/registerCapability"}}Content-Length: 197
{"jsonrpc":"2.0","id":1,"result":[{"MATLAB":{"installPath":"/opt/matlab/R2025b","indexWorkspace":false,"matlabConnectionTiming":"onStart","telemetry":false,"signIn":true,"prewarmGraphics":false}}]}Content-Length: 197
{"jsonrpc":"2.0","id":2,"result":[{"MATLAB":{"installPath":"/opt/matlab/R2025b","indexWorkspace":false,"matlabConnectionTiming":"onStart","telemetry":false,"signIn":true,"prewarmGraphics":false}}]}Content-Length: 197
{"jsonrpc":"2.0","id":3,"result":[{"MATLAB":{"installPath":"/opt/matlab/R2025b","indexWorkspace":false,"matlabConnectionTiming":"onStart","telemetry":false,"signIn":true,"prewarmGraphics":false}}]}
stdout:
Content-Length: 134
{"jsonrpc":"2.0","method":"window/logMessage","params":{"type":4,"message":"(02:41:58) matlabls: Log Directory: /tmp/matlabls_27270"}}Content-Length: 583
{"jsonrpc":"2.0","id":0,"result":{"capabilities":{"codeActionProvider":true,"completionProvider":{"triggerCharacters":[".","("," ",",","/","\\"]},"definitionProvider":true,"documentFormattingProvider":true,"documentRangeFormattingProvider":true,"executeCommandProvider":{"commands":["matlabls.lint.suppress.line","matlabls.lint.suppress.file"]},"foldingRangeProvider":true,"referencesProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",","]},"documentSymbolProvider":true,"renameProvider":{"prepareProvider":true},"documentHighlightProvider":true,"textDocumentSync":2}}}Content-Length: 201
{"jsonrpc":"2.0","id":0,"method":"client/registerCapability","params":{"registrations":[{"id":"aca83dcb-6596-4cd0-b267-0526a0f33060","method":"workspace/didChangeConfiguration","registerOptions":{}}]}}Content-Length: 101
{"jsonrpc":"2.0","id":1,"method":"workspace/configuration","params":{"items":[{"section":"MATLAB"}]}}Content-Length: 101
{"jsonrpc":"2.0","id":2,"method":"workspace/configuration","params":{"items":[{"section":"MATLAB"}]}}Content-Length: 125
{"jsonrpc":"2.0","method":"telemetry/logdata","params":{"eventKey":"ACTIONS","data":{"action_type":"openFile","result":"9"}}}Content-Length: 101
{"jsonrpc":"2.0","id":3,"method":"workspace/configuration","params":{"items":[{"section":"MATLAB"}]}}
stderr:
(node:27270) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
webpack://matlab-language-server/node_modules/vscode-jsonrpc/lib/common/connection.js:565
responsePromise.reject(new messages_1.ResponseError(error.code, error.message, error.data));
^
ResponseError: Unhandled method client/registerCapability
at handleResponse (webpack://matlab-language-server/node_modules/vscode-jsonrpc/lib/common/connection.js:565:1)
at handleMessage (webpack://matlab-language-server/node_modules/vscode-jsonrpc/lib/common/connection.js:345:1)
at processMessageQueue (webpack://matlab-language-server/node_modules/vscode-jsonrpc/lib/common/connection.js:362:1)
at Immediate.<anonymous> (webpack://matlab-language-server/node_modules/vscode-jsonrpc/lib/common/connection.js:334:1)
at process.processImmediate (node:internal/timers:485:21) {
code: -32601,
data: undefined
}
Thrown at:
at handleResponse (/opt/matlab-language-server/out/index.js:43412:48)
at handleMessage (/opt/matlab-language-server/out/index.js:43192:13)
at processMessageQueue (/opt/matlab-language-server/out/index.js:43209:17)
at /opt/matlab-language-server/out/index.js:43181:13
at processImmediate (node:internal/timers:485:21)
Node.js v22.21.1
Example `opencode.json` lsp config for `matlab-language-server`
Example opencode.json lsp config for matlab-language-server
{
"$schema": "https://opencode.ai/config.json",
"lsp": {
"matlab": {
"command": ["matlab-language-server", "--stdio"],
"extensions": [".m"],
"env":{
"MLM_LICENSE_FILE": "{env:MLM_LICENSE_FILE}"
},
"initialization": {
"MATLAB": {
"installPath": "/opt/matlab/R2025b",
"indexWorkspace": false,
"matlabConnectionTiming": "onStart",
"telemetry": false,
"signIn": true,
"prewarmGraphics": false
}
}
}
},
...
}
- Dominant language
- TypeScript
- Stars
- 125
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mathworks/MATLAB-language-server
-
documentation enhancement
Difficulty 1/5 1-3 hours Newbie friendliness 62/100
mathworks/MATLAB-language-server#27 · 10 comments ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
mathworks/MATLAB-language-server#82 · 1 reaction ·
-
Add progress handler Openenhancement
Difficulty 4/5 3-5 days Newbie friendliness 45/100
mathworks/MATLAB-language-server#81 · 4 comments ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
mathworks/MATLAB-language-server#79 · 7 comments ·
-
`--matlabLaunchCommandArgs` does not accept value starting with "-" (Not enough arguments following) Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
mathworks/MATLAB-language-server#78 · 8 comments ·
All issues in mathworks/MATLAB-language-server
Similar issues
-
Type/Bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenNSW/nsw-srilanka#497 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
0xMiden/bridge-portal#132 ·
-
react-doctor severity:warning tech-debt
Difficulty 1/5 Under an hour Newbie friendliness 88/100
digidem/comapeo-cloud-app#403 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100