{"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":"Error","httpStatus":null,"severity":"error","filePath":"scripts/lib/install/runtime.js","lineNumber":51,"sourceCode":"      projectRoot: options.projectRoot,\n      homeDir: options.homeDir,\n      claudeRulesDir: options.claudeRulesDir,\n      sourceRoot: options.sourceRoot,\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":33,"sourceCodeEnd":57,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/lib/install/runtime.js#L33-L57","documentation":"Thrown by createInstallPlanFromRequest() when request.mode is defined but is not one of the three supported values ('manifest', 'legacy-compat', 'legacy'). It is the defensive default branch after all known modes have been checked.","triggerScenarios":"Constructing a request object by hand and setting mode to an invented value like 'custom' or 'auto'; a future ECC version introduces a new mode that this older runtime does not understand; a typo in the mode string.","commonSituations":"Version skew between the request producer and the runtime; serializing/deserializing requests through a format that mutates the mode; hand-built request objects in tests.","solutions":["Use normalizeInstallRequest() to produce the request so the mode is always one of the supported values.","Align versions: ensure the code that builds the request and the runtime that consumes it are the same ECC version.","If you must build the request manually, restrict mode to 'manifest', 'legacy-compat', or 'legacy'."],"exampleFix":"// before\nconst plan = createInstallPlanFromRequest({ mode: 'auto', target: 'claude' });\n// after\nconst plan = createInstallPlanFromRequest({ mode: 'manifest', target: 'claude', profileId: 'base', moduleIds: [], includeComponentIds: [], excludeComponentIds: [] });","handlingStrategy":"validation","validationCode":"const SUPPORTED_MODES = new Set(['manifest','legacy-compat','legacy']);\nif (!SUPPORTED_MODES.has(request?.mode)) {\n  throw new Error(`Unsupported install request mode: ${request?.mode}. Supported: ${[...SUPPORTED_MODES].join(', ')}`);\n}","typeGuard":"function isSupportedMode(mode) {\n  return mode === 'manifest' || mode === 'legacy-compat' || mode === 'legacy';\n}","tryCatchPattern":"try {\n  plan = createInstallPlanFromRequest(request, options);\n} catch (e) {\n  if (/^Unsupported install request mode:/.test(e.message)) {\n    request = { ...request, mode: 'manifest' };\n    plan = createInstallPlanFromRequest(request, options);\n  } else throw e;\n}","preventionTips":["Always produce requests via normalizeInstallRequest() so mode is never invented.","Pin producer and consumer to the same ECC version.","In tests, restrict mode to the known set rather than generating random strings."],"tags":["install","runtime","api-misuse","mode"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}