{"record":{"id":"46726517f0513c4f","repo":"can1357/oh-my-pi","slug":"unsupported-archive-format-assetname","errorCode":null,"errorMessage":"Unsupported archive format: ${assetName}","messagePattern":"Unsupported archive format: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/utils/tools-manager.ts","lineNumber":259,"sourceCode":"\t// Handle direct binary downloads (no archive extraction needed)\n\tif (config.isDirectBinary) {\n\t\tawait downloadFile(downloadUrl, binaryPath, signal);\n\t\tif (plat !== \"win32\") {\n\t\t\tawait fs.promises.chmod(binaryPath, 0o755);\n\t\t}\n\t\treturn binaryPath;\n\t}\n\n\t// Download archive\n\tconst archivePath = path.join(TOOLS_DIR, assetName);\n\tawait downloadFile(downloadUrl, archivePath, signal);\n\n\t// Extract\n\tconst tmp = await TempDir.create(\"@omp-tools-extract-\");\n\n\ttry {\n\t\tif (!assetName.endsWith(\".tar.gz\") && !assetName.endsWith(\".zip\")) {\n\t\t\tthrow new Error(`Unsupported archive format: ${assetName}`);\n\t\t}\n\n\t\ttry {\n\t\t\tawait extractArchive(archivePath, tmp.path());\n\t\t} catch (err) {\n\t\t\tthrow new Error(`Failed to extract ${assetName}: ${err instanceof Error ? err.message : String(err)}`);\n\t\t}\n\n\t\t// Find the binary in extracted files\n\t\t// ast-grep releases the binary directly in the zip, not in a subdirectory\n\t\tlet extractedBinary: string;\n\t\tif (tool === \"sg\") {\n\t\t\textractedBinary = path.join(tmp.path(), config.binaryName + binaryExt);\n\t\t} else {\n\t\t\tconst extractedDir = path.join(tmp.path(), assetName.replace(/\\.(tar\\.gz|zip)$/, \"\"));\n\t\t\textractedBinary = path.join(extractedDir, config.binaryName + binaryExt);\n\t\t}\n","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/utils/tools-manager.ts#L241-L277","documentation":"After downloading the asset, downloadTool() dispatches extraction based on the archive extension, supporting only .tar.gz and .zip. If the downloaded assetName has any other extension (bare binary, .tar.xz, .7z), it throws this error before attempting extraction, since no extractor path exists for it.","triggerScenarios":"config.getAssetName() returned an asset whose filename ends in neither .tar.gz nor .zip — e.g. upstream changed packaging to .tar.xz/.7z or a bare executable, and the format check rejects it.","commonSituations":"An upstream tool changed its release packaging format in a new version, a tool config mismatch causing the wrong asset to be selected, or a getAssetName mapping returning a legacy format no longer produced.","solutions":["Pin to an earlier tool version that still shipped .tar.gz/.zip assets.","Update the tool's TOOLS config / getAssetName to select an asset in a supported format.","Extend the extraction path to support the new archive format (e.g. add .tar.xz handling).","Wait for the manager to add support for the upstream's new packaging.","Download and install the tool manually."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// inspect the release asset's extension before invoking download | const assets = await releaseAssets(repo, version); const asset = pickAsset(assets); if (!asset.endsWith(\".tar.gz\") && !asset.endsWith(\".zip\")) throw new Error(`Upstream packaging changed: ${asset}`);","typeGuard":"function isSupportedArchive(name: string): boolean { return name.endsWith(\".tar.gz\") || name.endsWith(\".zip\"); }","tryCatchPattern":"try { const p = await toolsManager.download(\"fd\"); } catch (err) { if (err.message.startsWith(\"Unsupported archive format:\")) { /* pin older version or install manually */ } else throw err; }","preventionTips":["Pin tool versions known to ship supported archive formats.","Watch upstream release notes for packaging-format changes.","Keep the extraction path extended when upstreams migrate formats.","Alert on new asset extensions in release-asset monitoring."],"tags":["archive","unsupported-format","packaging"],"backgroundTag":"unsupported-archive-format","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}