{"record":{"id":"a0b1bd9b02f7fb51","repo":"Yeachan-Heo/oh-my-codex","slug":"invalid-source-conflicting-duplicate-axis-p","errorCode":null,"errorMessage":"Invalid ${source}: conflicting duplicate ${axis} policy","messagePattern":"Invalid (.+?): conflicting duplicate (.+?) policy","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/team/model-contract.ts","lineNumber":334,"sourceCode":"): string {\n  if (typeof value !== 'string') {\n    throw teamWorkerLaunchArgsError(source, `missing value for ${flag}`);\n  }\n  const normalized = value.trim();\n  if (normalized === '' || normalized.startsWith('-')) {\n    throw teamWorkerLaunchArgsError(source, `missing value for ${flag}`);\n  }\n  return value;\n}\n\nfunction setDirectPolicyValue(\n  existingValue: string | null,\n  value: string,\n  axis: PolicyAxis,\n  source: string,\n): string {\n  if (existingValue !== null && existingValue !== value) {\n    throw teamWorkerLaunchArgsError(source, `conflicting duplicate ${axis} policy`);\n  }\n  return value;\n}\n\nfunction directPolicySelector(arg: string): { axis: 'approval' | 'sandbox'; flag: string; value?: string } | null {\n  if (arg === TEAM_WORKER_APPROVAL_FLAG || arg === '-a') {\n    return { axis: 'approval', flag: TEAM_WORKER_APPROVAL_FLAG };\n  }\n  if (arg.startsWith(`${TEAM_WORKER_APPROVAL_FLAG}=`)) {\n    return {\n      axis: 'approval',\n      flag: TEAM_WORKER_APPROVAL_FLAG,\n      value: arg.slice(`${TEAM_WORKER_APPROVAL_FLAG}=`.length),\n    };\n  }\n  if (arg.startsWith('-a=')) {\n    return { axis: 'approval', flag: TEAM_WORKER_APPROVAL_FLAG, value: arg.slice(3) };\n  }","sourceCodeStart":316,"sourceCodeEnd":352,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/team/model-contract.ts#L316-L352","documentation":"The same policy axis (approval or sandbox) is specified more than once in the launch args with different values. setDirectPolicyValue only allows repeating a flag if the value is identical (idempotent).","triggerScenarios":"Args containing e.g. both '--approval auto' and '--approval never', or a -a short form conflicting with the long form.","commonSituations":"Inherited leader args already set a policy and the env var tries to override it with a different value; concatenating arg lists naively.","solutions":["Remove the duplicate so each axis is set once","If re-declaring, use the identical value","Use the merge/override API instead of concatenating raw arg strings"],"exampleFix":"# before\n'--approval auto --approval never'\n# after\n'--approval auto'","handlingStrategy":"validation","validationCode":"const seen = new Map<string, string>();\nfor (const { axis, value } of policyFlags) {\n  if (seen.has(axis) && seen.get(axis) !== value) throw new Error('conflict');\n  seen.set(axis, value);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set each policy axis exactly once","Use dedicated merge APIs instead of concatenating arg strings"],"tags":["team","argument-parsing","conflicting-options"],"backgroundTag":"invalid-command-line-arguments","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}