Repository navigation
fix(cli): let an agent's own name beat editor and host markers - #7424
Conversation
TERM_PROGRAM=cursor|windsurf and Replit's REPL_ID only say where a shell runs. They now sit in their own list, checked after the AI_AGENT / AGENT name check, so Amp in a Cursor terminal or Devin in Replit report as themselves, and an unknown AI_AGENT there keeps its discovery hints. agentOnly had no users left, so it is gone. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@genesis-code-reviewer could you review this follow-up to #7423? It addresses your inline finding there: name-only agents (AI_AGENT, or a known AGENT name) now win over the Cursor/Windsurf/Replit markers, with an Amp-in-Cursor test. — Rames |
There was a problem hiding this comment.
Verdict: APPROVE · 0 blocker · 0 important · 1 nit
- nit:
packages/cli/src/telemetry/agent_runtime.ts:155, in the Cline rule comment: "Same integrated-terminal-only scope as the Cursor/Windsurf rules above." Those rules now live inWORKSPACE_RULESfurther down, so "above" points the wrong way.
Scope
Read both changed files in full and the callers of detectAgentRuntime/isAgentDriven (login, attendedTerminal, desktopApp, feedback, telemetryIdentity, system). isAgentDriven behaves the same as before: workspace rules had agentOnly: () => false and are now just left out. The new order matches @vercel/detect-agent 1.2.7, which also reads AI_AGENT before REPL_ID. CI is green on daad420; the PR is blocked only on review.
— Genesis
What
An agent recognised only by its own name (
AI_AGENT, or a known name inAGENT) now wins over the editor and host markers.TERM_PROGRAM=cursor|windsurfand Replit'sREPL_ID/REPLIT_USERmove into their own list, checked after the name check.Why
Follow-up to #7423 review. Those markers only say where a shell runs, not who drives it. Before this,
AI_AGENT=ampin a Cursor terminal reportedcursor,AGENT=devin_…in Replit reportedreplit, and an unknownAI_AGENTin Cursor lost its discovery hints, which are only sent for null andother_ai_agent.Related work
Refs #7423
How
WORKSPACE_RULESholds the Cursor terminal, Windsurf and Replit rules.detectAgentRuntimechecksVENDOR_RULES, then the name fallback, thenWORKSPACE_RULES.isAgentDrivennever counted those rules, so they are left out of it entirely. That leftagentOnlywith no users, so it is removed.Test plan
AGENT) in Replit, unknownAI_AGENTin Windsurf. Existing editor/person tests unchanged.vitest run src/telemetry src/utils/attendedTerminal.test.ts: 460/460;tsc --noEmit; comment gates pass.— Rames
🤖 Generated with Claude Code