{"record":{"id":"81c5fa43518b6773","repo":"can1357/oh-my-pi","slug":"failed-to-refresh-bun-s-git-cache-for-source-hos","errorCode":null,"errorMessage":"Failed to refresh Bun's git cache for ${source.host}/${source.path}: ${fetchResult.stderr}","messagePattern":"Failed to refresh Bun's git cache for (.+?)/(.+?): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/extensibility/plugins/bun-git-cache.ts","lineNumber":88,"sourceCode":"\t\tconst originResult = await runCommand([\"git\", \"-C\", repositoryDir, \"config\", \"--get\", \"remote.origin.url\"], cwd);\n\t\tif (originResult.exitCode !== 0 || normalizeRepositoryUrl(originResult.stdout.trim()) !== repositoryUrl) continue;\n\n\t\tconst fetchResult = await runCommand(\n\t\t\t[\n\t\t\t\t\"git\",\n\t\t\t\t\"-C\",\n\t\t\t\trepositoryDir,\n\t\t\t\t\"fetch\",\n\t\t\t\t\"--force\",\n\t\t\t\t\"--prune\",\n\t\t\t\t\"origin\",\n\t\t\t\t\"+refs/heads/*:refs/heads/*\",\n\t\t\t\t\"+refs/tags/*:refs/tags/*\",\n\t\t\t],\n\t\t\tcwd,\n\t\t);\n\t\tif (fetchResult.exitCode !== 0) {\n\t\t\tthrow new Error(`Failed to refresh Bun's git cache for ${source.host}/${source.path}: ${fetchResult.stderr}`);\n\t\t}\n\t}\n}\n","sourceCodeStart":70,"sourceCodeEnd":92,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/extensibility/plugins/bun-git-cache.ts#L70-L92","documentation":"refreshBunGitCache runs `git fetch` with forced refspecs for heads and tags into Bun's cached bare clone of the plugin repo. A non-zero git exit code aborts the refresh with the host/path and git's stderr embedded in the message.","triggerScenarios":"Updating a git-sourced plugin when `git fetch` fails: network unreachable, auth required for a private repo, unknown host, or the cached clone's remote is broken.","commonSituations":"Offline/behind-proxy environments; private GitHub/GitLab repos without deploy keys or credentials; SSH keys not loaded (ssh-agent); deleted/renamed upstream repository; corporate TLS interception.","solutions":["Run `git ls-remote <repo-url>` manually to test connectivity/auth.","For private repos, configure credentials (SSH key in ssh-agent, or HTTPS token via credential helper).","Check proxy/VPN/firewall settings and corporate CA trust for git.","If the cached clone's origin is stale, clear Bun's cache (`bun pm cache rm`) and reinstall the plugin."],"exampleFix":"// before: failing SSH\n\"source\": \"git@unknownhost:team/plugin.git\"\n// after: reachable, authorized remote\n\"source\": \"git@github.com:team/plugin.git\"","handlingStrategy":"retry","validationCode":"const ls = Bun.spawnSync([\"git\", \"ls-remote\", `https://${source.host}/${source.path}`], { stdout: \"pipe\", stderr: \"pipe\" });\nif (ls.exitCode !== 0) throw new Error(`Repo unreachable before update: ${ls.stderr.toString()}`);","typeGuard":null,"tryCatchPattern":"try {\n  await updateGitPlugin(source, cwd);\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith(\"Failed to refresh Bun's git cache\")) {\n    await backoffRetry(() => updateGitPlugin(source, cwd), 3); // transient network blips\n  } else throw err;\n}","preventionTips":["Configure git credentials/SSH keys for private plugin repos before installing","Verify connectivity with git ls-remote in setup scripts","Keep bun's git cache healthy; `bun pm cache rm` if the cached clone's remote breaks"],"tags":["git","network","plugins","authentication","cache"],"backgroundTag":"git-fetch-failed","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}