Skip to content

RTECO-1017 - Enrich User-Agent with agent/CI context and reuse Cursor…#3468

Open
fluxxBot wants to merge 1 commit intomasterfrom
RTECO-1017-CIdetect
Open

RTECO-1017 - Enrich User-Agent with agent/CI context and reuse Cursor…#3468
fluxxBot wants to merge 1 commit intomasterfrom
RTECO-1017-CIdetect

Conversation

@fluxxBot
Copy link
Copy Markdown
Contributor

@fluxxBot fluxxBot commented May 4, 2026

  • All tests have passed. If this feature is not already covered by the tests, new tests have been added.
  • The pull request is targeting the master branch.
  • The code has been validated to compile successfully by running go vet ./....
  • The code has been formatted properly using go fmt ./....

Summary

Wires the invocation-context detection from jfrog-cli-core PR #XXX into jf:

  • Appends agent + CI info to the User-Agent header sent to Artifactory.
  • Reuses CURSOR_TRACEID (when invoked from Cursor) as the Uber Trace ID instead of generating a fresh one, so server-side logs correlate end-to-end with the agent's trace.

Motivation

Differentiate human / CI / agent invocations of jf. Surface agent identity in every API call so support and observability can attribute traffic correctly without parsing metric payloads separately.

Changes

  • main.go:
    • setUberTraceIdToken reuses ExecutionContext.TraceID (currently CURSOR_TRACEID) when present; falls back to the existing 16-char hex generator otherwise.
    • New buildEnrichedUserAgent appends (agent; ci=<system>) to the base CLI User-Agent. Empty when neither agent nor CI is detected.
  • go.mod — temporary local replace directive pointing at the sibling jfrog-cli-core worktree. Must be dropped and replaced with a version bump once the core PR merges and
    tags.

Examples

Context User-Agent
Plain shell jfrog-cli-go/2.103.0
Cursor jfrog-cli-go/2.103.0 (cursor)
Claude Code jfrog-cli-go/2.103.0 (claude)
Windsurf in GitHub Actions jfrog-cli-go/2.103.0 (windsurf; ci=github_actions)
GitHub Actions, no agent jfrog-cli-go/2.103.0 (ci=github_actions)

@fluxxBot fluxxBot added the new feature Automatically generated release notes label May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature Automatically generated release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant