{"record":{"id":"2abbbac2a3ab10f7","repo":"tinyhumansai/openhuman","slug":"could-not-resolve-repo-set-rabbit-repo-owner-name","errorCode":null,"errorMessage":"could not resolve repo (set RABBIT_REPO=owner/name)","messagePattern":"could not resolve repo \\(set RABBIT_REPO=owner/name\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/rabbit/cli.mjs","lineNumber":51,"sourceCode":"    stdio: input ? [\"pipe\", \"pipe\", \"inherit\"] : [\"ignore\", \"pipe\", \"inherit\"],\n    maxBuffer: 32 * 1024 * 1024,\n  });\n}\n\nfunction resolveRepo() {\n  if (process.env.RABBIT_REPO) return process.env.RABBIT_REPO;\n  for (const remote of [\"upstream\", \"origin\"]) {\n    try {\n      const url = execFileSync(\"git\", [\"remote\", \"get-url\", remote], {\n        encoding: \"utf8\",\n      }).trim();\n      const m = url.match(/github\\.com[:/]([^/]+\\/[^/.]+)(?:\\.git)?$/);\n      if (m) return m[1];\n    } catch {\n      // try next\n    }\n  }\n  throw new Error(\"could not resolve repo (set RABBIT_REPO=owner/name)\");\n}\n\nfunction parseArgs(argv) {\n  const out = {\n    cmd: argv[0] ?? \"run\",\n    max: 5,\n    dryRun: false,\n    pr: null,\n    graceSec: 30,\n  };\n  for (let i = 1; i < argv.length; i++) {\n    const a = argv[i];\n    if (a === \"--dry-run\") out.dryRun = true;\n    else if (a === \"--max\") out.max = Number(argv[++i]);\n    else if (a === \"--pr\") out.pr = Number(argv[++i]);\n    else if (a === \"--grace\") out.graceSec = Number(argv[++i]);\n    else if (a === \"-h\" || a === \"--help\") {\n      out.cmd = \"help\";","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/scripts/rabbit/cli.mjs#L33-L69","documentation":"The rabbit CLI needs an owner/name GitHub repository slug. It tries RABBIT_REPO first, then runs `git remote get-url upstream` and `origin` and matches github.com[:/]owner/repo(.git) URLs. If RABBIT_REPO is unset and neither named remote exists or parses as a GitHub URL, it throws with the fix in the message.","triggerScenarios":"Running scripts/rabbit/cli.mjs outside a git repository (execFileSync git fails, both remotes skipped); remotes named something else (e.g. only a `github` remote); remote URLs on a non-GitHub host (GitLab, gitea, SSH aliases like `git@work:team/repo`) that never match the regex.","commonSituations":"Corporate forks where origin points at an internal mirror; fresh clones with no `upstream` and a non-GitHub origin; CI checkouts configured with a token URL that doesn't include github.com.","solutions":["Set the slug explicitly: `RABBIT_REPO=tinyhumansai/openhuman node scripts/rabbit/cli.mjs run`","Or add a GitHub-shaped remote: `git remote add upstream git@github.com:owner/name.git`","Or rename your existing GitHub remote so it is called `origin` or `upstream` (`git remote rename github upstream`)"],"exampleFix":"# before — only a non-github remote exists:\ngit remote -v\n# gitea  https://git.internal/team/openhuman.git\nnode scripts/rabbit/cli.mjs run\n\n# after:\nRABBIT_REPO=tinyhumansai/openhuman node scripts/rabbit/cli.mjs run","handlingStrategy":"validation","validationCode":"import { execFileSync } from 'node:child_process';\nfunction resolveRepoSafe() {\n  if (process.env.RABBIT_REPO) return process.env.RABBIT_REPO;\n  for (const remote of ['upstream', 'origin']) {\n    try {\n      const url = execFileSync('git', ['remote', 'get-url', remote], { encoding: 'utf8' }).trim();\n      const m = url.match(/github\\.com[:\\/]([^\\/]+\\/[^\\/.]+)(?:\\.git)?$/);\n      if (m) return m[1];\n    } catch { /* next */ }\n  }\n  return null; // caller decides: set RABBIT_REPO or bail with a clear message\n}","typeGuard":"/** True for strings like 'owner/name' that came from a github.com remote. */\nfunction isGitHubRepoSlug(value) {\n  return /^[\\w.-]+\\/[\\w.-]+$/.test(value);\n}","tryCatchPattern":null,"preventionTips":["In CI/non-git contexts, always set RABBIT_REPO=owner/name explicitly — remote sniffing is a convenience, not the contract","Keep an `upstream` remote pointing at github.com in local clones of this repo (matches the AGENTS.md remote convention)"],"tags":["cli","git","config","github"],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}