You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add the driving agent to the CLI's API User-Agent (#8505)
## Summary
Adds `agent/<name>` to the User-Agent of the CLI's API client when
`getDrivingAgent()` detects an agent, so the API can attribute deploys,
site creation, and other command calls to agents without relying on
telemetry. Also fires a telemetry event when `netlify recipes
ai-context` installs context.
## What changed
- `getRequestUserAgent()` in `command-helpers.ts` returns `USER_AGENT`,
plus ` agent/<name>` when an agent is detected (name only, no version or
source). `base-command.ts` passes it to the API client, so anonymous
deploys and the commands that reuse `apiOpts.userAgent` get it too. The
`USER_AGENT` text printed by `--version` and help is unchanged.
- `ai-context` recipe fires `sites_aiContextInstalled` with `{ consumer
}` when it creates or updates a context file.
`downloadAndWriteContextFiles` now returns whether it wrote anything and
rejects on a failed download or write, so failures and no-ops don't
count. The ticket's `ai_context_installed` fails the CLI's event-name
validation, so this uses the `sites` object like `sites_initStarted`.
`agent` comes from `track()` (#8504).
Linear:
https://linear.app/netlify/issue/EX-3044/augment-cli-calls-to-identify-if-an-agent-is-performing-the-call
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Nq1RjpFnzzsfZf5qHLCH36
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
0 commit comments