{"record":{"id":"7425d9edb9df736e","repo":"ruvnet/RuView","slug":"unsupported-host-name-7425d9","errorCode":null,"errorMessage":"Unsupported host: ${name}","messagePattern":"Unsupported host: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"harness/ruview/src/hosts/index.js","lineNumber":8,"sourceCode":"// SPDX-License-Identifier: MIT\nimport claudeCode from './claude-code.js';\nimport codex from './codex.js';\nexport { claudeCode, codex };\nexport const HOSTS = Object.freeze({ 'claude-code': claudeCode, codex });\nexport function getHost(name) {\n  const host = HOSTS[name];\n  if (!host) throw new Error(`Unsupported host: ${name}`);\n  return host;\n}\n","sourceCodeStart":1,"sourceCodeEnd":11,"githubUrl":"https://github.com/ruvnet/RuView/blob/4685618388a5e49fad5b3005806f3bdd6a7c25c3/harness/ruview/src/hosts/index.js#L1-L11","documentation":"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>`.","triggerScenarios":"getHost('claude') , getHost('Claude Code'), getHost('claude_code'), getHost('cursor'), getHost('' ) — from a CLI --host flag, config file, or MCP parameter.","commonSituations":"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.","solutions":["Use the exact keys: getHost('claude-code') or getHost('codex').","Normalize and check before lookup: const name = String(raw).trim(); if (!(name in HOSTS)) list Object.keys(HOSTS).join(', ') in your error.","When adding a host adapter, also register it in the HOSTS map in harness/ruview/src/hosts/index.js."],"exampleFix":"// before\ngetHost(config.host) // config.host === 'claude'\n// after\nimport { HOSTS } from './hosts/index.js';\nconst name = String(config.host ?? '').trim();\nif (!(name in HOSTS)) throw new Error(`Unsupported host: ${name}. Available: ${Object.keys(HOSTS).join(', ')}`);\ngetHost(name);","handlingStrategy":"type-guard","validationCode":"import { HOSTS } from './hosts/index.js';\nconst name = String(rawName ?? '').trim();\nif (!(name in HOSTS)) {\n  throw new Error(`unsupported host '${name}'; available: ${Object.keys(HOSTS).join(', ')}`);\n}\ngetHost(name);","typeGuard":"import { HOSTS } from './hosts/index.js';\nfunction isSupportedHost(name) {\n  return typeof name === 'string' && Object.hasOwn(HOSTS, name);\n}","tryCatchPattern":"try {\n  getHost(name);\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Unsupported host')) {\n    // fall back to a default host or surface the valid list to the user\n    return HOSTS['codex'];\n  }\n  throw e;\n}","preventionTips":["Drive --host choices from Object.keys(HOSTS) so docs and code share one source of truth.","Trim and exact-match host names; keys are 'claude-code' and 'codex'.","When adding a host adapter, register it in hosts/index.js in the same commit."],"tags":["validation","host-adapter","registry","configuration","ruview-harness"],"backgroundTag":null,"analyzedSha":"4685618388a5e49fad5b3005806f3bdd6a7c25c3","analyzedAt":"2026-08-16T06:09:40.886Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}