{"record":{"id":"e6f09543780941ba","repo":"openai/codex-plugin-cc","slug":"this-codex-review-target-is-not-supported-by-th","errorCode":null,"errorMessage":"This `/codex:review` target is not supported by the built-in reviewer. Retry with `/codex:adversarial-review` for custom targeting.","messagePattern":"This `/codex:review` target is not supported by the built-in reviewer\\. Retry with `/codex:adversarial-review` for custom targeting\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"plugins/codex/scripts/codex-companion.mjs","lineNumber":280,"sourceCode":"  }\n\n  if (target.mode === \"branch\") {\n    return { type: \"baseBranch\", branch: target.baseRef };\n  }\n\n  return null;\n}\n\nfunction validateNativeReviewRequest(target, focusText) {\n  if (focusText.trim()) {\n    throw new Error(\n      `\\`/codex:review\\` now maps directly to the built-in reviewer and does not support custom focus text. Retry with \\`/codex:adversarial-review ${focusText.trim()}\\` for focused review instructions.`\n    );\n  }\n\n  const nativeTarget = buildNativeReviewTarget(target);\n  if (!nativeTarget) {\n    throw new Error(\"This `/codex:review` target is not supported by the built-in reviewer. Retry with `/codex:adversarial-review` for custom targeting.\");\n  }\n\n  return nativeTarget;\n}\n\nfunction renderStatusPayload(report, asJson) {\n  return asJson ? report : renderStatusReport(report);\n}\n\nfunction isActiveJobStatus(status) {\n  return status === \"queued\" || status === \"running\";\n}\n\nfunction getCurrentClaudeSessionId() {\n  return process.env[SESSION_ID_ENV] ?? null;\n}\n\nfunction filterJobsForCurrentClaudeSession(jobs) {","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/openai/codex-plugin-cc/blob/db52e28f4d9ded852ab3942cea316258ae4ef346/plugins/codex/scripts/codex-companion.mjs#L262-L298","documentation":"After confirming focusText is empty, buildNativeReviewTarget maps the resolved review target to a native reviewer shape. It only handles mode 'working-tree' (-> uncommittedChanges) and 'branch' (-> baseBranch). Any other target.mode returns null, and validateNativeReviewRequest throws because the built-in reviewer cannot address it.","triggerScenarios":"resolveReviewTarget produces a mode that is neither 'working-tree' nor 'branch' (e.g. a 'range' or 'commit' scope the native reviewer does not support), and the user invoked /codex:review rather than /codex:adversarial-review.","commonSituations":"Passing --scope with a custom value, or reviewing a specific commit range that the built-in reviewer cannot target.","solutions":["Switch to /codex:adversarial-review which accepts arbitrary targeting via collectReviewContext.","Use --scope working-tree or --scope branch so buildNativeReviewTarget succeeds.","Omit --scope to let resolveReviewTarget default to a supported mode."],"exampleFix":"// before\ncodex-companion.mjs review --scope range\n// after\ncodex-companion.mjs adversarial-review --scope range","handlingStrategy":"validation","validationCode":"const supported = new Set(['working-tree','branch']);\nif (reviewName === 'Review' && !supported.has(target.mode)) {\n  throw new Error('unsupported native review target');\n}","typeGuard":"/** @param {{mode: string}} t @returns {boolean} */\nfunction isNativeReviewSupported(t) {\n  return t.mode === 'working-tree' || t.mode === 'branch';\n}","tryCatchPattern":null,"preventionTips":["Default --scope to a native-supported mode for /codex:review.","Fall back to adversarial-review for exotic scopes."],"tags":["cli","validation","review","scope"],"backgroundTag":null,"analyzedSha":"db52e28f4d9ded852ab3942cea316258ae4ef346","analyzedAt":"2026-08-13T05:13:20.855Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}