{"record":{"id":"92d0c8d9fe890a12","repo":"langgenius/dify","slug":"failed-to-download-skill-file-response-status","errorCode":null,"errorMessage":"Failed to download skill file: ${response.status}","messagePattern":"Failed to download skill file: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/use-skill-detail.ts","lineNumber":35,"sourceCode":"const skillFileContentQueryKey = (url?: string) => ['agent-v2', 'skill-file-content', url] as const\n\nconst resolveSkillFileContentUrl = (url: string) => {\n  const consoleApiUrl = new URL(API_PREFIX, globalThis.location.origin)\n  const consoleApiBaseUrl = consoleApiUrl.href.endsWith('/')\n    ? consoleApiUrl\n    : new URL(`${consoleApiUrl.href}/`)\n\n  return new URL(url, consoleApiBaseUrl).toString()\n}\n\nconst fetchSkillFileContent = async (url: string) => {\n  const response = await globalThis.fetch(resolveSkillFileContentUrl(url), {\n    credentials: 'include',\n    headers: {\n      [CSRF_HEADER_NAME]: Cookies.get(CSRF_COOKIE_NAME()) || '',\n    },\n  })\n  if (!response.ok) throw new Error(`Failed to download skill file: ${response.status}`)\n\n  return response.blob()\n}\n\nconst getSkillFileContentQueryOptions = (url: string) =>\n  queryOptions({\n    queryKey: skillFileContentQueryKey(url),\n    queryFn: () => fetchSkillFileContent(url),\n    staleTime: Infinity,\n  })\n\nconst isSkillFolder = (file: AgentConfigSkillFileResponse) => file.type === 'directory'\n\nconst toSkillFileNode = (item: AgentConfigSkillFileResponse): AgentFileNode => {\n  const fileName = item.name || item.path.split('/').pop() || item.path\n\n  return {\n    id: item.path,","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/use-skill-detail.ts#L17-L53","documentation":"Error \"Failed to download skill file: ${response.status}\" thrown in langgenius/dify.","triggerScenarios":"Thrown at web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/use-skill-detail.ts:35 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}