Repository navigation
feat(cli): identify the coding agent driving the CLI - #367
Merged
gregberge merged 1 commit intoAug 13, 2026
Merged
Conversation
Argos cannot tell a command a person typed from one an agent ran on their behalf — the token signing the request is the same either way. Detect the agent with @vercel/detect-agent and send it as an `agent/<name>` token in the User-Agent, so the API can attribute the action to it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
gregberge
deleted the
greg/arg-496-let-the-agent-identify-itself-in-mcp-cli
branch
August 13, 2026 20:55
This branch was successfully deployed
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.
Description
Part 1 of ARG-496 — the producer side. The backend half is argos-ci/argos#2471.
Argos cannot tell a command a person typed from one an agent ran on their behalf: the token signing the request is the same either way. This makes the CLI say so.
packages/cli—src/lib/user-agent.tsdetects the agent with@vercel/detect-agentonce at startup and sends it as a product token:The agent name is user input in the end —
@vercel/detect-agentreturnsAI_AGENTverbatim — so it is reduced to an HTTPtoken(RFC 9110 §5.6.2) and truncated. A name that could inject a header cannot survive that.packages/api-client—createClient({ userAgent })takes a string or a resolver, possibly async. Detection resolves at startup while clients are built synchronously in ~30 CLI call sites; a resolver keeps all of them unchanged instead of turningcreateApiClientasync.Verified
build,check-types,lint,check-formatandtestpass for both packages. Beyond the unit tests, I ran the built CLI against a local server that echoes the header:That run is also what caught the version suffix Claude Code really appends — the backend PR strips it before matching the agent registry.
Type of changes
enhancementChecklist
Optional checks:
🤖 Generated with Claude Code