{"record":{"id":"6af8e77110276b3b","repo":"affaan-m/ECC","slug":"unsupported-install-request-mode-request-mode","errorCode":null,"errorMessage":"Unsupported install request mode: ${request.mode}","messagePattern":"Unsupported install request mode: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/lib/install/runtime.js","lineNumber":61,"sourceCode":"      env: resolveInvocationEnvironment(options),\n      claudeRulesDir: options.claudeRulesDir,\n      sourceRoot: options.sourceRoot,\n      exemptValidationCodes: options.exemptValidationCodes || [],\n    });\n  }\n\n  if (request.mode === 'legacy') {\n    return createLegacyInstallPlan({\n      target: request.target,\n      languages: request.languages,\n      projectRoot: options.projectRoot,\n      homeDir: options.homeDir,\n      claudeRulesDir: options.claudeRulesDir,\n      sourceRoot: options.sourceRoot,\n    });\n  }\n\n  throw new Error(`Unsupported install request mode: ${request.mode}`);\n}\n\nmodule.exports = {\n  createInstallPlanFromRequest,\n};\n","sourceCodeStart":43,"sourceCodeEnd":67,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/lib/install/runtime.js#L43-L67","documentation":"createRawInstallPlan dispatches on request.mode, which normalizeInstallRequest sets to 'manifest' or 'legacy-compat'. If mode holds any other value, no planner branch matches and the library throws, indicating a malformed or hand-crafted request object.","triggerScenarios":"Passing a request object whose mode property is a typo ('Manifest', 'legacy'), a stale value from an older library version, or an object not produced by normalizeInstallRequest (mode missing/undefined also lands here).","commonSituations":"Constructing request objects by hand in tests; version skew where an older serialized request is replayed against a newer runtime; monkey-patching normalizeInstallRequest output.","solutions":["Produce the request via normalizeInstallRequest instead of building it manually.","Check request.mode is exactly 'manifest' or 'legacy-compat' before calling.","Update any persisted/serialized requests to the current mode vocabulary after a library upgrade."],"exampleFix":"// before\ncreateInstallPlanFromRequest({ mode: 'manifest-mode', ... })\n// after\ncreateInstallPlanFromRequest({ mode: 'manifest', ... })","handlingStrategy":"validation","validationCode":"const ALLOWED_MODES = ['manifest', 'legacy-compat']\nif (!ALLOWED_MODES.includes(request?.mode)) throw new Error(`mode must be one of ${ALLOWED_MODES.join(', ')}`)","typeGuard":"function hasValidMode(r) {\n  return r !== null && typeof r === 'object' && (r.mode === 'manifest' || r.mode === 'legacy-compat')\n}","tryCatchPattern":"try {\n  const plan = createInstallPlanFromRequest(req)\n} catch (err) {\n  if (err.message.startsWith('Unsupported install request mode')) {\n    console.error(`Bad mode \"${req?.mode}\" — rebuild the request with normalizeInstallRequest()`) \n  } else throw err\n}","preventionTips":["Only construct requests through normalizeInstallRequest.","Spell modes exactly as 'manifest' or 'legacy-compat'.","Migrate persisted requests after library upgrades that change mode names.","Assert request.mode in tests before dispatch."],"tags":["install","dispatch","invalid-value"],"backgroundTag":"invalid-argument-value","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}