{"record":{"id":"9712ae4b1a4b9b27","repo":"paperclipai/paperclip","slug":"enter-the-kimi-api-model-name","errorCode":null,"errorMessage":"Enter the Kimi API model name.","messagePattern":"Enter the Kimi API model name\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ui/src/components/new-agent/NewAgentSetup.tsx","lineNumber":400,"sourceCode":"      [\"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    }\n    if (usingKimiApi && !kimiModel.trim())\n      throw new Error(\"Enter the Kimi API model name.\");\n    return buildConfig(nextConnection);\n  }\n  function pendingCredentials(nextConnection = connection) {\n    return {\n      ...nextConnection?.credentials,\n      ...(hasCredentialField && apiKey.trim()\n        ? { [envKey]: apiKey.trim() }\n        : {}),\n    };\n  }\n\n  async function runTest(nextConnection = connection): Promise<boolean> {\n    if (!ready) return false;\n    const run = ++generation.current;\n    setTestState(\"running\");\n    setResult(null);\n    setError(null);\n    try {","sourceCodeStart":382,"sourceCodeEnd":418,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/ui/src/components/new-agent/NewAgentSetup.tsx#L382-L418","documentation":"When the hermes_gateway connection is configured to use the Kimi API (usingKimiApi is true), preparedConfig() requires a non-empty kimiModel value and throws \"Enter the Kimi API model name.\" otherwise. The Kimi model name is passed through to the gateway, so a blank value would produce an unusable connection config.","triggerScenarios":"Submitting setup with adapterType \"hermes_gateway\", the Kimi API option enabled, and the Kimi model field empty or whitespace-only.","commonSituations":"Toggling the Kimi API switch but not filling the dependent model field; copying a config where Kimi was disabled; whitespace-only paste that passes the visual check but fails trim().","solutions":["Enter the Kimi API model name (e.g. moonshot-v1-32k) in the Kimi model field.","If Kimi is not needed, disable the Kimi API option so the field is not required.","Re-check the field after toggling the Kimi option on — it starts empty.","Ensure the value is not just whitespace."],"exampleFix":"// before\nusingKimiApi: true,\nkimiModel: \"\"\n\n// after\nusingKimiApi: true,\nkimiModel: \"moonshot-v1-32k\"","handlingStrategy":"validation","validationCode":"const kimiOk = !usingKimiApi || kimiModel.trim().length > 0;\nif (!kimiOk) showError(\"Enter the Kimi API model name.\");","typeGuard":"const kimiModelRequired = (opts: { usingKimiApi: boolean; kimiModel: string }): boolean =>\n  opts.usingKimiApi && opts.kimiModel.trim().length === 0;","tryCatchPattern":"try {\n  const cfg = preparedConfig();\n  submit(cfg);\n} catch (e) {\n  if (e instanceof Error && e.message.includes(\"Kimi API model\")) {\n    setKimiFieldError(e.message);\n  } else throw e;\n}","preventionTips":["Make the Kimi model field required whenever the Kimi API toggle is on.","Clear/require dependent fields when feature toggles change.","Trim values so whitespace-only entries are caught."],"tags":["validation","form","config","hermes-gateway"],"backgroundTag":"missing-required-config-field","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"}