-
If collaboration tools are deferred, use the runtime's tool-discovery mechanism to resolve and inspect their definitions. Tool discovery is allowed here; a probe spawn is not. Do not infer the contract from feature flags, model name, tool namespace, profile name, or a prior session.
-
Admit exactly one coherent family and record the selected adapter for the entire run:
- The V1 adapter requires
spawn_agent(agent_type,message) with both arguments required and an agent_id in the successful result, targeted wait_agent(targets), and close_agent(agent_id). Its spawn_agent must not accept task_name or fork_turns.
- The V2 adapter requires
spawn_agent(task_name,message,agent_type?,fork_turns?,model?,reasoning_effort?) with task_name and message required, untargeted wait_agent(timeout_ms?), list_agents(path_prefix?), and interrupt_agent(target). Its wait_agent must not accept targets; close_agent must not be part of this family. send_message(target,message) and followup_task(target,message) may also be present and do not make the schema mixed, but the orchestrator must not use them for review-result transport or synchronization, and specialists must not use them under the control-plane ban. Although agent_type, fork_turns, model, and reasoning_effort are optional in the tool schema, every pr-review specialist spawn must set the exact agent_type and explicitly set fork_turns to "none"; omit model and reasoning_effort to inherit the parent.
-
Optional unrelated, non-discriminating fields may be present in either family and do not by themselves make it mixed. Admission is determined by the required and forbidden control fields above; any added field that conflicts with those discriminators, or changes result identity or wait/cleanup semantics, is unknown and incompatible.
-
Missing, unresolved, incomplete, mixed, or unknown definitions are not compatible. Do not combine tools from different families or use a generic/default agent fallback.
-
If no coherent adapter can be selected, abort before repository inspection with this exact message:
ERROR: $pr-review requires one coherent Codex multi-agent V1 or V2 schema, but this session exposes missing, mixed, incomplete, or unknown collaboration tools.
No specialist was spawned and no review was performed. Tool exposure is fixed for the lifetime of this session.
Start a new Codex process from the repository under review:
codex exec --profile review -C '<repo-root>' '$pr-review --base <same-base>'
If the review-profile command still does not expose one exact supported schema, stop and report compatibility drift. Do not fall back to default agents.
-
For both adapters, before repository inspection read references/base-resolution-runtime-contract.json, require sentinel PR_REVIEW_BASE_RESOLUTION_CONTRACT_V2, and use its operation allowlist, classification precedence, retry limit, invocation-fingerprint, immutable-OID values, and allow_no_pr transition sequence as the machine-readable base-resolution contract. Record whether the shell tool exposes sandbox_permissions=require_escalated; absence does not invalidate the immutable-OID path, but any later sandbox-denied operation that needs escalation must fail closed before specialist spawn. Abort before repository inspection if the contract is missing, malformed, unsupported, or conflicts with this prose.
-
For V2 only, call list_agents immediately after selection and require a fresh agent tree: the current orchestrator entry may exist, but it must have no descendant. Abort before repository inspection if listing fails, a descendant already exists, or the current tree cannot be identified unambiguously. This prevents this run from adopting, interrupting, or confusing another run's tasks.
-
For V2 only, before repository inspection read references/v2-runtime-contract.json, require sentinel PR_REVIEW_V2_SCHEDULER_CONTRACT_V3, and use its timing, spawn, result, reconciliation, cleanup, and aggregation values as the machine-readable scheduler contract. Abort before repository inspection if the file is missing, malformed, unsupported, or conflicts with this prose.