Resolve AI client from host app and tighten session detectors - #1613
Merged
Conversation
Client is cursor or vscode only; session detectors match grok/kilo/cowork/Copilot aliases without filling agent from TERM_PROGRAM.
Copilot and Claude both run inside JetBrains, Zed and VS Code, so deriving client from the agent mislabelled those sessions (Copilot in IntelliJ reported vscode). Read the window from editor-owned env instead, resolving VS Code forks before upstream so a Cursor session can never be labelled vscode.
After VS Code forks are ruled out, VSCODE_GIT_ASKPASS_MAIN/NODE prove the window without requiring COPILOT_AGENT.
Client stays AI-only but is no longer IDE-only. After known editors, standalone Claude reports itself, then TERM_PROGRAM maps to short names (iterm, warp, tmux). Inherited TERM_PROGRAM=vscode is still omitted.
The path is test data proving generic git askpass cannot label the host.
sankerr
reviewed
Aug 26, 2026
There was a problem hiding this comment.
🤖 Review comment by Cursor AI
Reviewed at 065e2a6e. Host independence, fail-open vscode, exported constants, unknown TERM_PROGRAM cardinality, and the Amazon Q marker citation are addressed.
Findings
✅ All findings have been resolved.
…rt wire constants.
sverdlov93
enabled auto-merge (squash)
August 26, 2026 11:58
Contributor
sankerr
approved these changes
Aug 26, 2026
lesnerd
approved these changes
Aug 26, 2026
omerzi
approved these changes
Aug 26, 2026
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
CLI telemetry stamps
clientwith the real host app of a proven agent session: known IDE first, then Claude Code as a standalone app, then a short terminal name. Session detection is tightened so grok, kilo, Claude cowork, Copilot, and alias names match product rules.Details
Host (
ai-client// JSONclient), strongest signal first:cursor,vscode,zed,jetbrains,windsurf,antigravity,codium,trae,visualstudiofrom editor-owned env (never rawTERM_PROGRAMfor forks).TERM_PROGRAM=vscode./cursor.app,/cursor/resources, or/.cursor-serverfor Remote-SSH), not a username in the path.VisualStudioVersion) is not labelledvscode.claude, not iTerm.TERM_PROGRAMto a short product name:iTerm.app→iterm,WarpTerminal→warp,Apple_Terminal→terminal,tmux→tmux.TERM_PROGRAMis empty or inheritedvscode, fall back toTMUX,WT_SESSION(windows-terminal), Ghostty, Kitty, or Alacritty.GIT_ASKPASSis not used as IDE proof.Session (
ai-agent/):KILOCODE_FEATURE=cli. Grok matches exactGROK_AGENT=1. Cowork is classified as Claude before the generic Claude detector.COPILOT_AGENT,COPILOT_AGENT_JOB_ID. Aliases such asgithub_copilot_vscode_agentandgrok-climap to canonical session names. The vscode-plugin alias is folded the same way as session detection (AI_AGENT/AGENT, case and@version) and last-resortsclienttovscodewhen no IDE is proven.Notes
Companion PRs: jfrog-cli tests, jfrog-agent-hooks stamp, jfrog-skills EXTRACT split. Merge this module first so CLI can bump
jfrog-cli-core.