{"record":{"id":"f597a8a49fa940dc","repo":"eyaltoledano/claude-task-master","slug":"validation-error-f597a8","errorCode":"VALIDATION_ERROR","errorMessage":"'Organization slug could not be extracted from input'","messagePattern":"'Organization slug could not be extracted from input'","errorType":"validation","errorClass":"TaskMasterError","httpStatus":null,"severity":"error","filePath":"packages/tm-core/src/modules/briefs/utils/url-parser.ts","lineNumber":139,"sourceCode":"\t\t}\n\n\t\treturn { orgSlug, briefId };\n\t}\n\n\t/**\n\t * Validate that required components are present\n\t *\n\t * @param parsed - Parsed URL components\n\t * @param requireOrg - Whether org slug is required\n\t * @param requireBrief - Whether brief ID is required\n\t * @throws TaskMasterError if required components are missing\n\t */\n\tstatic validate(\n\t\tparsed: ParsedBriefUrl,\n\t\toptions: { requireOrg?: boolean; requireBrief?: boolean } = {}\n\t): void {\n\t\tif (options.requireOrg && !parsed.orgSlug) {\n\t\t\tthrow new TaskMasterError(\n\t\t\t\t'Organization slug could not be extracted from input',\n\t\t\t\tERROR_CODES.VALIDATION_ERROR\n\t\t\t);\n\t\t}\n\n\t\tif (options.requireBrief && !parsed.briefId) {\n\t\t\tthrow new TaskMasterError(\n\t\t\t\t'Brief identifier could not be extracted from input',\n\t\t\t\tERROR_CODES.VALIDATION_ERROR\n\t\t\t);\n\t\t}\n\t}\n}\n","sourceCodeStart":121,"sourceCodeEnd":153,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/packages/tm-core/src/modules/briefs/utils/url-parser.ts#L121-L153","documentation":"BriefUrlParser.validate throws this when options.requireOrg is set but the parsed input has no orgSlug. It is an input-validation guard ensuring a brief URL/string contained a usable organization slug before downstream resolution proceeds.","triggerScenarios":"Calling BriefUrlParser.validate(parsed, { requireOrg: true }) with a ParsedBriefUrl whose orgSlug is null/empty — e.g. parsing a bare brief ID or a URL without an org segment.","commonSituations":"User pastes only a brief path/ID instead of the full URL; internal URLs omit the org segment; regex/parse produced empty orgSlug for an unusual URL shape; caller requires org but input was a bare ID.","solutions":["Provide the full brief URL including the organization slug (e.g. https://host/org-slug/brief/123)","If the input legitimately has no org, call validate without requireOrg and supply the org separately from context","Inspect the parsed object first (parsed.orgSlug) before requesting validation","Normalize the input string (trim, correct host) before parsing"],"exampleFix":"// before\nconst parsed = BriefUrlParser.parse('https://host/brief/123');\nBriefUrlParser.validate(parsed, { requireOrg: true }); // throws\n// after\nconst parsed = BriefUrlParser.parse('https://host/acme/brief/123'); // full URL with org\nBriefUrlParser.validate(parsed, { requireOrg: true });","handlingStrategy":"validation","validationCode":"const parsed = BriefUrlParser.parse(input);\nif (!parsed.orgSlug) {\n  throw new Error('Input must be a full brief URL containing the organization slug');\n}\nBriefUrlParser.validate(parsed, { requireOrg: true }); // now safe","typeGuard":"function hasOrgSlug(p: ParsedBriefUrl): p is ParsedBriefUrl & { orgSlug: string } {\n  return typeof p.orgSlug === 'string' && p.orgSlug.length > 0;\n}","tryCatchPattern":"try {\n  BriefUrlParser.validate(parsed, { requireOrg: true });\n} catch (e) {\n  if (e instanceof TaskMasterError && e.code === 'VALIDATION_ERROR') {\n    // ask user for the full URL or fall back to org from `tm context org`\n  } else { throw e; }\n}","preventionTips":["Always paste the complete brief URL including the org segment","Inspect parsed.orgSlug before calling validate with requireOrg","Accept org-from-context as a fallback when the input lacks an org slug","Trim/normalize pasted input; truncated pastes are the top cause"],"tags":["validation","url-parsing","brief"],"backgroundTag":"url-parse-validation-failed","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}