Add client info into avante for allow ACP whitelist in auggie #2930
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
Add client identification (
clientInfo) to the ACP (Agent Communication Protocol) initialize request to enable proper client whitelisting by ACP agents.Problem
When Avante connects to ACP agents like
auggie, the agent needs to identify and whitelist the connecting client. Currently, Avante only sendsprotocolVersionandclientCapabilitiesduring the ACP initialization handshake, but is missing theclientInfofield that contains the client's name and version.This causes issues with ACP agents that require client identification for whitelisting purposes. For example, auggie logs show it expects a user-agent string:
Without
clientInfo, ACP agents cannot properly identify Avante clients, potentially blocking or limiting functionality.Solution
This PR adds
clientInfosupport to the ACP client implementation with sensible defaults.Changes Made
ClientInfotype definition withnameandversionfieldsACPClientclass to includeclient_infofieldACPClient:new()to initializeclient_infowith defaults:"avante.nvim""0.0.1"initializerequest to includeclientInfoin the parameters sent to ACP agentsconfigparameter inACPClient:new()ACP Initialize Request (Before)
{ "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": { "protocolVersion": 1, "clientCapabilities": { "fs": { "readTextFile": true, "writeTextFile": true } } } }ACP Initialize Request (After)
{ "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": { "protocolVersion": 1, "clientInfo": { "name": "avante.nvim", "version": "0.0.1" }, "clientCapabilities": { "fs": { "readTextFile": true, "writeTextFile": true } } } }Testing
Tested with auggie ACP client to verify:
clientInfois properly sent in the initialize requestUsed local config to test this out
Before:

After:

Impact
This change enables Avante to work properly with ACP agents that require client identification for whitelisting, such as auggie and other ACP-compliant agents. It follows the ACP protocol specification (similar to LSP) which requires clients to identify themselves during initialization.
Related