{"record":{"id":"224f8ffe89d11198","repo":"Yeachan-Heo/oh-my-codex","slug":"invalid-worker-name-name-must-match-a-z0","errorCode":null,"errorMessage":"Invalid worker name: \"${name}\". Must match /^[a-z0-9][a-z0-9-]{0,63}$/ (lowercase alphanumeric + hyphens, max 64 chars).","messagePattern":"Invalid worker name: \"(.+?)\"\\. Must match /\\^\\[a-z0-9\\]\\[a-z0-9-\\](.+?)\\$/ \\(lowercase alphanumeric \\+ hyphens, max 64 chars\\)\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/team/state.ts","lineNumber":500,"sourceCode":"function isTerminalTaskStatus(status: TeamTaskStatus): boolean {\n  return isTerminalTeamTaskStatus(status);\n}\n\nfunction canTransitionTaskStatus(from: TeamTaskStatus, to: TeamTaskStatus): boolean {\n  return canTransitionTeamTaskStatus(from, to);\n}\n\nfunction assertPathWithinDir(filePath: string, rootDir: string): void {\n  const normalizedRoot = resolve(rootDir);\n  const normalizedPath = resolve(filePath);\n  if (normalizedPath !== normalizedRoot && !normalizedPath.startsWith(normalizedRoot + sep)) {\n    throw new Error('Path traversal detected: path is outside the allowed directory');\n  }\n}\n\nfunction validateWorkerName(name: string): void {\n  if (!WORKER_NAME_SAFE_PATTERN.test(name)) {\n    throw new Error(\n      `Invalid worker name: \"${name}\". Must match /^[a-z0-9][a-z0-9-]{0,63}$/ (lowercase alphanumeric + hyphens, max 64 chars).`\n    );\n  }\n}\n\nfunction validateTaskId(taskId: string): void {\n  if (!TASK_ID_SAFE_PATTERN.test(taskId)) {\n    throw new Error(\n      `Invalid task ID: \"${taskId}\". Must be a positive integer (digits only, max 20 digits).`\n    );\n  }\n}\n\nfunction defaultLeader(): TeamLeader {\n  return {\n    session_id: '',\n    worker_id: 'leader-fixed',\n    role: 'coordinator',","sourceCodeStart":482,"sourceCodeEnd":518,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/team/state.ts#L482-L518","documentation":"Worker name failed the safety pattern /^[a-z0-9][a-z0-9-]{0,63}$/: lowercase alphanumeric plus hyphens, must start alphanumeric, max 64 chars. Thrown by validateWorkerName via mailboxPath, mailboxLockDir, and enqueueDispatchRequest.","triggerScenarios":"Passing a worker name with uppercase letters, underscores, spaces, slashes, leading hyphen, or longer than 64 characters to mailboxPath, mailboxLockDir, or enqueueDispatchRequest.","commonSituations":"Auto-generated names from hostnames/usernames with dots or uppercase; hand-typed names with underscores; truncation bugs producing >64 char names.","solutions":["Normalize names: lowercase, replace '_' and spaces with '-', strip other characters, cap length at 64","Validate names at the boundary (CLI/API input) with the same regex before use","Regenerate a valid name and retry the operation"],"exampleFix":"// before\nawait enqueueDispatchRequest('Worker_One', ...); // throws\n\n// after\nconst name = 'Worker_One'.toLowerCase().replace(/_/g, '-'); // 'worker-one'\nawait enqueueDispatchRequest(name, ...);","handlingStrategy":"type-guard","validationCode":"const WORKER_NAME = /^[a-z0-9][a-z0-9-]{0,63}$/;\nfunction normalizeWorkerName(raw: string): string {\n  return raw.toLowerCase().replace(/[^a-z0-9-]+/g, '-').replace(/^-+/, '').slice(0, 64);\n}","typeGuard":"function isValidWorkerName(name: string): boolean {\n  return /^[a-z0-9][a-z0-9-]{0,63}$/.test(name);\n}","tryCatchPattern":null,"preventionTips":["Validate worker names at input boundaries with the same regex","Generate names programmatically (worker-1, worker-2) instead of from free-form text"],"tags":["team","validation","naming","input-validation"],"backgroundTag":"identifier-validation-failed","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}