Skip to content

refactor(codex): resolve the parent's collaboration version and say why V2 stays off - #9290

Merged
dhshah13 merged 2 commits into
fullsend-ai:mainfrom
dhshah13:refactor/9085-codex-collab-version
Nov 10, 2026
Merged

dhshah13 merged 2 commits into
fullsend-ai:mainfrom
dhshah13:refactor/9085-codex-collab-version

Conversation

@dhshah13

@dhshah13 dhshah13 commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Resolve a Codex parent to its catalog collaboration version, V1 or V2, in the delegation gate, and say why a V2 parent still runs in one context (ADR 0159 decisions 1 and 4). The old explanation asked for "a parent Codex resolves to collaboration V1", which the accepted ADR no longer requires; a V2 parent is now declined with the decision-4 reason until its child-result delivery path is implemented and verified live, and disabled, unknown-version and unlisted parents each get their own line. No run changes whether it delegates: V2 parents were declined before and are declined now; only the stderr explanation of a declined parent changes.

Part of #9085.

Intentional: V2 parents are declined on this release (ADR 0159 decision 4, strict reading); the alternatives are listed on #9085.

Changes

  • internal/runtime/codex_personas.go: collabVersion and codexParentCollabVersion replace the V1-only resolver; explicit disabled case.
  • internal/runtime/codex_bootstrap.go: the gate admits only a V1 parent and prints the reason for any other; V2 declined with the ADR 0159 reason.
  • Tests: TestCodexParentCollabVersion (v1, absent, v2, disabled, unknown, unlisted, gateway, translate errors, no model; no explanation asks for a V1 parent); catalog and Bootstrap reason strings.
  • docs/runtimes/codex.md: the decline lines and the "Not supported" row.
  • docs/architecture.md: the decided V2 extension no longer says "alongside the 0.166.0 bump", which merged without it.
  • docs/contributing/runtime-implementation.md: the catalog row's test name; two bump re-check rows: the [features.multi_agent_v2] keys and how Codex derives the V2 child cap, and the V2 child-result delivery path (codex runtime: delegate from collaboration V2 parents and bump Codex past 0.159.3 #9085 item 8).

Testing

  • make lint passes (stage changes first, then run)
  • Tests added/updated for new or modified logic
  • pre-commit run --from-ref origin/main --to-ref HEAD and make lint-md-links pass.
  • go test ./internal/runtime/ -run 'Codex' -race -count=1 -timeout 15m and go vet ./... pass; goldens unchanged.
  • Patch coverage: collabVersion 100%, codexParentCollabVersion 100%, Bootstrap 88.7%.
  • Every upstream identifier in the two new re-check rows exists at rust-v0.166.0.
  • Docs build runs in CI (npm run docs:build needs the submodule and node_modules locally).

Checklist

  • PR title follows Conventional Commits (correct type, ! for breaking changes)
  • Commits are signed off (DCO) — human and human-directed agent sessions only
  • I wrote this contribution myself and can explain all changes in it

…hy V2 stays off

The gate now resolves a parent to collaboration V1 or V2 instead of asking
whether it is V1. A V2 parent is declined with the ADR 0159 reason until the
child-result delivery path is implemented and verified live; a disabled,
unknown-version or unlisted parent gets its own explanation, so no line
claims native sub-agents need a parent on V1. The bump re-check table gains
the feature-table cap derivation and the child-result delivery path.

Signed-off-by: Dharit Shah <dhshah@redhat.com>
@dhshah13
dhshah13 requested a review from a team as a code owner November 10, 2026 18:06
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Clarify Codex parent collaboration versions and V2 decline reasons

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Resolve Codex parents to their catalog collaboration version while keeping delegation eligibility
 unchanged.
• Explain V2 declines using the pending child-result safety requirement, not a V1-only rule.
• Cover decline reasons in tests and document the remaining V2 implementation checks.
Diagram

graph TD
  B["Codex Bootstrap"] --> E{"Agent and security?"} --> R["Catalog resolver"] --> V{"Parent version?"} --> A["V1 delegates"]
  V --> D["V2 declined"]
  V --> O["Other declined"]
  E --> O
Loading
High-Level Assessment

Keep the catalog-version resolver and explicit V2 decline. It reflects ADR 0159 without enabling delegation before the child-result delivery path can be checked. Retaining the V1-only predicate would preserve the misleading explanation; enabling V2 now would bypass the required safety check.

Files changed (7) +135 / -102

Bug fix (1) +16 / -12
codex_bootstrap.goGate delegation using the resolved parent version and reason +16/-12

Gate delegation using the resolved parent version and reason

• Bootstrap consumes the resolver's version and decline reason, continuing to delegate only when a version is returned without a reason. Its comments explain why V2 and other declined parents keep multi-agent tools off.

internal/runtime/codex_bootstrap.go

Refactor (1) +49 / -35
codex_personas.goReplace the V1-only predicate with a version resolver +49/-35

Replace the V1-only predicate with a version resolver

• Catalog entries now resolve to V1, V2, or no supported version. The parent resolver returns distinct reasons for V2, disabled, unknown-version, unlisted, gateway, and translation failures.

internal/runtime/codex_personas.go

Tests (2) +53 / -47
codex_bootstrap_test.goUpdate Bootstrap decline-reason expectations +15/-14

Update Bootstrap decline-reason expectations

• Updates catalog and gate assertions for the version resolver and verifies the new V2 and unlisted-parent stderr explanations.

internal/runtime/codex_bootstrap_test.go

codex_personas_test.goCover parent versions and distinct decline reasons +38/-33

Cover parent versions and distinct decline reasons

