{"record":{"id":"6480b2fb03eb453e","repo":"paperclipai/paperclip","slug":"enter-a-github-repository-url","errorCode":null,"errorMessage":"Enter a GitHub repository URL.","messagePattern":"Enter a GitHub repository URL\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ui/src/components/new-agent/NewAgentSetup.tsx","lineNumber":380,"sourceCode":"        KIMI_MODEL_NAME: { type: \"plain\", value: kimiModel.trim() },\n        KIMI_MODEL_PROVIDER_TYPE: { type: \"plain\", value: kimiProtocol },\n        ...(kimiBaseUrl.trim()\n          ? {\n              KIMI_MODEL_BASE_URL: { type: \"plain\", value: kimiBaseUrl.trim() },\n            }\n          : {}),\n      };\n    }\n    return config;\n  }\n  function preparedConfig(nextConnection = connection) {\n    if (multiProvider && (!model.trim() || !model.includes(\"/\")))\n      throw new Error(\"Choose or enter a model in provider/model format.\");\n    if (\n      adapterType === \"cursor_cloud\" &&\n      !/^https:\\/\\/github\\.com\\/[^/]+\\/[^/]+/.test(repository.trim())\n    )\n      throw new Error(\"Enter a GitHub repository URL.\");\n    if (\n      [\"cursor_cloud\", \"hermes_gateway\"].includes(adapterType) &&\n      !apiKey.trim() &&\n      !selectedBinding\n    )\n      throw new Error(\n        adapterType === \"cursor_cloud\"\n          ? \"Enter a Cursor API key.\"\n          : `Enter ${envKey} or select an organization secret.`,\n      );\n    if (adapterType === \"hermes_gateway\") {\n      try {\n        const url = new URL(gatewayUrl.trim());\n        if (![\"https:\", \"http:\"].includes(url.protocol)) throw new Error();\n      } catch {\n        throw new Error(\"Enter the Hermes API base URL.\");\n      }\n    }","sourceCodeStart":362,"sourceCodeEnd":398,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/ui/src/components/new-agent/NewAgentSetup.tsx#L362-L398","documentation":"preparedConfig() in NewAgentSetup validates adapter-specific requirements. For the cursor_cloud adapter type the repository field must be a GitHub repository URL matching ^https://github.com/owner/repo; anything else throws \"Enter a GitHub repository URL.\" This prevents creating a Cursor Cloud agent without a valid repo target.","triggerScenarios":"Submitting setup with adapterType === \"cursor_cloud\" and repository empty, or set to a non-GitHub URL (gitlab.com, ssh URL, or a github.com URL missing owner or repo segments).","commonSituations":"Pasting an SSH git remote (git@github.com:owner/repo.git) instead of the HTTPS URL; leaving the field blank because Cursor Cloud was selected late in the flow; using an internal GitLab/Gitea mirror URL.","solutions":["Enter the repository as an https GitHub URL of the form https://github.com/owner/repo.","Copy the URL from the repo's GitHub page \"Code\" button rather than from a git remote.","Convert SSH remotes: git@github.com:owner/repo.git becomes https://github.com/owner/repo.","Choose a different adapter type if the target repository is not hosted on github.com."],"exampleFix":"// before\nrepository: \"git@github.com:acme/widgets.git\"\n\n// after\nrepository: \"https://github.com/acme/widgets\"","handlingStrategy":"validation","validationCode":"const repoOk =\n  adapterType !== \"cursor_cloud\" ||\n  /^https:\\/\\/github\\.com\\/[^/]+\\/[^/]+/.test(repository.trim());\nif (!repoOk) showError(\"Enter a GitHub repository URL.\");","typeGuard":"const isGitHubRepoUrl = (s: string): boolean =>\n  /^https:\\/\\/github\\.com\\/[^/]+\\/[^/]+/.test(s.trim());","tryCatchPattern":"try {\n  const cfg = preparedConfig();\n  submit(cfg);\n} catch (e) {\n  if (e instanceof Error && e.message === \"Enter a GitHub repository URL.\") {\n    setRepoFieldError(\"Use an https://github.com/owner/repo URL.\");\n  } else throw e;\n}","preventionTips":["Paste the HTTPS URL from the GitHub repo page, not an SSH remote.","Validate the URL against the github.com pattern in the form before submit.","Only select cursor_cloud for repositories hosted on github.com."],"tags":["validation","form","url","cursor-cloud"],"backgroundTag":"invalid-url-format","analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-09-10T03:14:50.855Z","contentChangedAt":"2026-09-10T03:14:50.855Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}