Agent telemetry#36
Closed
purplecabbage wants to merge 7 commits into
Closed
Conversation
- Added `getInvocationContext` function to determine if the CLI is invoked by an AI agent or a human based on environment variables. - Updated `trackEvent` to include `invocation_context` and `agent_name` in the payload sent to the telemetry service. - Expanded test coverage for `trackEvent` and `getInvocationContext` to validate new functionality.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
shazron
reviewed
Apr 7, 2026
| } | ||
|
|
||
| // this is set by the init hook, ex. @adobe/aio-cli@8.2.0 | ||
| // TODO: detect VSCODE run as an agent |
| 'x-adobe-flow-id': '18dce8db-f523-4ff1-8806-0719de3fd367', | ||
| 'x-api-key': 'adobe_io', | ||
| 'sandbox-name': 'developer-lifecycle-dev1' | ||
| 'Api-Key': 'd6b73f9c1859dc462e6de8dee3de1eb2FFFFNRAL' |
Member
There was a problem hiding this comment.
there's a dupe in flush-worker, maybe centralize, not sure
| name: 'aio.cli.telemetry', | ||
| type: 'gauge', | ||
| value: 1, | ||
| // id: Math.floor(timestamp * Math.random()), |
Member
Author
|
Closing in favor of proxy version |
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.
Description
Flush architecture
await fetch()with a detached child process (flush-worker.js)so the parent CLI exits immediately without waiting on the HTTP POST
spawn argv (no ps-aux exposure)
Persistent retry queue (queue-store.js)
(honours XDG_CONFIG_HOME), separate from user-visible aio config
event and retries the full batch in a single POST
Agent detection
copilot-chat/copilotCli shims)
CURSOR_AGENT, CLAUDECODE, CLAUDE_CODE, GEMINI_CLI, CODEX_SANDBOX, AUGMENT_AGENT,
CLINE_ACTIVE, OPENCODE_CLIENT, REPL_ID, PATH (Copilot)
AIO_TELEMETRY_DISABLED env var
modifying the persisted opt-in state — suitable for CI pipelines
Payload format
([{ metrics: [{ name, type, value, timestamp, attributes }] }])
Tests
spawn-based assertions
README updated to reflect New Relic payload format, AIO_TELEMETRY_DISABLED,
flush architecture, and full agent detection table
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: