tabby icon indicating copy to clipboard operation
tabby copied to clipboard

Agent crash with Kate editor

Open Mte90 opened this issue 1 year ago • 1 comments

I just tried to setup the LSP server on the Kate kde editor with this settings:

"php": {
            "command": ["npx", "tabby-agent", "--lsp", "--stdio"],
            "path": ["/usr/local/bin"],
            "url": "https://tabby.tabbyml.com/"
        },
        "python": {
            "command": ["npx", "tabby-agent", "--lsp", "--stdio"],
            "path": ["/usr/local/bin"],
            "url": "https://tabby.tabbyml.com/"
        }

So now tabby is executed like the others.

Just created a php file and crashed with this error:

/home/mte90/.npm/_npx/1d13cd4238ddbf8f/node_modules/tabby-agent/dist/node/index.js:51
${JSON.stringify(q.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else {let le=q.id,me=I.get(le);if(ho(q,me),me!==void 0){I.delete(le);try{if(q.error){let Ue=q.error;me.reject(new st.ResponseError(Ue.code,Ue.message,Ue.data));}else if(q.result!==void 0)me.resolve(q.result);else throw new Error("Should never happen.")}catch(Ue){Ue.message?i.error(`Response handler '${me.method}' failed with message: ${Ue.message}`):i.error(`Response handler '${me.method}' failed unexpectedly.`);}}}}function ze(q){if(Je())return;let le,me;if(q.method===Vd.type.method){let Ue=q.params.id;C.delete(Ue),pn(q);return}else {let Ue=f.get(q.method);Ue&&(me=Ue.handler,le=Ue.type);}if(me||A)try{if(pn(q),me)if(q.params===void 0)le!==void 0&&le.numberOfParams!==0&&le.parameterStructures!==st.ParameterStructures.byName&&i.error(`Notification ${q.method} defines ${le.numberOfParams} params but received none.`),me();else if(Array.isArray(q.params)){let Ue=q.params;q.method===Gd.type.method&&Ue.length===2&&xQ.is(Ue[0])?me({token:Ue[0],value:Ue[1]}):(le!==void 0&&(le.parameterStructures===st.ParameterStructures.byName&&i.error(`Notification ${q.method} defines parameters by name but received parameters by position`),le.numberOfParams!==q.params.length&&i.error(`Notification ${q.method} defines ${le.numberOfParams} params but received ${Ue.length} arguments`)),me(...Ue));}else le!==void 0&&le.parameterStructures===st.ParameterStructures.byPosition&&i.error(`Notification ${q.method} defines parameters by position but received parameters by name`),me(q.params);else A&&A(q.method,q.params);}catch(Ue){Ue.message?i.error(`Notification handler '${q.method}' failed with message: ${Ue.message}`):i.error(`Notification handler '${q.method}' failed unexpectedly.`);}else G.fire(q);}function fe(q){if(!q){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
                                                                                                                                                                                                                                            ^
e [Error]: client/unregisterCapability
    at ye (/home/mte90/.npm/_npx/1d13cd4238ddbf8f/node_modules/tabby-agent/dist/node/index.js:51:237)
    at ut (/home/mte90/.npm/_npx/1d13cd4238ddbf8f/node_modules/tabby-agent/dist/node/index.js:50:6273)
    at Fe (/home/mte90/.npm/_npx/1d13cd4238ddbf8f/node_modules/tabby-agent/dist/node/index.js:50:6400)
    at Immediate. (/home/mte90/.npm/_npx/1d13cd4238ddbf8f/node_modules/tabby-agent/dist/node/index.js:50:6158)
    at process.processImmediate (node:internal/timers:483:21) {
  code: -32601,
  data: undefined
}
Node.js v20.18.0

Mte90 avatar Nov 15 '24 11:11 Mte90

I think that the issue is on https://github.com/TabbyML/tabby/blob/main/clients/tabby-agent/src/protocol.ts#L100 and it is missing that capability.

It isn't better if the capabilities to avoid a crash and just report the error, like this capabilities is not supported yet?

Mte90 avatar Nov 15 '24 11:11 Mte90