{"record":{"id":"a09f48f4c9a0f8dd","repo":"paperclipai/paperclip","slug":"choose-or-enter-a-model-in-provider-model-format","errorCode":null,"errorMessage":"Choose or enter a model in provider/model format.","messagePattern":"Choose or enter a model in provider/model format\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ui/src/components/new-agent/NewAgentSetup.tsx","lineNumber":375,"sourceCode":"    if (usingKimiApi) {\n      // --model overrides Kimi's environment-defined model. Let KIMI_MODEL_NAME win.\n      delete config.model;\n      config.env = {\n        ...((config.env as object) ?? {}),\n        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());","sourceCodeStart":357,"sourceCodeEnd":393,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/ui/src/components/new-agent/NewAgentSetup.tsx#L357-L393","documentation":"NewAgentSetup's preparedConfig() validates the agent connection form before building the config object. When the form runs in multiProvider mode, the model field must be a non-empty string in \"provider/model\" form (it must contain a slash); otherwise the function throws this error. It is a client-side input validation gate, not a runtime failure.","triggerScenarios":"Submitting/confirming the new-agent setup form with multiProvider enabled and the model field either empty or lacking a \"/\" separator (e.g. \"claude-sonnet-4\" instead of \"anthropic/claude-sonnet-4\").","commonSituations":"User types a bare model name copied from vendor docs without the provider prefix; free-text model field left blank after choosing a multi-provider adapter; autocomplete list not used so the combined provider/model string was never formed.","solutions":["Enter the model as provider/model, e.g. anthropic/claude-sonnet-4.","Pick the model from the provider's suggestion list instead of free-typing, which produces the correct combined value.","If this adapter should not require a model string, disable multiProvider mode for the connection.","Trim whitespace and ensure exactly the \"provider/model\" shape before submitting."],"exampleFix":"// before\nmodel: \"claude-sonnet-4\"\n\n// after\nmodel: \"anthropic/claude-sonnet-4\"","handlingStrategy":"validation","validationCode":"const modelOk = multiProvider ? model.trim().length > 0 && model.includes(\"/\") : true;\nif (!modelOk) showError(\"Choose or enter a model in provider/model format.\");","typeGuard":"const isProviderModel = (s: string): boolean =>\n  s.trim().length > 0 && s.includes(\"/\") && s.split(\"/\").every((p) => p.length > 0);","tryCatchPattern":"try {\n  const cfg = preparedConfig();\n  submit(cfg);\n} catch (e) {\n  if (e instanceof Error && e.message.includes(\"provider/model\")) {\n    setModelFieldError(e.message);\n  } else throw e;\n}","preventionTips":["Always use the provider/model combined value from the suggestion list.","Validate the model string contains a slash before submit.","Only enable multiProvider mode when a model picker can supply provider-qualified names."],"tags":["validation","form","config","model-selection"],"backgroundTag":"invalid-argument-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"}