{"record":{"id":"bb50dcd76fcbd3bb","repo":"can1357/oh-my-pi","slug":"codex-security-cloud-import-requires-a-verifiable","errorCode":null,"errorMessage":"Codex Security cloud import requires a verifiable repository identity; this project has no 'origin' remote","messagePattern":"Codex Security cloud import requires a verifiable repository identity; this project has no 'origin' remote","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/security/cloud.ts","lineNumber":587,"sourceCode":"\tconst scpStyle = trimmed.match(/^[^@]+@([^:]+):(.+)$/);\n\tif (scpStyle) return `${scpStyle[1]!.toLowerCase()}/${scpStyle[2]!.replace(/^\\/+/, \"\").toLowerCase()}`;\n\ttry {\n\t\tconst parsed = new URL(trimmed);\n\t\treturn `${parsed.hostname.toLowerCase()}/${parsed.pathname.replace(/^\\/+/, \"\").toLowerCase()}`;\n\t} catch {\n\t\treturn trimmed.toLowerCase();\n\t}\n}\n\nasync function assertCloudRepositoryMatchesStore(\n\tconfiguration: CodexSecurityCloudConfiguration,\n\tstore: SecurityStore,\n\tsignal?: AbortSignal,\n): Promise<void> {\n\tconst repo = vcs.git(store.repositoryRoot);\n\tconst origin = repo ? await repo.remoteUrl(\"origin\", signal).catch(() => null) : null;\n\tif (!origin) {\n\t\tthrow new Error(\n\t\t\t\"Codex Security cloud import requires a verifiable repository identity; this project has no 'origin' remote\",\n\t\t);\n\t}\n\tif (repositoryIdentity(origin) !== repositoryIdentity(configuration.repositoryUrl)) {\n\t\tthrow new Error(\"Codex Security cloud configuration does not match this project's origin remote\");\n\t}\n}\n\nfunction reportForCloudBundle(\n\tconfiguration: CodexSecurityCloudConfiguration,\n\tstats: CodexSecurityCloudStats,\n\tfindings: SecurityFinding[],\n): string {\n\tconst lines = [\n\t\t\"# Codex Security cloud results\",\n\t\t\"\",\n\t\t`- Configuration: ${configuration.id}`,\n\t\t`- Repository: ${configuration.repositoryUrl}`,","sourceCodeStart":569,"sourceCodeEnd":605,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/security/cloud.ts#L569-L605","documentation":"Importing a Codex Security cloud configuration requires proving the local project is the same repository the cloud configuration was created for. The importer reads the git 'origin' remote of the repository root; if the repo has no origin remote (or the git wrapper fails), identity cannot be verified and the import is refused.","triggerScenarios":"Calling the cloud import flow (importCodexSecurityBundle / cloud import with a SecurityStore) in a repository with no 'origin' remote, or where store.repositoryRoot is not a git repository at all (vcs.git returns null).","commonSituations":"Cloned via a non-remote workflow (bundle, local copy); fresh git init before adding origin; CI checkouts that use a token-rewritten or detached setup without origin; passing the wrong directory as repositoryRoot.","solutions":["Add an origin remote: git remote add origin git@host:org/repo.git","Ensure the import is pointed at the actual git repository root (store.repositoryRoot)","If origin exists but auth fails, verify the remote URL is fetchable (git ls-remote origin)","Use an already-imported/local configuration flow instead of cloud import for non-git projects"],"exampleFix":"// before (repo has no origin)\nawait importCloudConfiguration(store, configuration);\n// after\n$`git remote add origin https://github.com/org/repo.git`;\nawait importCloudConfiguration(store, configuration);","handlingStrategy":"validation","validationCode":"import { $ } from \"bun\";\nconst remotes = await $`git remote -v`.cwd(root).quiet().nothrow();\nif (remotes.exitCode !== 0 || !remotes.text().includes(\"origin\")) {\n\tthrow new Error(\"Project has no 'origin' remote; cloud import unavailable\");\n}","typeGuard":null,"tryCatchPattern":"try {\n\tawait importCloudConfiguration(store, configuration);\n} catch (err) {\n\tif (err instanceof Error && err.message.includes(\"no 'origin' remote\")) {\n\t\t// prompt user to add origin or fall back to local configuration\n\t} else throw err;\n}","preventionTips":["Always clone via a remote (git clone) rather than copying directories","Run git remote add origin before setting up cloud security integrations","Verify CI checkouts preserve the origin remote (avoid shallow/detached exotic setups)","Confirm store.repositoryRoot points at the git root, not a subdirectory"],"tags":["git","configuration","repository-identity"],"backgroundTag":"missing-git-remote","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}