Skip to content

Conversation

@ghosert
Copy link
Contributor

@ghosert ghosert commented Jan 12, 2026

  1. Prefixes tool names with av_ for OAuth requests to bypass
    Anthropic's tool name validation
  2. Updated transform_tool function - Added use_prefix parameter to conditionally prefix tool names
  3. Added user-agent header - Set to claude-cli/2.1.2 (external, cli) for OAuth requests
  4. Fixed beta headers - Removed fine-grained-tool-streaming-2025-05-14 which causes 400 errors
  5. Added ?beta=true to URL - Required for OAuth requests
  6. Always show OAuth URL - For terminal environments without browsers, URL is always displayed and copied to clipboard
  7. Prefix tool names in parse_messages - Added prefix to tool_use items when auth_type == "max"
  8. Strip tool prefix in parse_response - Removes the av_ prefix from tool names in responses
  9. Pass use_prefix to transform_tool call - Enables tool name prefixing for OAuth

Also instead of using browser to open claude auth link, i asked avante to display the auth link in the message log, so that people can copy and paste to browser if they are in a terminal env instead of GUI, like you ssh to a remote machine and want to neovim there.

in lua/avante/config.lua, just add auth_type = 'max' to make it work like below:

claude = {
  endpoint = 'https://api.anthropic.com',
  model = 'claude-opus-4-5-20251101', -- Claude Opus 4.5 (latest)
  auth_type = 'max', -- Use Claude Max subscription via OAuth, otherwise use 'api'

Up to you guys if you want to use, but I won't be responsible for any punishment from Anthropic.

ghosert and others added 5 commits January 12, 2026 02:43
     Prefixes tool names with av_ for OAuth requests to bypass
Anthropic's tool name validation
  2. Updated transform_tool function - Added use_prefix parameter to
     conditionally prefix tool names
  3. Added user-agent header - Set to claude-cli/2.1.2 (external, cli)
     for OAuth requests
  4. Fixed beta headers - Removed fine-grained-tool-streaming-2025-05-14
     which causes 400 errors
  5. Added ?beta=true to URL - Required for OAuth requests
  6. Always show OAuth URL - For terminal environments without browsers,
     URL is always displayed and copied to clipboard
  7. Prefix tool names in parse_messages - Added prefix to tool_use
     items when auth_type == "max"
  8. Strip tool prefix in parse_response - Removes the av_ prefix from
     tool names in responses
  9. Pass use_prefix to transform_tool call - Enables tool name
     prefixing for OAuth

  The changes are ready for you to commit and submit as a PR to the
upstream yetone/avante.nvim repository.
The Claude provider's transform_tool function accepts an optional
use_prefix parameter for OAuth tool name prefixing, but the type
definition in types.lua only allowed 2 parameters, causing
redundant-parameter warnings.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
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.

1 participant