Skip to content

feat: expand agent environment detection and shared-marker coverage - #17

Open
sunner wants to merge 7 commits into
vercel:mainfrom
sunner:feat/extend-agent-detection-coverage
Open

sunner wants to merge 7 commits into
vercel:mainfrom
sunner:feat/extend-agent-detection-coverage

Conversation

@sunner

@sunner sunner commented Oct 16, 2026 •

Copy link
Copy Markdown

Several agent environments are currently missed, and Grok Bot's shared CURSOR_AGENT marker can be reported as Cursor CLI. This adds explicit environment rules while keeping existing result IDs, existing rules' relative order and the AI_AGENT override.

  • Add Crush, Hermes Agent, Kilo Code, Trae, VTCode and Zed terminal context from the public Hugging Face registry; extend Goose with GOOSE_TERMINAL and Kiro with AGENT_CONTEXT_OUT while retaining their previous conditions.
  • Add WorkBuddy using its complete product-name keys, Grok Bot using local or compound cloud-shell markers, QwenWork using non-empty QODER_WORK_INTEGRATION_PRODUCT, Doubao Work using non-empty DOUBAO_OFFICE_AGENT_NAME, Cue's Linux desktop-worker context using exact MANUS_LONG_DESKTOP_WORKER=1, Muse using its active-agent/tool-call markers, and Manus using its addon-runtime descriptors.
  • Extend the existing Grok Build rule with exact GROK_AGENT=1; other non-empty selector values do not match. Grok Build and Grok Bot remain separate results.

Junie detection requires non-empty JUNIE_SHIM_PATH. User-configurable JUNIE_DATA is ignored, so configuring its data directory alone does not trigger Junie detection or suppress another matching agent. The existing rule order is retained.

The new product-specific markers precede inherited Cursor/Claude context; Zed remains a last fallback because ZED_TERM also describes human-operated terminals. Configuration paths, packaging flags, and general instance/session/location metadata do not independently identify these new contexts. QwenWork accepts any non-empty product-marker value; site, execution mode, endpoint and old chat/distribution markers do not trigger detection. Doubao Work accepts any non-empty agent-name value without requiring a fixed name. The MANUS_LONG_DESKTOP_WORKER marker identifies Cue, despite its variable prefix, and does not return manus.

Names and short descriptions for all thirteen new entries are checked against official product sites, documentation and repositories, with links in the evidence notes. Doubao Work and Manus use canonical IDs doubao-work and manus and constants DOUBAO_WORK and MANUS. Their environment-variable conditions are unchanged.

Sources and scope:

  • Hugging Face registry at fixed commit e08240742cd64d8f908b22e52358b84c812e882c
  • Hermes harness marker injection
  • Grok Build's terminal-marker contract
  • The included docs/environment-marker-evidence.md records versions, archive hashes and propagation locations from static inspection of WorkBuddy 5.8.3, Grok Bot 0.71.2 and QwenWorkCN 1.3.1. It contains no proprietary implementation code or real session values and does not claim end-to-end execution tests or coverage of every product variant.
  • QwenWork 1.3.1 sets the product marker to qwenworkcn and propagates it to local/host shell paths. The rule intentionally accepts any non-empty value; this observed value is not a matching restriction. VM/QXC guest-shell propagation of the new marker remains unverified; older marker paths are not evidence for that coverage.
  • Doubao Work's DOUBAO_OFFICE_AGENT_NAME comes from a user-provided shell observation on 2026-10-16. The rule accepts any non-empty value and is not an independently reproduced run or a public vendor contract. No real credentials, message/log IDs or runtime values are included; all negative fixtures use synthetic values.
  • Cue's marker and Muse's JARVIS_IS_ASSIGNED=1 / non-empty JARVIS_TOOL_CALL_ID markers come from user-provided runtime observations on 2026-10-16, not locally reproduced runs or inspected application artifacts. Real runtime identifiers are not included.
  • Manus's MANUS_ADDON_RUNTIME_SPEC_PATH / MANUS_ADDON_RUNTIME_SPECS_REVISION descriptor names were reported in an ordinary shell; their values were not supplied. The rule requires non-empty values. This is user-reported shell evidence, not a locally reproduced probe or verification of the inspected desktop distribution. Other addon/group fields do not match independently.
  • A user-reported Grok Bot cloud shell had no SAND_AGENT; its rule requires all three of non-empty CURSOR_AGENT, exact SAND_MANIFEST_V2=1 and exact SAND_SUPERVISOR_ENABLED=1. The original local SAND_AGENT=1 branch is retained. Shared infrastructure markers do not prove exclusive brand ownership or resolve nested agents' immediate identity; no tenant/authentication/store/boot/VNC identifiers are used.

Validation on Node 26.12.0 and Go 1.27.2:

  • pnpm lint
  • pnpm format:check
  • pnpm type-check
  • pnpm test — 250 passed, including 221 shared JSON cases
  • pnpm build
  • go test ./...

The existing mock-fs dependency fails during test collection on Node 26. The separate test-only commit replaces its internal filesystem patching with precise node:fs/promises.access stubs for present, missing and permission-denied paths. Runtime detection, dependencies and lockfiles are unchanged.

Detector cases reset all relevant environment keys and stub filesystem access; TTY state uses the existing controlled fixtures. Cases cover exact and wrong values, empty markers, configuration-only negatives, Grok Bot/Cursor coexistence, each missing or invalid cloud conjunction member, Grok Build separation, Cue-versus-Manus attribution, Muse tool-call context, Manus descriptors, arbitrary non-empty QwenWork product markers and Doubao Work agent names, Zed fallback behavior and retained overrides.

Coordinated Python-port contribution: togethercomputer/detect_agent#19. The two shared JSON documents are structurally identical, following the Python port’s upstream synchronization policy.

@sunner
sunner marked this pull request as draft October 16, 2026 11:04
@sunner
sunner marked this pull request as ready for review October 16, 2026 11:23
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