Skip to content

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

Closed
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/detect-agent-python-port-sync-81d1
Closed

feat: port upstream agents.json detection engine#15
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/detect-agent-python-port-sync-81d1

Conversation

@cursor

@cursor cursor Bot commented Jul 24, 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
Open in Web View Automation 

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>
@blainekasten

Copy link
Copy Markdown
Collaborator

Closing in favor of existing automation PR #14 (reuse; do not stack multiple sync PRs).

@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

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