Skip to content

Conversation

@aliaksandr-trush
Copy link
Contributor

@aliaksandr-trush aliaksandr-trush commented Apr 24, 2024

Start adding chat actions functionality.
Already able to send GenerateCode prompt, but unable to receive response yet (need to find how to receive chat response).

@aliaksandr-trush
Copy link
Contributor Author

Receiving error on server logs:
E0504 23:30:17.785258 1108311 wire_format.go:24] Error unmarshalling request: proto: cannot parse invalid wire-format data
E0504 23:30:17.785309 1108311 web_server.go:166] ParseRequest error: proto: cannot parse invalid wire-format data

For request:
{"get_chat_message_request": {"chat_messages": [{"in_progress": false, "source": "CHAT_MESSAGE_SOURCE_USER", "intent": {"explain_function": {"language": 20, "file_path": "/home/user/Projects/CodeiumJetBrains/src/main/kotlin/com/codeium/intellij/chat_server_client/ChatServerClient.kt", "function_info": {"definitionLine": 45, "cleanFunction": "fun getClientUrl(): String {\n return "http://127.0.0.1:${languageServerService.chatClientPort}"\n}", "rawSource": "/** Get the full http:// URL for the chat client. /\nfun getClientUrl(): String {\n return "http://127.0.0.1:${languageServerService.chatClientPort}"\n}", "language": "LANGUAGE_KOTLIN", "leadingWhitespace": " ", "startLine": 44, "params": "()", "startCol": 2, "docstring": "Get the full http:// URL for the chat client./", "nodeName": "getClientUrl", "endCol": 3, "endLine": 47}}}, "conversation_id": "l5xMoayMvmLRbB7yO6dSc4i6DeLt3EbS", "timestamp": {"nanos": 1.233246e10, "seconds": 1714858569}, "message_id": "user-12332463000"}], "metadata": {"extension_name": "neovim", "ide_name": "neovim", "request_id": 79, "api_key": "5cf09402-0460-47cc-a015-7d519fa37bb0", "extension_version": "1.8.25", "ide_version": "0.9.5"}}}

Could somebody help me find the reason of such errors?

@pqn
Copy link
Collaborator

pqn commented Jul 9, 2024

The server thinks you are passing in proto wire format instead of JSON for some reason? We are using Connect: https://connectrpc.com/docs/protocol/

@aliaksandr-trush
Copy link
Contributor Author

The server thinks you are passing in proto wire format instead of JSON for some reason? We are using Connect: https://connectrpc.com/docs/protocol/

Error message above related to Chat API: I am sending json message from the comment to url = "ws://127.0.0.1:/connect/ide" via web socket.

@jakubbortlik
Copy link

Hi @aliaksandr-trush it doesn't seem you are working on this anymore, are you? I'm very much interested in having Chat for Windsurf available right inside Neovim, so I'm considering adding an adapter to CodeCompanion.nvim, instead of working with the Web App Chat. I've got some hints from the author of CodeCompanion on how to start investigating the Windsurf API with mitmproxy, but I'm wondering whether you'd have some idea if the stuff you introduce in your PR could be used to build an adapter for CodeCompanion. Thanks!

@jakubbortlik jakubbortlik mentioned this pull request Jun 20, 2025
@aliaksandr-trush
Copy link
Contributor Author

Hi @jakubbortlik ,
API description you can find in these proto files https://github.com/Exafunction/CodeiumJetBrains/tree/main/proto/exa

In my PR I've defined some calls using LUA language, but the main issue is to establish connection between client and server. My latest assumptions were that we need to send Proto Message via WebSockets and I've stacked on this step :)

@jakubbortlik
Copy link

jakubbortlik commented Jun 23, 2025

прывет @aliaksandr-trush, thanks for your response. Are you sure the proto files are up-to-date? The repo hasn't been committed to for 2 years - they haven't even changed the logo as they did for the VisualStudio plugin two months ago. They must be developing the real thing somewhere else :)

@pqn would it be possible to get any help on this?

@jakubbortlik
Copy link

jakubbortlik commented Aug 18, 2025

The server thinks you are passing in proto wire format instead of JSON for some reason? We are using Connect: https://connectrpc.com/docs/protocol/

Hi, @pqn I'm experimenting with Windsurf Chat in Neovim by extending windsurf.nvim, but I'm struggling to send the correct GetChatMessage request, as I'm getting errors like

[codeium/codeium] [DEBUG 01:23:19] /home/me/projects/windsurf.nvim/lua/codeium/api.lua:424: '\2\0\0\0}{"error":{"code":"invalid_argument","message":"protocol error: promised 24846967 bytes in enveloped message, got 766 bytes"}}'

Could you please give me some hints on how to format the message for GetChatMessage in Lua? I haven't found any resources online. The website you linked https://connectrpc.com/docs/protocol doesn't seem to contain any information about the Connect protocol in Lua.

Tagging @jcdickinson as one of the earlier major contributors to the plugin. Sorry if you are no longer connected with this project. I'm looking for anybody who'd be willing to help. @pqn seems to be employed elsewhere now.

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.

3 participants