Repository navigation
feat(comment): show which agent posted a comment - #2471
Merged
gregberge merged 2 commits intoAug 13, 2026
Merged
Conversation
An agent acts with its user's own credentials, so a comment Claude Code or an MCP client writes is indistinguishable from one the person typed. Record the agent behind the request — the CLI's `agent/<name>` User-Agent token, or the OAuth client behind an MCP tool call — and mark the comment with the agent's logo, or a generic bot, on the author's avatar. Also switches the insert to `insertAndFetch`: `insert` returned a model missing every database-defaulted column, so `createBuildComment` over MCP failed its own output-schema validation on a null `resolvedAt`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude Code sets AI_AGENT to `claude-code_2-1-227_agent`, and the AI_AGENT convention documents `devin@1`. Both reached the registry whole and resolved to the generic bot, so the one agent most likely to post a comment lost its own logo. Strip the version before the lookup. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
1 screenshot uploaded by Argos
Uploaded with Argos ↗︎. This comment is updated in place. |
4 of 5 tasks
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
gregberge
deleted the
greg/arg-496-let-the-agent-identify-itself-in-mcp-cli
branch
August 13, 2026 20:54
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.

Closes ARG-496. Part 2 of 2 — the CLI half is argos-ci/argos-javascript#367. They ship independently: the backend reads the header whatever CLI version sent it.
An agent acts with its user's own credentials, so a comment Claude Code or an MCP client writes is indistinguishable from one the person typed. This records which agent was behind the request and marks the comment with it.
Two comments, same author. Only the one Claude Code posted is marked.
How a request is attributed
src/agent/request.tsresolves an agent from whichever signal the surface carries:agent/<name>token in theUser-Agent.knownAppId. An OAuth client that isn't the first-party CLI is taken to be an agent even when the known-apps registry doesn't recognize it, since OAuth exists here to serve the CLI and MCP clients and MCP is an agent protocol. Those storeunknownand render as a generic bot: we still know it was an agent, we just can't name it.Everything else — the web app, a script, a bare personal access token — resolves to
null.Names are matched against a curated registry (
src/agent/registry.ts) rather than stored verbatim. A self-asserted name is untrusted input (AI_AGENTis whatever the caller sets), and rendering one next to a real person's avatar is a spoofing vector. Ids are shared withoauth/known-apps.tswhere the same product appears in both, so the frontend keys one logo map by them.The rest
comments.agent, wired throughcreateComment.Comment.agent { id, name }on GraphQL and REST.CommentAgentBadgeon the author's avatar, matching the existing avatar-badge pattern inBuildReviewersStatusList. The logo map moved tocontainers/brand-logos.tsx, now shared withOAuthAppLogo.Worth a look during review
An unrelated MCP bug, fixed here.
Comment.query().insert()returns a model carrying only the columns written, soresolvedAt/editedAtcame backundefinedandcreateBuildCommentover MCP failed its own output-schema validation. Switched toinsertAndFetch. That tool was broken before this branch; the new MCP e2e test is what surfaced it.The second commit is a real-world correction. Running the built CLI against a local echo server showed Claude Code sets
AI_AGENT=claude-code_2-1-227_agent— a version suffix the registry didn't match, so the agent most likely to post a comment fell back to the generic bot.resolveReportedAgentIdnow strips the version (_, and the@the convention documents) before the lookup.Verified
pnpm run static-checks, unit (654) and integration (1189) suites all green.New coverage:
src/agent/request.test.ts— header parsing and the resolution order, including the versioned names agents really report.comments.e2e.test.ts— a comment posted with the exactUser-Agentthe CLI sends today, an unrecognized agent, and a person posting directly.mcp.e2e.test.ts— a comment through the MCP loopback, attributed from the OAuth client, recognized and not.project-tests.spec.ts— the badge on an agent comment and not on the one the same person typed, plus a screenshot.One MCP scope test flaked once under full-suite load (
body.resultundefined) and passed on re-run and in isolation — unrelated to this change.Not included
User-facing docs. They live in the
docsrepo and the issue didn't scope them; happy to follow up with a page on agent attribution.🤖 Generated with Claude Code