feat(detect-agent): check AGENT env var for generic agent detection#15350
Open
sleitor wants to merge 2 commits into
Open
feat(detect-agent): check AGENT env var for generic agent detection#15350sleitor wants to merge 2 commits into
sleitor wants to merge 2 commits into
Conversation
Add support for the emerging AGENT=<name> convention alongside AI_AGENT. This is used by Goose, Amp, Bun, and others. Closes vercel#15336
|
Contributor
Author
|
👋 Gentle ping — just checking if this is still on the radar for review. Happy to address any feedback or rebase if needed! |
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.
Summary
Add
AGENTenv var detection to@vercel/detect-agent, checked afterAI_AGENTand before tool-specific vars.An emerging convention uses
AGENT=<agent-name>to signal agent presence:AGENT=goose(PR)AGENT=amp(docs)AGENT=1(PR #21135)Changes
src/index.ts: AddAGENTcheck (position 2, afterAI_AGENT, before tool-specific vars)test/unit/determine-agent.test.ts: Add detection, edge case, and priority testsCloses #15336
Note
Low Risk Change
This PR adds a new environment variable check (AGENT) for agent detection, which is a straightforward feature addition with proper validation (trim and empty check) and comprehensive test coverage.
Risk assessment for commit f017c0c.