{"record":{"id":"9e0e5689060db389","repo":"Hmbown/CodeWhale","slug":"the-remote-does-not-resolve-to-an-owner-repo-slug","errorCode":null,"errorMessage":"the {} remote {} does not resolve to an owner/repo slug","messagePattern":"the (.+?) remote (.+?) does not resolve to an owner/repo slug","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/dispatch_runner.rs","lineNumber":461,"sourceCode":"pub fn gitee_pr_url(slug: &str) -> String {\n    format!(\"https://gitee.com/api/v5/repos/{slug}/pulls\")\n}\n\n/// CNB pull-request endpoint for a slug.\npub fn cnb_pr_url(slug: &str) -> String {\n    format!(\"https://api.cnb.cool/{slug}/-/pulls\")\n}\n\n/// Production forge opener: local git for the branch push, then the forge's\n/// own API surface for the PR (gh for GitHub; REST for CNB and Gitee with\n/// service-slot tokens). Fails closed on missing tooling or tokens — the\n/// branch push is not rolled back, and no PR URL is ever invented.\npub struct LiveForgePr;\n\nimpl ForgePr for LiveForgePr {\n    fn open(&self, job: &CloudJob, patch: &PatchReceipt) -> Result<PrOpened> {\n        let slug = forge_slug(job.forge, &job.remote_url).ok_or_else(|| {\n            anyhow!(\n                \"the {} remote {} does not resolve to an owner/repo slug\",\n                job.forge.as_str(),\n                job.remote_url\n            )\n        })?;\n        let title = compose_pr_title(job, patch);\n        let dir = tempfile::tempdir().context(\"could not stage the cloud agent branch\")?;\n        let head_sha = prepare_branch(job, patch, dir.path())?;\n        push_branch(&dir.path().join(\"repo\"), &job.remote_url, &job.branch)?;\n        let body = compose_pr_body_for_head(job, patch, &head_sha);\n        let url = match job.forge {\n            Forge::Github => open_pr_github(&slug, job, patch, &title, &body)?,\n            Forge::Gitee => open_pr_gitee(&slug, job, patch, &title, &body)?,\n            Forge::Cnb => open_pr_cnb(&slug, job, patch, &title, &body)?,\n        };\n        Ok(PrOpened { url, head_sha })\n    }\n}","sourceCodeStart":443,"sourceCodeEnd":479,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/dispatch_runner.rs#L443-L479","documentation":"LiveForgePr::open converts the job's remote URL into an owner/repo slug via forge_slug for the job's forge; if the URL cannot be parsed into that shape the PR flow aborts before any title/body work. Per the documented contract, the earlier branch push is not rolled back and no PR URL is ever invented.","triggerScenarios":"open is called for a CloudJob whose remote_url is not a recognizable remote for job.forge (an SSH URL form the parser does not handle, a plain local path, or a remote on a different host than the forge expects).","commonSituations":"Repo cloned via an unusual remote form (ssh:// with custom port, alias, local path); origin points to a different host than the configured forge; the workspace is not a hosted repository.","solutions":["Set the repo's origin to a standard https or git@ URL for the forge host so forge_slug can extract owner/repo.","Check that job.forge matches the actual remote host (github vs gitee vs cnb); fix the job configuration if they disagree.","Run `git remote -v`, confirm the URL, and normalize it before dispatching the cloud job."],"exampleFix":"// before\ngit remote set-url origin ssh://git@github.com:2222/acme/widget.git\n// after\ngit remote set-url origin https://github.com/acme/widget.git","handlingStrategy":"validation","validationCode":"fn slug_ok(remote_url: &str, forge: Forge) -> bool {\n    forge_slug(forge, remote_url).is_some()\n}","typeGuard":null,"tryCatchPattern":"match pr.open(job, patch) {\n    Err(e) if e.to_string().contains(\"does not resolve to an owner/repo slug\") => {\n        // branch is pushed; surface the failure and let user open PR manually\n    }\n    other => other?,\n}","preventionTips":["Use standard https remotes for hosted repositories.","Verify `git remote -v` matches the job's forge before dispatching.","Avoid exotic SSH URL forms with custom ports on cloud-job workspaces."],"tags":["git","pull-request","remote-url","parsing"],"backgroundTag":"invalid-argument-format","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}