upstash/context7 · warning · Error
no files
Error message
no files
What it means
Thrown inside the setup command after downloadSkill() returns for an agent skill. It fires when downloadData.error is set OR the returned files array is empty. The surrounding try/catch immediately converts it into a human-readable skillStatus string ("failed: no files"), so it never escapes to the caller — it is a status sentinel, not a propagated exception.
Source
Thrown at packages/cli/src/commands/setup.ts:368
const result = await installRule(agentName, "mcp", scope);
ruleStatus = result.status;
rulePath = result.path;
} catch (err) {
ruleStatus = `failed: ${err instanceof Error ? err.message : String(err)}`;
rulePath = "";
}
const skillDir =
scope === "global"
? agent.skill.dir("global")
: join(process.cwd(), agent.skill.dir("project"));
const skillPath = join(skillDir, agent.skill.name, "SKILL.md");
let skillStatus: string;
try {
const downloadData = await downloadSkill("/upstash/context7", agent.skill.name);
if (downloadData.error || downloadData.files.length === 0) {
throw new Error(downloadData.error || "no files");
}
await installSkillFiles(agent.skill.name, downloadData.files, skillDir);
skillStatus = "installed";
} catch (err) {
skillStatus = `failed: ${err instanceof Error ? err.message : String(err)}`;
}
return {
agent: agent.displayName,
mcpStatus,
mcpPath,
ruleStatus,
rulePath,
skillStatus,
skillPath,
};
}
View on GitHub (pinned to ca15df0443)
Solutions
- Retry the setup command — empty downloads are often transient.
- Confirm the skill slug passed to downloadSkill matches a current registry entry.
- Upgrade the CLI to the latest version so the download/parse contract matches the registry.
- If it persists, inspect downloadData (log it temporarily) to distinguish a real error from a genuinely empty payload.
Example fix
// before
if (downloadData.error || downloadData.files.length === 0) {
throw new Error(downloadData.error || "no files");
}
// after — distinguish the two cases in the status string
if (downloadData.error) {
throw new Error(downloadData.error);
}
if (downloadData.files.length === 0) {
throw new Error("skill bundle contained no files (upstream registry issue)");
} Defensive patterns
Strategy: validation
Validate before calling
// downloadSkill result is already available — validate before throwing.
const downloadData = await downloadSkill("/upstash/context7", agent.skill.name);
if (downloadData.error) {
skillStatus = `failed: ${downloadData.error}`;
} else if (downloadData.files.length === 0) {
skillStatus = "failed: skill bundle was empty (retry; if persistent, upgrade CLI)";
} else {
await installSkillFiles(agent.skill.name, downloadData.files, skillDir);
skillStatus = "installed";
} Type guard
function isDownloadResult(v: unknown): v is { error?: string; files: { path: string; content: string }[] } {
return typeof v === "object" && v !== null && Array.isArray((v as any).files);
} Try / catch
// Already handled: the surrounding try/catch converts the throw into skillStatus.
// Keep it — but log the downloadData shape so 'no files' is diagnosable.
try {
const d = await downloadSkill(slug, name);
if (d.error || d.files.length === 0) throw new Error(d.error || "no files");
await installSkillFiles(name, d.files, skillDir);
skillStatus = "installed";
} catch (err) {
console.error("skill download failed:", slug, name, err);
skillStatus = `failed: ${err instanceof Error ? err.message : String(err)}`;
} Prevention
- Pin a known-good CLI version that matches the current registry contract.
- Retry setup once before reporting failure — empty bundles are often transient.
- Log the skill slug and file count on failure so empty-vs-error cases are distinguishable.
When it happens
Trigger: The upstream skill bundle (e.g. /upstash/context7) was fetched but contained zero files; the download endpoint returned an error payload; the registry returned a manifest with no file entries; a transient upstream issue produced an empty archive.
Common situations: Running setup for an agent whose skill has been removed or renamed upstream; partial/network-truncated download that parsed as an empty result; version mismatch between the CLI and the registry contract; first run right after a registry migration.
Related errors
- Failed to fetch user info
- Could not reach ${url}: ${detail}${code ? ` (${code})` : ""}
- ${fallback} (HTTP ${response.status} from ${response.url}):
- Device token poll failed
- Skill file path "${file.path}" resolves outside the target d
AI-assisted analysis of upstash/context7@ca15df0443 (2026-08-12).
Data as JSON: /api/errors/88da91646a4f945c.
Report an issue: GitHub.