#15031·OmniRoute

'providers add --allow-no-credential' never tells the server the connection is credential-optional; 'providers test' then falsely reports 'no API key configured'

Author: schienbizCreated Sep 29, 2026Updated Sep 29, 2026

Summary

omniroute providers add <local-provider> --allow-no-credential successfully skips the CLI's local credential prompt, but never communicates "this connection doesn't need a credential" to the server. The resulting connection is stored as an ordinary apikey-auth-type connection with an empty key — indistinguishable from a broken/incomplete API-key setup. providers test (and, very likely, actual chat routing through that connection) then fails.

Root cause (traced in source)

  • buildProviderPayload() in bin/cli/commands/provider-crud.mjs (around line 98) builds the POST /api/providers body from provider, name, apiKey (only if a credential was resolved), defaultModel, priority, providerSpecificData. There is no field carrying allowNoCredential / a "no auth required" signal — the flag is used client-side only, to decide whether to skip the prompt (resolveProviderCredential, around line 265).
  • The server therefore creates the connection with its default authType (apikey) and no key.
  • providers test <id> calls into getProviderApiKey() in bin/cli/provider-store.mjs (lines 185–193):
    javascript
    export function getProviderApiKey(connection) {
      if (connection.authType !== "apikey") {
        throw new Error(`Connection ${connection.name} is not an API-key provider.`);
      }
      if (!connection.apiKey) {
        throw new Error(`Connection ${connection.name} has no API key configured.`);
      }
      return decryptCredential(connection.apiKey);
    }
    Since authType === "apikey" (wrongly, for a local/passthrough provider) and apiKey is empty, this throws "Connection <name> has no API key configured."

Note there IS a correctly-guarded check elsewhere in bin/cli/commands/providers.mjs (~line 165: if (connection.authType !== "apikey") { ... error: "No API-key probe for ${connection.authType} connections" }) — but that guard is bypassed here specifically because the connection's authType was never set to anything other than apikey in the first place, since the catalog's actual auth type/category (local, for ollama-local) is never consulted when building the create payload.

Repro

bash
omniroute providers add ollama-local --allow-no-credential --yes
# creates the connection (see #15030 for a related but separate read-back crash)
omniroute providers test <id>
# FAIL ollama-local: Connection ollama-local has no API key configured.

omniroute providers edit has no option to retroactively mark a connection as credential-optional, so there's no CLI-level workaround once created.

Expected

providers add <provider> --allow-no-credential for a provider whose catalog entry has category local (or otherwise marks credential optional) should create the connection with the correct authType (e.g. none/local, whatever the schema uses) so downstream test/routing code doesn't require a key that was never supposed to exist.

Environment

  • OmniRoute 3.8.51 (commit a13e82d9850a8e94f7c0e5a4b83c7ae444cf0ea9)
  • Node v24.19.0, macOS (darwin arm64)
  • Source build
  • Provider: ollama-local (category local, alias ollama, passthrough)