slopus/happy · error

Unsupported vendor: ${vendor}

Error message

Unsupported vendor: ${vendor}

What it means

handleConnectVendor supports a fixed set of vendors (e.g. claude, gemini); any other value falls into the final else branch and throws 'Unsupported vendor: <vendor>'. It's an argument-validation error for the `happy connect <vendor>` command.

Source

Thrown at packages/happy-cli/src/commands/connect.ts:116

        process.exit(0);
    } else if (vendor === 'claude') {
        console.log('🚀 Registering Anthropic token with server');
        const anthropicAuthTokens = await authenticateClaude();
        await api.registerVendorToken('anthropic', { oauth: anthropicAuthTokens });
        console.log('✅ Anthropic token registered with server');
        process.exit(0);
    } else if (vendor === 'gemini') {
        console.log('🚀 Registering Gemini token with server');
        const geminiAuthTokens = await authenticateGemini();
        await api.registerVendorToken('gemini', { oauth: geminiAuthTokens });
        console.log('✅ Gemini token registered with server');
        
        // Also update local Gemini config to keep tokens in sync
        updateLocalGeminiCredentials(geminiAuthTokens);
        
        process.exit(0);
    } else {
        throw new Error(`Unsupported vendor: ${vendor}`);
    }
}

/**
 * Show connection status for all vendors
 */
async function handleConnectStatus(): Promise<void> {
    console.log(chalk.bold('\n🔌 Connection Status\n'));

    // Check if authenticated
    const credentials = await readCredentials();
    if (!credentials) {
        console.log(chalk.yellow('⚠️  Not authenticated with Happy'));
        console.log(chalk.gray('  Please run "happy auth login" first'));
        process.exit(1);
    }

    // Create API client

View on GitHub (pinned to b824cd0a46)

Solutions

  1. Run `happy connect --help` (or check the status subcommand) to list supported vendors
  2. Fix the spelling of the vendor argument
  3. Update happy-cli to the latest version if the vendor was recently added
  4. For Codex, use `happy codex` instead of `happy connect codex`

Example fix

// before
$ happy connect gemni
Error: Unsupported vendor: gemni

// after
$ happy connect gemini
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED_VENDORS = ['claude', 'gemini'] as const;
type Vendor = typeof SUPPORTED_VENDORS[number];
function isSupportedVendor(v: string): v is Vendor {
  return (SUPPORTED_VENDORS as readonly string[]).includes(v);
}
if (!isSupportedVendor(vendor)) {
  console.error(`Unsupported vendor: ${vendor}. Supported: ${SUPPORTED_VENDORS.join(', ')}`);
  process.exit(1);
}

Type guard

function isVendor(v: string): v is 'claude' | 'gemini' {
  return v === 'claude' || v === 'gemini';
}

Try / catch

try {
  await handleConnectVendor(vendor);
} catch (error) {
  if ((error as Error).message.startsWith('Unsupported vendor:')) {
    console.error((error as Error).message + '\nRun `happy connect --help` for supported vendors.');
  } else { throw error; }
}

Prevention

When it happens

Trigger: Running `happy connect <vendor>` with a misspelled or unimplemented vendor name (e.g. `happy connect codex`, `happy connect gemni`), or an older CLI invoked with a vendor added only in newer versions.

Common situations: Typo in the vendor argument; following docs/blogs for a vendor your CLI version doesn't support yet; scripts parameterizing the vendor with a wrong value.

Related errors


AI-assisted analysis of slopus/happy@b824cd0a46 (2026-08-31). Data as JSON: /api/errors/1e76d00f7d525a65. Report an issue: GitHub.