paperclipai/paperclip · error

Choose or enter a model in provider/model format.

Error message

Choose or enter a model in provider/model format.

What it means

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.

Source

Thrown at ui/src/components/new-agent/NewAgentSetup.tsx:375

    if (usingKimiApi) {
      // --model overrides Kimi's environment-defined model. Let KIMI_MODEL_NAME win.
      delete config.model;
      config.env = {
        ...((config.env as object) ?? {}),
        KIMI_MODEL_NAME: { type: "plain", value: kimiModel.trim() },
        KIMI_MODEL_PROVIDER_TYPE: { type: "plain", value: kimiProtocol },
        ...(kimiBaseUrl.trim()
          ? {
              KIMI_MODEL_BASE_URL: { type: "plain", value: kimiBaseUrl.trim() },
            }
          : {}),
      };
    }
    return config;
  }
  function preparedConfig(nextConnection = connection) {
    if (multiProvider && (!model.trim() || !model.includes("/")))
      throw new Error("Choose or enter a model in provider/model format.");
    if (
      adapterType === "cursor_cloud" &&
      !/^https:\/\/github\.com\/[^/]+\/[^/]+/.test(repository.trim())
    )
      throw new Error("Enter a GitHub repository URL.");
    if (
      ["cursor_cloud", "hermes_gateway"].includes(adapterType) &&
      !apiKey.trim() &&
      !selectedBinding
    )
      throw new Error(
        adapterType === "cursor_cloud"
          ? "Enter a Cursor API key."
          : `Enter ${envKey} or select an organization secret.`,
      );
    if (adapterType === "hermes_gateway") {
      try {
        const url = new URL(gatewayUrl.trim());

View on GitHub (pinned to 01ad858492)

Solutions

  1. Enter the model as provider/model, e.g. anthropic/claude-sonnet-4.
  2. Pick the model from the provider's suggestion list instead of free-typing, which produces the correct combined value.
  3. If this adapter should not require a model string, disable multiProvider mode for the connection.
  4. Trim whitespace and ensure exactly the "provider/model" shape before submitting.

Example fix

// before
model: "claude-sonnet-4"

// after
model: "anthropic/claude-sonnet-4"
Defensive patterns

Strategy: validation

Validate before calling

const modelOk = multiProvider ? model.trim().length > 0 && model.includes("/") : true;
if (!modelOk) showError("Choose or enter a model in provider/model format.");

Type guard

const isProviderModel = (s: string): boolean =>
  s.trim().length > 0 && s.includes("/") && s.split("/").every((p) => p.length > 0);

Try / catch

try {
  const cfg = preparedConfig();
  submit(cfg);
} catch (e) {
  if (e instanceof Error && e.message.includes("provider/model")) {
    setModelFieldError(e.message);
  } else throw e;
}

Prevention

When it happens

Trigger: 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").

Common situations: 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.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-09-10). Data as JSON: /api/errors/a09f48f4c9a0f8dd. Report an issue: GitHub.