feat: Add v0 detection, improve cursor detection#9
Merged
blainekasten merged 4 commits intoMay 29, 2026
Conversation
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
| return {"is_agent": True, "agent": {"name": PI}} | ||
|
|
||
| if os.environ.get("CURSOR_AGENT"): | ||
| if os.environ.get("CURSOR_TRACE_ID"): |
Collaborator
There was a problem hiding this comment.
@cursoragent can you do some web searching to see if these changes for the cursor agent detection are accurate? I think these changes are actually wrong based on my experience
Contributor
Author
There was a problem hiding this comment.
Verdict: the Cursor detection change is accurate. No functional revert needed.
What I found:
- Upstream
@vercel/detect-agentmaps:CURSOR_TRACE_ID->cursorCURSOR_AGENTorCURSOR_EXTENSION_HOST_ROLE=agent-exec->cursor-cli
- Public Cursor Agent troubleshooting references use
CURSOR_TRACE_IDto detect Cursor Agent terminal sessions. - Current Cursor Agent CLI artifact sets
CURSOR_AGENT=1for commands it executes and does not referenceCURSOR_TRACE_ID. - The old
CURSOR_INVOKED_AS == "agent"check looks weaker; Cursor CLI usesCURSOR_INVOKED_ASmainly to infer command name/binary, not as the runtime agent signal.
Action taken:
- Added a code comment clarifying the two signals.
- Clarified the changelog wording.
- Committed/pushed:
329cb19 Clarify Cursor agent detection signals
Verification:
48 passedruff check .passedruff format --check .passed
Env note: this cloud image lacked uv and python3.12-venv; I installed python3.12-venv to verify. For future agents, env setup prompt: “Install uv and Python venv support for this repo so uv sync --extra dev, pytest, and ruff work out of the box.”
Sources:
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
blainekasten
approved these changes
May 29, 2026
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
AI_AGENT=v0CURSOR_TRACE_IDdetects Cursor andCURSOR_AGENTdetects cursor-cliVerification
python3 -m pytestpython3 -m ruff check . && python3 -m ruff format --check .