Skip to content

Conversation

@justinxu421
Copy link
Contributor

@justinxu421 justinxu421 commented Jan 21, 2026

Summary

Add client identification (clientInfo) to the ACP (Agent Communication Protocol) initialize request to enable proper client whitelisting by ACP agents.

Problem

When Agentic.nvim connects to ACP agents like auggie, the agent needs to identify and whitelist the connecting client. Currently, Agentic.nvim only sends protocolVersion and clientCapabilities during the ACP initialization handshake, but is missing the clientInfo field 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:

'ACPSessionManager': Using session user-agent: augment.cli/0.15.0-prerelease.4 (commit 7a31a643)/acp

Without clientInfo, ACP agents cannot properly identify Agentic.nvim clients, potentially blocking or limiting functionality.

Solution

This PR adds clientInfo support to the ACP client implementation with sensible defaults.

Changes Made

  • Updated ACPClient:_connect() to include clientInfo in the initialize request parameters
  • The clientInfo field (already defined in capabilities) is now explicitly sent as a separate parameter
  • Client identifies as:
    • Name: "Agentic.nvim"
    • Version: "0.0.1"

ACP Initialize Request (Before)

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "initialize",
  "params": {
    "protocolVersion": 1,
    "clientCapabilities": {
      "fs": {
        "readTextFile": true,
        "writeTextFile": true
      },
      "terminal": false,
      "clientInfo": {
        "name": "Agentic.nvim",
        "version": "0.0.1"
      }
    }
  }
}

ACP Initialize Request (After)

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "initialize",
  "params": {
    "protocolVersion": 1,
    "clientInfo": {
      "name": "Agentic.nvim",
      "version": "0.0.1"
    },
    "clientCapabilities": {
      "fs": {
        "readTextFile": true,
        "writeTextFile": true
      },
      "terminal": false,
      "clientInfo": {
        "name": "Agentic.nvim",
        "version": "0.0.1"
      }
    }
  }
}

Testing

Tested with auggie ACP client to verify:

  • clientInfo is properly sent in the initialize request
  • ✅ ACP agents can identify and whitelist Agentic.nvim clients
  • ✅ Default values work correctly

Use this config

  {
    dir = "/Users/justinxu/acp/agentic.nvim",
    opts = {
      provider = "claude-acp",
      acp_providers = {
        -- Override claude-acp to use auggie instead
        ["claude-acp"] = {
          name = "Auggie ACP",
          command = "auggie",
          args = {
            "--acp",
            "--log-file", "/tmp/agentic-acp-log.txt",
            "--permission", "*:allow",
          },
          env = {
            NODE_NO_WARNINGS = "1",
            IS_AI_TERMINAL = "1",
          },
        },
      },
    },
    keys = {
      {
        "<leader>ag",
        function() require("agentic").toggle() end,
        mode = { "n", "v", "i" },
        desc = "Toggle Agentic Chat"
      },
      {
        "<leader>as",
        function() require("agentic").add_selection_or_file_to_context() end,
        mode = { "n", "v" },
        desc = "Add file or selection to Agentic Context"
      },
      {
        "<leader>an",
        function() require("agentic").new_session() end,
        mode = { "n", "v", "i" },
        desc = "New Agentic Session"
      },
    },
  },

Before:
image

After:
image

Impact

This change enables Agentic.nvim 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.

@coderabbitai
Copy link

coderabbitai bot commented Jan 21, 2026

📝 Walkthrough

Walkthrough

The ACP client initialization request now includes a new field: clientInfo = self.capabilities.clientInfo. The initialize payload sent during connection establishment therefore contains protocolVersion, clientCapabilities, and clientInfo. No other logic or control-flow changes were made.

Poem

🐰 A nibble of code, a small delight,

Protocol and caps align just right,
ClientInfo hops into the start,
A tiny change with a thoughtful heart,
Hooray — the handshake gains a bit more light!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding clientInfo to enable ACP agent whitelisting.
Description check ✅ Passed The description comprehensively explains the problem, solution, and changes with clear before/after examples and testing verification.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@justinxu421 justinxu421 marked this pull request as ready for review January 21, 2026 20:26
@justinxu421 justinxu421 marked this pull request as draft January 21, 2026 20:28
@justinxu421 justinxu421 marked this pull request as ready for review January 21, 2026 20:53
Copy link
Owner

@carlos-algms carlos-algms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, that was definitely a leftover.

clientInfo was created exclusively to be passed here, but I forgot 🙈

@carlos-algms carlos-algms merged commit 9939466 into carlos-algms:main Jan 22, 2026
8 checks passed
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.

2 participants