{"record":{"id":"00552ee3a0bcba94","repo":"eyaltoledano/claude-task-master","slug":"unknown-executor-type-options-type","errorCode":null,"errorMessage":"`Unknown executor type: ${options.type}`","messagePattern":"`Unknown executor type: (.+?)`","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/tm-core/src/modules/execution/executors/executor-factory.ts","lineNumber":31,"sourceCode":"\t * Create an executor based on the provided options\n\t */\n\tstatic create(options: ExecutorOptions): ITaskExecutor {\n\t\tthis.logger.debug(`Creating executor of type: ${options.type}`);\n\n\t\tswitch (options.type) {\n\t\t\tcase 'claude':\n\t\t\t\treturn new ClaudeExecutor(options.projectRoot, options.config);\n\n\t\t\tcase 'shell':\n\t\t\t\t// Placeholder for shell executor\n\t\t\t\tthrow new Error('Shell executor not yet implemented');\n\n\t\t\tcase 'custom':\n\t\t\t\t// Placeholder for custom executor\n\t\t\t\tthrow new Error('Custom executor not yet implemented');\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unknown executor type: ${options.type}`);\n\t\t}\n\t}\n\n\t/**\n\t * Get the default executor type based on available tools\n\t */\n\tstatic async getDefaultExecutor(\n\t\tprojectRoot: string\n\t): Promise<ExecutorType | null> {\n\t\t// Check for Claude first\n\t\tconst claudeExecutor = new ClaudeExecutor(projectRoot);\n\t\tif (await claudeExecutor.isAvailable()) {\n\t\t\tthis.logger.info('Claude CLI detected as default executor');\n\t\t\treturn 'claude';\n\t\t}\n\n\t\t// Could check for other executors here\n\t\tthis.logger.warn('No default executor available');","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/packages/tm-core/src/modules/execution/executors/executor-factory.ts#L13-L49","documentation":"Plain Error thrown by ExecutorFactory.create when options.type does not match any known executor type (not 'claude', 'shell', or 'custom'). The actual value is interpolated into the message. This is the factory's exhaustive-switch guard against invalid input.","triggerScenarios":"Calling ExecutorFactory.create with type values like 'bash', 'claude-code', 'Claude' (wrong case), an empty string, or a typo from a parsed config/command-line value.","commonSituations":"Loose string from user config or CLI flag passed through unvalidated; case-sensitivity mistakes ('Claude'); renaming executor types after a version upgrade so old configs carry stale values.","solutions":["Set options.type to 'claude' (currently the only implemented type) or omit it to use the default","Check the interpolated type value in the message and fix casing/typos ('claude', not 'Claude')","Validate the value against the supported set before calling create","Migrate old config files after upgrading if executor type names changed","Narrow the type with a union ('claude' | 'shell' | 'custom') in your own typing to catch it at compile time"],"exampleFix":"// before\nconst exec = ExecutorFactory.create({ type: (config.executor as string), projectRoot });\n// after\ntype ExecutorType = 'claude' | 'shell' | 'custom';\nconst t: ExecutorType = config.executor ?? 'claude';\nif (!['claude','shell','custom'].includes(t)) throw new Error(`bad executor: ${t}`);\nconst exec = ExecutorFactory.create({ type: t, projectRoot });","handlingStrategy":"type-guard","validationCode":"const VALID = ['claude', 'shell', 'custom'] as const;\nif (!VALID.includes(options.type as any)) {\n  throw new Error(`Invalid executor type: ${options.type}`);\n}","typeGuard":"function isValidExecutorType(t: unknown): t is 'claude' | 'shell' | 'custom' {\n  return t === 'claude' || t === 'shell' || t === 'custom';\n}","tryCatchPattern":"try {\n  executor = ExecutorFactory.create({ type, projectRoot });\n} catch (e) {\n  if (e.message.startsWith('Unknown executor type')) {\n    executor = ExecutorFactory.create({ projectRoot }); // default\n  } else throw e;\n}","preventionTips":["Normalize/trim and lowercase user-supplied executor values before use","Type executor options as the literal union instead of string","Validate config files at load time against the supported type set","Keep config schema migrations when executor names change across versions"],"tags":["executor","factory","invalid-argument","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}