Repository navigation
feat(analytics): enhance command tracking with agent identification properties - #1553
Conversation
|
Several issues to fix before merging: 1. // fix
{envVar: "COPILOT_AGENT_SESSION_ID", agentName: "github-copilot"},2. // fix
{envVar: "CODEX_THREAD_ID", agentName: "codex"},
{envVar: "CODEX_SANDBOX", agentName: "codex"},3. 4. Antigravity ( {envVar: "ANTIGRAVITY_CONVERSATION_ID", agentName: "antigravity"},5. MCP server detection doesn't work via either path Suggested enhancement: wildcard sweep for unknown future agents for _, e := range os.Environ() {
key, val, ok := strings.Cut(e, "=")
if !ok || val == "" {
continue
}
upper := strings.ToUpper(key)
if strings.HasSuffix(upper, "_CONVERSATION_ID") ||
strings.HasSuffix(upper, "_THREAD_ID") ||
strings.HasSuffix(upper, "_AGENT_SESSION_ID") {
return "unknown-agent"
}
} |
|
|
8b882ce
into
DXCDT-1862-enhance-command-tracking-with-additional-properties
…1552) * feat(analytics): enhance command tracking with additional properties * feat(analytics): enhance command tracking with agent identification properties (#1553) * feat(analytics): enhance command tracking with agent identification properties * enhance agent detection with additional environment variables and process info caching * remove un-necessary func * feat(agent-detection): enhance agent detection with final env variables
…ents (#1551) * feat(analytics): enhance command tracking with success and failure events * feat(analytics): improve error handling for API responses * feat(analytics): unify command tracking events under a single method * feat(analytics): enhance command tracking with additional properties (#1552) * feat(analytics): enhance command tracking with additional properties * feat(analytics): enhance command tracking with agent identification properties (#1553) * feat(analytics): enhance command tracking with agent identification properties * enhance agent detection with additional environment variables and process info caching * remove un-necessary func * feat(agent-detection): enhance agent detection with final env variables





🔧 Changes
This pull request introduces a robust agent detection system to the CLI, allowing the application to identify which AI agent or client is invoking the CLI.
📚 References
DXCDT-1876
🔬 Testing
Added agent_detection_test.go
📝 Checklist