Skip to content

feat(telemetry): refresh coding agent detection - #1571

Merged
betegon merged 1 commit into
mainfrom
feat/update-agent-detection
Sep 9, 2026
Merged

betegon merged 1 commit into
mainfrom
feat/update-agent-detection

Conversation

@betegon

@betegon betegon commented Sep 9, 2026

Copy link
Copy Markdown
Member

Summary

Recognize Cline, OpenClaw, Kimi, Grok, and Junie, and expand detection for Cursor, Codex, Antigravity, and OpenCode using selected rules from detect-agent 1.2.0.

Changes

Map upstream identifiers to the CLI's existing canonical agent tags while preserving version and role extraction. Grok plugin markers take precedence over Claude compatibility markers, and Cursor's extension-host role must equal agent-exec. Retain the deliberate exclusions for REPL_ID, COPILOT_GITHUB_TOKEN, GOOSE_PROVIDER, and KIMI_CODE_HOME.

Test Plan

  • pnpm run lint and pnpm run typecheck
  • Detection, normalization property, and wizard tests: 199 passed with CURSOR_EXTENSION_HOST_ROLE=agent-exec, including banner environment isolation
  • check:deps, check:errors, check:patches, and check:stale-refs
  • Reviewed the diff against current main; generated files and dependencies are unchanged

Full test suite, binary builds, and live sessions of each agent were not run locally.

@vercel

vercel Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cli Ready Ready Preview Sep 9, 2026 5:03pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Sep 9, 2026 5:03pm UTC

Request Review

["OPENCLAW_SHELL", "openclaw"],
// Replit — REPL_ID intentionally excluded because it's set in ALL Replit
// workspaces, not just when the AI agent is driving the CLI
// GitHub Copilot — COPILOT_GITHUB_TOKEN intentionally excluded because

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The OPENCODE environment variable may cause false-positive agent detection, as it could be set by non-agent tools or user configurations.
Severity: LOW

Suggested Fix

To prevent false positives, consider excluding the OPENCODE environment variable from agent detection, similar to how GOOSE_PROVIDER and KIMI_CODE_HOME are handled. If OPENCODE is confirmed to be safe, add a comment explaining why it doesn't pose a false-positive risk.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: packages/cli/src/lib/detect-agent.ts#L159

Potential issue: The environment variable `OPENCODE` was added to the list of variables
used for agent detection. However, this introduces a risk of false-positive detections.
Similar, potentially ambiguous variables like `REPL_ID`, `COPILOT_GITHUB_TOKEN`,
`GOOSE_PROVIDER`, and `KIMI_CODE_HOME` are explicitly excluded because they might be set
in a user's shell for reasons unrelated to an agent. If a user has an `OPENCODE`
variable set for a different tool, the CLI will incorrectly believe it is being run by
the OpenCode agent, which could lead to incorrect behavior or analytics.

Did we get this right? 👍 / 👎 to inform future reviews.