• Renames and expands the resolver tests to assert versions and reasons across supported, disabled, unknown, unlisted, gateway, and invalid-model cases. It also guards against explanations claiming that a V1 parent is required.

internal/runtime/codex_personas_test.go

Documentation (3) +17 / -8
architecture.mdRemove the outdated V2 rollout timing +1/-1

Remove the outdated V2 rollout timing

• The decided V2 policy extension is no longer described as shipping alongside the 0.166.0 bump, which merged without it.

docs/architecture.md

runtime-implementation.mdAdd V2 checks for future Codex bumps +3/-1

Add V2 checks for future Codex bumps

• Renames the catalog test reference and adds re-checks for V2 configuration keys, child-cap derivation, and the child-result delivery path.

docs/contributing/runtime-implementation.md

codex.mdExplain why V2 parents still run in one context +13/-6

Explain why V2 parents still run in one context

• Documents the V2 child-result safety reason and distinct explanations for unlisted, disabled, and unknown-version parents. The unsupported-features row now distinguishes ADR approval from implemented delegation.

docs/runtimes/codex.md

@qodo-code-review

qodo-code-review Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. V2 Codex parents cannot delegate yet ✗ Dismissed
Description
codexParentCollabVersion returns an empty version with a decline reason when the catalog entry
selects V2, so Bootstrap keeps the multi-agent tools off for that parent even though the rule
expects V1 and V2 parents to delegate. Any V2 parent such as gpt-5.6-sol or gpt-6.1-sol runs in
one context on this release, and the V2 delegation and live-verification items stay unmet until the
child-result delivery path is implemented; the PR description records this as intentional under ADR
0159 decision 4.

Grey Divider

Context sources
✅ Compliance rules (platform): 96 rules
✅ Skills: 5 invoked
  writing-user-docs
  writing-adrs
  check-patch-coverage
  cutting-releases
  adr-corner
✅ Cross-repo context — repo relationships
✅ REVIEW.md
Review mode: Auto: ⚖️ Balanced: Modifies the sub-agent delegation admission gate; intent is no behavior change, needs verification.

Grey Divider

Tip of the day
💡 Did you know, you can move or hide resolved findings to focus on what still needs action

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread internal/runtime/codex_personas.go Resolved
@fullsend-ai-review

fullsend-ai-review Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 6:09 PM UTC · Completed 6:21 PM UTC

Commit: 851bbeb · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $2.55

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Site preview

Preview: https://524a1d97-site.fullsend-ai.workers.dev

Commit: b84b5208e73cf7e9b96fc0b96eda209b5bd0fccb

@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Nov 10, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Moderate-sized refactor (7 files, 239 lines) by an established contributor with no protected or security-sensitive paths touched, keeping V2 delegation declined while clarifying gate diagnostics and updating documentation.

Previous run

Risk Assessment: moderate (2/5)

Details

Moderate-sized refactor (7 files, 237 lines) by an established contributor with no protected or security-sensitive paths touched, keeping V2 delegation declined while clarifying gate diagnostics and updating documentation.

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Looks good to me


Labels: PR updates Codex runtime docs alongside the runtime change.

Previous run

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJhcHByb3ZlIiwiZmluZGluZ3MiOltdfQ== -->

Review

Findings

Low

  • [pattern-inconsistency] internal/runtime/codex_bootstrap.go:195 — The if delegating = version != "" && reason == ""; !delegating { header assigns a compound boolean inside the condition. The version != "" operand is redundant today, because codexParentCollabVersion returns an empty reason only on the "v1" path. Readability nit only; behavior is correct.
    Remediation: Optional. Assign the flag on its own line, e.g. delegating = reason == "", and branch on it.

Labels: PR refactors the Codex runtime delegation gate and updates the related runtime docs.

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot added ready-for-merge All reviewers approved — ready to merge component/runner Agent runner behavior and lifecycle go Pull requests that update go code labels Nov 10, 2026

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review-only pass: one MEDIUM finding, posted inline.

Comment thread internal/runtime/codex_bootstrap.go Resolved
@codecov

codecov Bot commented Nov 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Bootstrap delegated whenever the resolver returned a version and no
reason, so a V2 branch that stopped returning a reason would have
admitted V2 parents with the V1-only config. The gate now reads the
version: only "v1" delegates, and only the change that renders the V2
config and the checked child-result delivery path widens it to V2. The
resolver's doc and its test say the reason explains a decline and
never decides one.

Signed-off-by: Dharit Shah <dhshah@redhat.com>
@fullsend-ai-review

fullsend-ai-review Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 7:07 PM UTC · Completed 7:15 PM UTC

Commit: b84b520 · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.86

@fullsend-ai-review fullsend-ai-review Bot removed the ready-for-merge All reviewers approved — ready to merge label Nov 10, 2026
@fullsend-ai-review
fullsend-ai-review Bot dismissed their stale review November 10, 2026 19:15

Superseded by updated review

@fullsend-ai-review fullsend-ai-review Bot added ready-for-merge All reviewers approved — ready to merge component/docs User-facing documentation labels Nov 10, 2026

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The delegation gate now admits only version == "v1" and prints the reason whenever delegation is off (b84b520).

@dhshah13
dhshah13 added this pull request to the merge queue Nov 10, 2026
Merged via the queue into fullsend-ai:main with commit 87e94fb Nov 10, 2026
83 of 85 checks passed
@dhshah13
dhshah13 deleted the refactor/9085-codex-collab-version branch November 10, 2026 20:31

This branch was successfully deployed

1 active deployment
site-preview — b84b5208 Deployed Nov 10, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/docs User-facing documentation component/runner Agent runner behavior and lifecycle go Pull requests that update go code ready-for-merge All reviewers approved — ready to merge risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants