ruvnet/RuView · error · Error

Unsupported host: ${name}

Error message

Unsupported host: ${name}

What it means

getHost(name) (harness/ruview/src/hosts/index.js) resolves a host adapter from the frozen HOSTS map whose exact keys are 'claude-code' and 'codex'. Lookup is a plain property access, so casing, separators, aliases, and unregistered hosts all miss and throw `Unsupported host: <name>`.

Source

Thrown at harness/ruview/src/hosts/index.js:8

// SPDX-License-Identifier: MIT
import claudeCode from './claude-code.js';
import codex from './codex.js';
export { claudeCode, codex };
export const HOSTS = Object.freeze({ 'claude-code': claudeCode, codex });
export function getHost(name) {
  const host = HOSTS[name];
  if (!host) throw new Error(`Unsupported host: ${name}`);
  return host;
}

View on GitHub (pinned to 4685618388)

Solutions

  1. Use the exact keys: getHost('claude-code') or getHost('codex').
  2. Normalize and check before lookup: const name = String(raw).trim(); if (!(name in HOSTS)) list Object.keys(HOSTS).join(', ') in your error.
  3. When adding a host adapter, also register it in the HOSTS map in harness/ruview/src/hosts/index.js.

Example fix

// before
getHost(config.host) // config.host === 'claude'
// after
import { HOSTS } from './hosts/index.js';
const name = String(config.host ?? '').trim();
if (!(name in HOSTS)) throw new Error(`Unsupported host: ${name}. Available: ${Object.keys(HOSTS).join(', ')}`);
getHost(name);
Defensive patterns

Strategy: type-guard

Validate before calling

import { HOSTS } from './hosts/index.js';
const name = String(rawName ?? '').trim();
if (!(name in HOSTS)) {
  throw new Error(`unsupported host '${name}'; available: ${Object.keys(HOSTS).join(', ')}`);
}
getHost(name);

Type guard

import { HOSTS } from './hosts/index.js';
function isSupportedHost(name) {
  return typeof name === 'string' && Object.hasOwn(HOSTS, name);
}

Try / catch

try {
  getHost(name);
} catch (e) {
  if (e instanceof Error && e.message.startsWith('Unsupported host')) {
    // fall back to a default host or surface the valid list to the user
    return HOSTS['codex'];
  }
  throw e;
}

Prevention

When it happens

Trigger: getHost('claude') , getHost('Claude Code'), getHost('claude_code'), getHost('cursor'), getHost('' ) — from a CLI --host flag, config file, or MCP parameter.

Common situations: Users typing natural host names in config; hyphen/underscore drift between CLI flag and map key; adding a new host module without registering it in hosts/index.js; trailing whitespace from config values.

Related errors


AI-assisted analysis of ruvnet/RuView@4685618388 (2026-08-16). Data as JSON: /api/errors/7425d9edb9df736e. Report an issue: GitHub.