Add agent harnesses registry to @huggingface/tasks#2209
Conversation
Single mapping of AI coding agents/harnesses known to use the Hub, so that new harnesses can be registered here rather than hardcoded in huggingface_hub. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
| docsUrl: "https://devin.ai", | ||
| description: "Autonomous AI software engineer from Cognition.", | ||
| }, | ||
| } satisfies Record<string, AgentHarness>; |
There was a problem hiding this comment.
Registry missing roo-code and gemini harness entries
Medium Severity
The AGENT_HARNESSES registry is missing entries for roo-code (detected via ROO_ACTIVE) and gemini (detected via GEMINI_CLI), both of which are present in the upstream Python _detect_agent.py source. The PR describes itself as a "faithful port" and "behavior-preserving move rather than a change in coverage," and it includes the pi entry that was added after roo-code and gemini — so these omissions appear unintentional. When the Python client switches to reading from this registry as its source of truth, requests from Roo Code and Gemini CLI users will stop being attributed.
Reviewed by Cursor Bugbot for commit 950c1ea. Configure here.
There was a problem hiding this comment.
yes it's on purpose (archived and/or deprecated projects)
|
thanks! Won't comment on the ts code but happy to add some docs for updating this in hub-docs. It's probably fairly obvious but might be worth a small note somewhere IMO. |
Yes I'm actually working on that part as well. Will ping you on the PR soon :) |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 61b2af9. Configure here.
davanstrien
left a comment
There was a problem hiding this comment.
thanks! excited for this!
When the Cursor CLI runs inside the Cursor editor's integrated terminal, child processes inherit CURSOR_TRACE_ID and the CLI also sets CURSOR_AGENT. With first-match-wins detection, the more specific cursor-cli must be checked before cursor so it isn't masked by the editor signal. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Docs-related PR: huggingface/hub-docs#2521 (to be merged after this one) |
hanouticelina
left a comment
There was a problem hiding this comment.
Looks good to me, thank you!
julien-c
left a comment
There was a problem hiding this comment.
late to the party, but very cool!
| * The value pattern is one of: | ||
| * - `"*"`: the variable is set to any (non-empty) value | ||
| * - `"<value>"`: the variable equals this exact value | ||
| * - `"<prefix>*"`: the variable value starts with `<prefix>` (fuzzy match, resolved client-side) |
There was a problem hiding this comment.
what's the use case for this last case?
There was a problem hiding this comment.
none yet, I'll remove it


Agentic use of the Hub is growing, and we'd like to make it visible. When
huggingface_hubdetects it is run by an agent, it sends the info via the user agent on every http request. At the moment, detection is based on a hardcoded list insidehuggingface_hub. This PR moves the source of truth to@huggingface/tasks, mirroring how we already register local apps, model and dataset libraries.Goal is to be able to update the agent harness list without requiring a client-side update..
Client side the detection process will be:
AGENT_HARNESSESenvVars: { ANTIGRAVITY_AGENT: "*" },)envVarsis not set or doesn't match, we checkAGENTandAI_AGENTenv variables for the exact harness idIf no entry matches but one of
AGENT/AI_AGENTis set, we set the harness tounknown.cc @davanstrien @hanouticelina @julien-c with whom we discussed that recently
Note: for now docs/repo urls, pretty name and description are not used but the plan is to build a lightweight leaderboard with the collected data. Since we will ask the community to register new harnesses themselves, it's best to require all the information right now.
Warning
Roo-code and Gemini CLI detection have been removed. Roo code is now an archived repo on Github (project has been stopped) and Gemini CLI is deprecated in favor of Antigravity.
Note
Low Risk
Adds static registry metadata and public exports only; no runtime Hub or auth behavior changes in this repo.
Overview
Centralizes AI agent / harness detection metadata in
@huggingface/tasksso clients likehuggingface_hubcan consume a shared registry instead of a hardcoded list.Adds
packages/tasks/src/agent-harnesses.tswith anAgentHarnesstype,STANDARD_AGENT_ENV_VARS(AI_AGENT,AGENT), andAGENT_HARNESSES— a keyed catalog of known tools with optionalenvVarspatterns (*, exact match, or prefix match) and metadata for a future leaderboard. Order in the object matters for first-match detection (e.g.coworkbeforeclaude-code,cursor-clibeforecursor).devinis listed withoutenvVars(relies on standard agent env vars only).Re-exports
AGENT_HARNESSES,STANDARD_AGENT_ENV_VARS, and types frompackages/tasks/src/index.ts. Adds CODEOWNERS for the new file.Reviewed by Cursor Bugbot for commit a49be10. Bugbot is set up for automated code reviews on this repo. Configure here.