Repository navigation
fix(protocol): rename client tools under an ordinary namespace - #182
Merged
jasonxu114514 merged 1 commit intoNov 16, 2026
Merged
Conversation
The free tier refuses the literal "clint_" in a tool name: the same shaped body is answered with 429 FreeUsageLimitError under clint_ and completes normally under any other prefix, so the rename itself is accepted and the prefix alone is what the gate matches. Keep the wire-name namespace a plain tool-like name instead of a gateway marker, and stop printing the literal in the READMEs so the docs do not pin a value that has to rotate. Verified live on a build of this commit: the captured 20-tool CLI body returns 200 and its tool call round-trips; the same build with the constant reverted returns 429. vet, gofmt, Linux and Windows builds pass.
This was referenced Nov 16, 2026
Closed
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Every shaped free-model request that carries
toolsis answered with429 Free usage limit reached(#178, #181). The same session withouttools— including the Playground — still works.Root cause
The free tier matches the literal
clint_on a wire tool name. Everything else about the body is accepted.Same captured official-CLI body (75,654 B, 20 tools,
max_completion_tokens: 32000,stream: true), same host and egress, replayed against a build of this branch:clint_(current main)FreeUsageLimitErrorCLINT_clint(no underscore)client_,copilot_,mcp_,srv_,fn_,zz_The rename itself is accepted and another client's vocabulary is still refused; the
clint_token is what trips the gate — case-insensitive, and the trailing underscore matters.A/B on this base, same binary apart from the constant:
14faec7+clint_429in 3.4 s14faec7+mcp_200in 2.6 s, tool call restored to the client'sshell; follow-up carrying the tool result200with the final answerSession id, project id and egress were identical in both runs, so session re-minting or per-egress quota accounting cannot explain it.
Change
ClientToolPrefixbecomesmcp_— one constant. Responses restore through the same constant (mayCarryToolName,ToolRenames.Resolve), so no other path moves. Comments that spelled the old literal now say "wire-name prefix", and the READMEs describe the wire name as namespace plus digest instead of naming the prefix, so the docs do not pin a value that has to rotate.mcp_is deliberate: it also prefixes MCP clients'mcp__<server>__<tool>names, so a rule that refuses it refuses genuine MCP traffic.clint_was free to ban because nothing legitimate starts with it.Verification
go vet ./...,gofmt -l ., Linux and Windows builds: clean. The repository carries no_test.gofiles, so no test is added for a constant.Known limit
Still a fixed string, so it can be learned again; the constant carries a
shortcut:note to rotate it when 429s return only on tool-bearing requests. A gate that matches the name shape rather than the prefix would defeat this hedge — the durable alternative, not renaming official-CLI traffic, does not cover Claude Code's vocabulary and is a larger behavioural change.