Skip to content

fix(harness): resolve skill name to hub slug before download#630

Open
yaozheng-fang wants to merge 2 commits into
mainfrom
fix/harness-skill-slug
Open

fix(harness): resolve skill name to hub slug before download#630
yaozheng-fang wants to merge 2 commits into
mainfrom
fix/harness-skill-slug

Conversation

@yaozheng-fang

Copy link
Copy Markdown
Collaborator

Problem

A harness lists skills by their human name (e.g. web-scraper,
byted-arkclaw-paper-research), but the skill hub downloads by slug (e.g.
clawhub/yinanping-cpu/web-scraper, volcengine/arkclaw/byted-arkclaw-paper-research).

_download_and_extract_skill used the name verbatim as the download path. For a
name whose slug isn't a top-level identifier, the hub answers HTTP 200 with a
JSON error body
(not a zip), which zipfile then rejects as the very
confusing File is not a zip file — surfaced to users as:

Error: Skill 'byted-arkclaw-paper-research' failed to load: File is not a zip file

Fix

  • Add _resolve_skill_slug(): resolve a skill name → slug via the search API
    (/v1/skills?query=<name>&pageSize=3), scanning all results for an exact
    Name match — the top hit isn't always the exact one (web-scraper ranks
    below smart-web-scraper). A value already containing / is treated as an
    explicit slug and used as-is. No exact match raises a clear error.
  • _download_and_extract_skill now resolves the slug first, then downloads by slug.
  • Guard against a 200 non-zip response: raise a clear error (with content-type)
    instead of letting zipfile fail with File is not a zip file.

Tests

tests/cloud/test_harness_app_contract.py — exact-match-not-first, explicit-slug
passthrough, no-match error, search HTTP error, and the non-zip-200 clear error.
21 passed.

Verified

Deployed a codex harness built from this branch and invoked with
--skills data-visualization-cloud,byted-arkclaw-paper-research,academic-deep-research,web-scraper:
all four now resolve and load (no File is not a zip file); the run completes.

yaozheng-fang and others added 2 commits June 22, 2026 17:57
A harness lists skills by name (e.g. 'web-scraper') but the hub downloads by
slug (e.g. 'clawhub/yinanping-cpu/web-scraper'). Bare names that aren't a
top-level slug got a 200 JSON error body, which zipfile then rejected as
'File is not a zip file'. Resolve name -> slug via the search API (scanning all
results for an exact Name match, since the top hit isn't always exact), then
download by slug; values already containing '/' are treated as explicit slugs.
Also surface a non-zip 200 response as a clear error instead of a BadZipFile.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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