@betegon
betegon enabled auto-merge (squash) September 9, 2026 17:08
@betegon
betegon disabled auto-merge September 9, 2026 17:08
@betegon
betegon merged commit e7beceb into main Sep 9, 2026
32 checks passed
@betegon
betegon deleted the feat/update-agent-detection branch September 9, 2026 17:18
BYK pushed a commit that referenced this pull request Sep 14, 2026
…l UI, env vars (#1579)

## Weekly Documentation Audit — 2026-09-14

This PR fixes documentation gaps found by cross-referencing the CLI
implementation against its docs, focusing on changes since the last
audit (2026-09-07).

---

### Gap Report

#### A. Undocumented or missing commands/subcommands

No new undocumented commands found. All 112 commands have auto-generated
doc pages. The `local` commands (`serve`, `run`) are fully documented.

#### B. Undocumented flags

**`--open` flag on `sentry local serve` and `sentry local run`** (added
in #1560):
- Both commands added an `--open` flag to launch the browser-based
Sentry Local UI at `local.sentry.dev`
- The flag was listed in auto-generated Options tables but had no
examples or explanation in the hand-written fragment
- **Fixed**: Added a "Browser UI" section to `local.md` with usage
examples and constraints

#### C. Missing usage examples

The Local UI (`--open`) had no examples → added.

#### D. Stale descriptions

No stale `brief` strings found.

#### E. Missing route mappings in skill generator

All routes are covered — `groupRoutesByReference()` provides automatic
1:1 mapping.

#### F. Installation / distribution gaps

**`SENTRY_CONFIG_DIR` stale default in env-registry.ts**:
- Source: `packages/cli/src/lib/env-registry.ts` line 151–154
- The description said "Defaults to `~/.sentry/`" and `defaultValue` was
`"~/.sentry/"`
- Since PR #1503 (XDG Base Directory migration), the actual default is
`$XDG_CONFIG_HOME/sentry/` (i.e. `~/.config/sentry/`)
- **Fixed**: Updated description, defaultValue, and devGuide to reflect
XDG paths
- **Cascaded**: Regenerated `configuration.md` and `DEVELOPMENT.md`
(auto-generated from env-registry)

**Curl install detection path stale in `cli.md`**:
- Source: `apps/cli-docs/src/fragments/commands/cli.md` line 56
- The upgrade detection table said curl binary is "in `~/.sentry/bin`" —
this is the legacy path
- The XDG-aligned default is `~/.local/bin`
- **Fixed**: Table now shows both paths: "XDG: `~/.local/bin`; legacy:
`~/.sentry/bin`"

#### G. Undocumented environment variables

All `SENTRY_*` env vars in `env-registry.ts` are documented in
`configuration.md` (auto-generated). The `SENTRY_RELEASE` var injected
by `local run` was missing from the fragment's env var table →
**fixed**.

Remaining intentionally excluded env vars (internal, test-only, or
SDK-inherited): `SENTRY_ENVIRONMENT`, `SENTRY_CLI_NO_EXIT_TRAP`,
`SENTRY_SCAN_DISABLE_WORKERS`,
`SENTRY_CLI_INTEGRATION_TEST_VERSION_OVERRIDE`, `SENTRY_RN_*`,
`SENTRY_TRACES_SAMPLE_RATE`, `SENTRY_MONITOR_SLUG`, `SENTRY_DIST`.

#### H. Auth / self-hosted gaps

**Auth credential storage path stale in `auth.md`**:
- Source: `apps/cli-docs/src/fragments/commands/auth.md` line 109
- Said credentials stored in `~/.sentry/` — stale since XDG migration
(#1503)
- **Fixed**: Updated to `$XDG_CONFIG_HOME/sentry/` with legacy fallback
note

No other auth/self-hosted gaps found. OAuth scopes, trust anchor system,
and self-hosted guide are current.

#### I. Plugin/skills gaps

**Newly-detected agents missing from `agentic-usage.md`**:
- Source: `packages/cli/src/lib/detect-agent.ts` (`ENV_VAR_AGENTS`,
`PROCESS_NAME_AGENTS`)
- PR #1571 added detection for Cline, OpenClaw, Kimi, Grok, and Junie
- The Cowork variant of Claude Code was also undocumented
- **Fixed**: Added all 5 new agents plus Cowork to both the intro
paragraph and requirements section

Skill installation targets (`~/.claude`, `~/.agents`) and embedded
content system are correctly documented.

#### J. README / DEVELOPMENT.md drift

- `packages/cli/README.md` correctly uses XDG paths — no drift
- `DEVELOPMENT.md` env var table was auto-updated by the env-registry
regeneration
- Node.js version requirement (22.15+ dev, 20+ runtime) is correctly
documented
- Build/test commands in `README.md` and `DEVELOPMENT.md` match
`package.json`

---

### Top 5 Most Impactful Fixes (Prioritized)

1. **`SENTRY_CONFIG_DIR` stale default** — The env-registry (source of
truth for generated docs) pointed users at the wrong directory. This
cascaded to `configuration.md`, `DEVELOPMENT.md`, and the `sentry
--help` output. High impact because it directly misleads users about
where their credentials are stored.

2. **Auth credential path stale** — The auth command docs told users
their tokens live in `~/.sentry/` when they actually live in
`~/.config/sentry/`. Users looking for their stored credentials would
check the wrong directory.

3. **5 newly-detected agents undocumented** — Cline, Grok, Kimi, Junie,
and OpenClaw users wouldn't know the CLI recognizes their agent,
potentially causing confusion about skill installation behavior.

4. **`--open` / Local UI undocumented in fragment** — The browser-based
Sentry Local UI is a significant new feature with no examples in the
hand-written docs. Users wouldn't discover it without reading `--help`.

5. **`SENTRY_RELEASE` env var missing from local run table** — Minor but
affects users who need to understand what environment variables are
injected into their child process.

<div><a
href="https://cursor.com/agents/bc-dcce6e5a-d036-4d6c-ba6c-54750bd16fdb?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/automations/8b0c0f35-da5e-409d-984c-5e39518ffb8a"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/view-automation-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/view-automation-light.png"><img
alt="View Automation" width="141" height="28"
src="https://cursor.com/assets/images/view-automation-dark.png"></picture></a>&nbsp;</div>

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Miguel Betegón <miguelbetegongarcia@gmail.com>
BYK pushed a commit that referenced this pull request Sep 21, 2026
…mand coverage, AGENTS.md update (#1602)

## Weekly Documentation Audit — 2026-09-21

Automated cross-reference of implementation vs documentation, covering
commits since the last audit (`ca7ef6af3`, PR #1579).

---

## Gap Report

### A. Undocumented or Missing Commands/Subcommands

Command docs are auto-generated from CLI metadata, so all commands have
generated doc pages. However, the **hand-written feature pages** were
missing coverage for recently-added commands:

| Command | Source | Missing From |
|---------|--------|--------------|
| `agent-conversation list/view` | `src/commands/agent-conversation/` |
`agentic-usage.md`, `agent-guidance.md` |
| `wasm-split` | `src/commands/wasm-split.ts` (PR #1589) |
`agentic-usage.md`, `agent-guidance.md` |
| `status show` | `src/commands/status/show.ts` | `agentic-usage.md`
capabilities |

**Fixed in this PR**: Added all three to the Capabilities list in
`agentic-usage.md` and added workflow patterns with bash examples in
`agent-guidance.md`.

### B. Undocumented Flags

No new gaps. All non-hidden flags are auto-documented in generated
Options tables via `generate-command-docs.ts`.

### C. Missing Usage Examples

All command groups have fragment files in
`apps/cli-docs/src/fragments/commands/` with bash examples. The new
`wasm-split.md` fragment was added alongside PR #1589.

**Bug found**: The `agent-conversation.md` fragment had **incorrect
positional syntax** — it showed `sentry agent-conversation view my-org
conv-123` (two separate args) but the command accepts a single
slash-separated positional `[<org>/]<conversation-id>`, so the correct
form is `sentry agent-conversation view my-org/conv-123`.

**Fixed in this PR.**

### D. Stale Descriptions

No drift found. The `brief` strings in code match the auto-generated doc
descriptions.

### E. Missing Route Mappings in Skill Generator

N/A — the manual `ROUTE_TO_REFERENCE` map was removed in a prior audit.
The skill generator now uses `groupRoutesByReference()` for automatic
1:1 route-to-file mapping.

### F. Installation / Distribution Gaps

No new gaps. The install script, `getting-started.mdx`, and `README.md`
all document:
- `curl`, Homebrew, npm/pnpm/yarn/bun install methods
- `--no-modify-path`, `--no-completions`, `--no-agent-skills` installer
flags
- `SENTRY_INSTALL_DIR`, `SENTRY_VERSION`, `SENTRY_INIT` env vars
- Supported platforms (macOS x64/arm64, Linux x64/arm64 glibc/musl,
Windows x64)
- Nightly channel via `--version nightly`

### G. Undocumented Environment Variables

All `SENTRY_*` env vars accessed via `getEnv()` are registered in
`env-registry.ts` and appear in the generated `configuration.md`.
Intentionally excluded internal/test-only vars remain unchanged from
prior audits:
- `SENTRY_ENVIRONMENT` — bash-hook template only
- `SENTRY_CLI_NO_EXIT_TRAP` — bash-hook internal
- `SENTRY_SCAN_DISABLE_WORKERS` — internal perf tuning
- `SENTRY_CLI_INTEGRATION_TEST_VERSION_OVERRIDE` — test-only
- `SENTRY_RN_*` — React Native wrapper internals

### H. Auth / Self-Hosted Gaps

No new gaps. Self-hosted docs cover OAuth 26.1.0+ requirement, token
auth fallback,
`SENTRY_HOST`/`SENTRY_URL`/`SENTRY_CLIENT_ID`/`SENTRY_CUSTOM_HEADERS`,
TLS/CA certs, and `sentry cli defaults` for persistent proxy headers.

### I. Plugin/Skills Gaps

The `plugins/README.md` accurately describes the skill installation flow
and supported directories (`~/.claude`, `~/.agents`). The agent
detection list in `agentic-usage.md` is current (includes Cline, Grok,
Kimi, Junie, OpenClaw from PR #1571).

No new gaps.

### J. README / DEVELOPMENT.md Drift

No drift found:
- Node.js version: `>=22.15` in devEngines, `>=20.0` in engines —
matches docs
- pnpm: `10.11.0` — matches docs
- Build toolchain: esbuild + fossilize — matches GENERATED sections
- OAuth scopes: auto-generated via GENERATED markers

**AGENTS.md drift found**: The Architecture section's command group list
was outdated — it listed a subset with `…` ellipsis, omitting
`agent-conversation`, `alert`, `build`, `code-mappings`,
`dart-symbol-map`, `debug-files`, `docs`, `feedback`, `snapshots`,
`status`, `wasm-split`, and other groups.

**Fixed in this PR**: Replaced with the full alphabetical list.

---

## Top 5 Most Impactful Fixes (Prioritized)

1. **`agent-conversation view` fragment had wrong positional syntax** —
agents following the example would get a parse error. Fixed.
2. **`agent-conversation` missing from agentic docs** — AI agents had no
guidance for browsing conversation transcripts, a feature specifically
built for agent workflows. Fixed.
3. **`wasm-split` missing from agentic docs** — a new command (PR #1589)
useful for WebAssembly projects had no agent guidance or workflow
pattern. Fixed.
4. **AGENTS.md command group list was stale** — new contributors and
agents referencing the Architecture section saw an incomplete picture.
Fixed.
5. **`status` missing from agentic-usage.md capabilities** — the status
command was already in agent-guidance.md workflow patterns but wasn't
listed in the capabilities section. Fixed.

<div><a
href="https://cursor.com/agents/bc-65d7d00b-206a-420d-b8eb-d39cbd8ed041?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/automations/8b0c0f35-da5e-409d-984c-5e39518ffb8a"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/view-automation-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/view-automation-light.png"><img
alt="View Automation" width="141" height="28"
src="https://cursor.com/assets/images/view-automation-dark.png"></picture></a>&nbsp;</div>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Miguel Betegón <miguelbetegongarcia@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

This branch was successfully deployed

1 active and 1 inactive deployments
Preview – cli — f2ab4fca Deployed Sep 9, 2026 by vercel[bot]
Preview – sentry-local — f2ab4fca Deployed Sep 9, 2026 by vercel[bot]
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.

1 participant