Skip to content

feat: port upstream agents.json detection engine - #14

Merged
blainekasten merged 3 commits into
mainfrom
cursor/detect-agent-python-port-alignment-6bc9
Jul 24, 2026
Merged

feat: port upstream agents.json detection engine#14
blainekasten merged 3 commits into
mainfrom
cursor/detect-agent-python-port-alignment-6bc9

Conversation

@cursor

@cursor cursor Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Port vercel/detect-agent’s agents.json-driven detection engine to the Python package (condition tree evaluator + vendored agents.json)
  • Add detectors for Cline, OpenClaw, Goose, Junie, Kiro, and upstream Pi (PATH / .pi/agent), plus extended Codex (CODEX_SANDBOX_NETWORK_DISABLED), Antigravity (ANTIGRAVITY_CLI_ALIAS), and OpenCode (OPENCODE)
  • Keep Python API conventions (is_agent / None) and backward-compatible PI_CODING_AGENT detection
  • Sync README supported-agents list and drive tests from upstream testcases.json

Upstream

Synced against https://github.com/vercel/detect-agent @ eab8cc9 (detect-agent 1.1.0), including:

Tests

  • python3 -m pytest
  • python3 -m ruff check .
  • python3 -m ruff format --check .
  • python3 -m mypy detect_agent

@cursor
cursor Bot requested a review from blainekasten June 22, 2026 14:03
cursoragent and others added 3 commits July 24, 2026 16:22
Vendors vercel/detect-agent agents.json and evaluates match conditions
(env_set/env_value/env_matches/file_exists/no_tty/anyOf/allOf), adding
cline, openclaw, goose, junie, kiro, and extended codex/antigravity/opencode/
pi detectors while keeping the Python is_agent API and PI_CODING_AGENT compat.

Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
Drive determine_agent tests from vendored testcases.json and add coverage
for cline, openclaw, extended codex/antigravity, and AI_AGENT verbatim names.

Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
Update README for the agents.json-driven port and newly supported agents
from vercel/detect-agent.

Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
@cursor
cursor Bot force-pushed the cursor/detect-agent-python-port-alignment-6bc9 branch from a61a175 to 6ed271b Compare July 24, 2026 16:22
@blainekasten blainekasten changed the title docs: sync supported detect-agent list with upstream feat: port upstream agents.json detection engine Jul 24, 2026
@blainekasten
blainekasten marked this pull request as ready for review July 24, 2026 16:23
@broly-code-security-scanner

Copy link
Copy Markdown

Broly Security Scan

Note

Baseline snapshot is missing for this repo. Broly is running in PR-only fallback mode until the first scheduled baseline completes. This does not block the PR.

Note

Clean scan
No vulnerabilities detected in this PR.

Note

Re-scan this PR anytime with /broly scan — useful after /broly undismiss, or to refresh findings without a new push.

Broly — SAST (zai-org/GLM-5.2) · Secrets · SCA · GH Actions (zizmor) · Containers · SBOM · Powered by Together AI

@blainekasten
blainekasten merged commit 1e986c5 into main Jul 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants