Add Client → Agent → Model identity for telemetry and User-Agent - #1602
Open
sverdlov93 wants to merge 9 commits into
Open
Add Client → Agent → Model identity for telemetry and User-Agent#1602sverdlov93 wants to merge 9 commits into
sverdlov93 wants to merge 9 commits into
Conversation
Expand agent detection (aliases, AI_AGENT, broader env table) and record ai_client/ai_model for agent sessions so CLI User-Agent and visibility metrics can attribute harness, client app, and model consistently.
Copy ai_client/ai_model through reportUsageToVisibilitySystem (they were collected then dropped), cap sanitized token length, and document that detection/metrics are best-effort: no errors, no logs, never fail a command.
Field/metrics name is Client; wire User-Agent token stays ai-client/ beside ai-agent/ and ai-model/. Stack: Client → Agent → Model.
Wire token stays ai-model/; env remains JFROG_CLI_AI_MODEL.
Drop IDE/IPC/config false positives, add verified Cursor/Kilo/Roo/Windsurf/Copilot markers, and collapse alias lookup into a single map.
Drop CURSOR_TRACE_ID, Copilot config envs, and Claude IDE-terminal leaks that misclassify humans; keep TRACE_ID for correlation after a strong cursor hit.
Contributor
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.

Overview
Adds a three-axis AI invocation identity — Client → Agent → Model — to
ExecutionContext, Call-Home / Visibility telemetry, and (via jfrog-cli) the outbound User-Agent. Human sessions stay byte-identical: client and model are recorded only when an agent is detected.Details
ExecutionContext:Client(JSONclient, sanitizedTERM_PROGRAM),Agent,Model(JSONmodel, sanitizedJFROG_CLI_AI_MODEL).AI_AGENT/AGENTcanonicalize through a single lookup map; unrecognized non-empty values →unknown.sanitizeToken: lowercase +[a-z0-9._-], max 64 chars, before anything reaches metrics/wire.commandsCountLabelsJSON fieldsclient/model.Supported identity
agentai-agent/<name>AI_AGENT/AGENTclientai-client/<app>TERM_PROGRAM(any host; not an allowlist)modelai-model/<slug>JFROG_CLI_AI_MODELAgents (wire name → session signals)
claudeCLAUDE_CODE_CHILD_SESSIONgeminiGEMINI_CLIgooseGOOSE_TERMINALcursorCURSOR_AGENT,CURSOR_EXTENSION_HOST_ROLE=agent-execcopilotCOPILOT_CLI,COPILOT_AGENT_SESSION_IDkilocodeKILOCODE_FEATURE,KILO_PIDroo_codeROO_ACTIVE,ROO_CLI_RUNTIMEcodexCODEX_CI,CODEX_THREAD_ID,CODEX_SANDBOXwindsurfWINDSURF_CASCADE_TERMINALaiderAI_AGENT/AGENTonlyclineCLINE_ACTIVEopencodeOPENCODE,OPENCODE_CLIENTampAMP_CURRENT_THREAD_IDaugmentAUGMENT_AGENTqwenQWEN_CODEantigravityANTIGRAVITY_AGENTcrushCRUSHiflowIFLOW_CLItraeTRAE_AI_SHELL_IDamazon_qAI_AGENT/AGENTonlyunknownAI_AGENT/AGENTunrecognized valueAliases:
claude-code→claude,gemini-cli→gemini,cursor-cli→cursor,github-copilot/copilot-cli→copilot,roo-code→roo_code,amazon-q/amazon-q-cli→amazon_q,qwen-code→qwen.Source of truth in-repo: comment table above
agentEnvDetectorsincommon/commands/execution_context.go.Flow
Notes
go.modto a published pseudo-version (never commitreplace).detect_harness+ Coralogix coalescing (ARCHITECTURE.mdAgent identity table).JFROG_CLI_AI_MODELis set — skills still carrymodel=on the wire.Review follow-up
Tightened detectors to strong session markers only: dropped
CURSOR_TRACE_ID, Copilot config envs (COPILOT_MODEL/COPILOT_ALLOW_ALL), and Claude IDE-terminal leaks (CLAUDECODE/CLAUDE_CODE/CLAUDE_CODE_ENTRYPOINT) that misclassify humans.CURSOR_TRACE_IDremains for correlation after a strong cursor hit.