Skip to content

codex runtime: delegate from collaboration V2 parents and bump Codex past 0.159.3 #9085

Closed

Description

@waynesun09

Problem

On Codex, review and retro delegate to native children only when the parent model resolves to collaboration V1 (ADR 0126). Any other parent runs with the multi-agent tools off and does the children's work in one context.

In the bundled catalog of the latest Codex, 0.166.0 (codex debug models --bundled), only two parents still resolve to V1:

Model multi_agent_version
gpt-5.6-luna v1
gpt-5.5 none (V1 by default)
gpt-6.1-sol, gpt-6.1-terra, gpt-6-sol, gpt-6-luna, gpt-6-astra, gpt-5.6-sol, gpt-5.6-terra v2

Every newer, cheaper model is on V2. Codex is planned to come out of experimental in the next release, and we can't keep it frozen on an older Codex or an older parent model. The pin today is 0.159.3. Supporting V2 is therefore a release blocker for leaving experimental.

Scope

  1. Spawn guard for V2. Extend the ADR 0126 admission policy to the V2 tools. codexSpawnGuardMatcher already matches ^collaboration…; today it denies every V2 call. At rust-v0.166.0 (codex-rs/core/src/tools/handlers/multi_agents_spec.rs), the V2 spawn_agent takes message, task_name (both required), agent_type, fork_turns, model and reasoning_effort. The same rules map across:
    • agent_type must be a registered role or absent, selecting the registered default role.
    • fork_turns must explicitly select no fork: a string equal to none after trimming and case-insensitive comparison. At 0.166.0, omission inherits all history and "0" is invalid; V1 uses fork_context: false instead.
    • Set expose_spawn_agent_model_overrides = false under [features.multi_agent_v2] to hide model and reasoning_effort from the spawn schema; continue refusing those keys in the hook so the runner keeps choosing the child model.
    • Set disable_direct_message = true under [features.multi_agent_v2] to remove send_message and followup_task, keeping hook denial as a backstop. The hook cannot distinguish running from finished children, and review/retro needs neither tool.
    • Allow list_agents, interrupt_agent and V2 wait_agent only from the root. Report these and collaborationspawn_agent as Agent to the ADR 0100 hooks, including Agent/Task matcher support; denied message/follow-up tools remain unmapped. V2 wait_agent accepts only timeout_ms, never a target.
  2. Bootstrap gate. Let a parent that resolves to V1 or V2 delegate (resolvesV1 in internal/runtime/codex_personas.go and the gate in codex_bootstrap.go); an absent catalog version means V1, while disabled, unknown, unlisted and gateway/ parents stay non-delegating. Render [agents] and the [features.multi_agent_v2] table to match ADR 0159. Its enabled = true override reaches every child regardless of model; V2 does not apply agents.max_depth, so depth one relies on the hook and its documented fail-open limits. Keep the four-child cap at [agents] max_concurrent_threads_per_session = 4, not the root-inclusive feature-table key.
  3. Child token accounting. Check that each child's rollout under V2 still carries a cumulative token_count, so run totals include children (codex runtime: native multi-agent tools are on, so child runs go unmetered and unseen #7828).
  4. Bump Codex to 0.166.0 independently in chore(#9085): bump codex to 0.166.0 and re-verify the re-check table #9088, with the usual bump checks: redact variants (codex_redact.go), progress parsing (codex_progress.go), regenerated testdata/codex captures, and the catalog tests in codex_personas_test.go. Keep this selected version despite its October 29 release being younger than two weeks; the V2 implementation targets its semantics.
  5. New ADR that supersedes ADR 0126's V1-only rule. Leave ADR 0126 unchanged.
  6. Docs. Update docs/runtimes/codex.md (Sub-agents and the "Not supported" row), docs/runtimes.md, and the Codex row of docs/guides/getting-started/choosing-a-runtime.md. Today they say only gpt-5.6-luna delegates.
  7. Live check. Run review and retro with a gpt-6.1-sol or gpt-6.1-terra parent and confirm that the children start, run their selected personas, and are counted in the token totals. Verify that every child result is processed by the security chain before entering the parent's context, including its block/withhold behavior.
  8. Child-result security. V2 wait_agent returns an acknowledgement, while child results arrive as injected messages outside the current PostToolUse path. Require every child result to pass the ADR 0100 chain (unicode, canary, suppression and redaction), with the same integrity and block/withhold semantics, before parent consumption. V2 delegation remains experimental until this delivery path is implemented and verified live; scanning the acknowledgement or stored transcripts is insufficient. Add the child result delivery path to every Codex bump's revalidation checklist.

Workaround until this lands

Only the parent has to be on V1. Child models come from subagents.<persona>, FULLSEND_CODEX_SUBAGENT_MODEL or subagents.default, so a gpt-5.6-luna parent can run its children on a newer model.

Related

Activity

  1. added
    type/feature
    on Nov 3, 2026
  2. fullsend-ai-triage commented on Nov 3, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 6:18 PM UTC · Completed 6:20 PM UTC

    Commit: 90b7310 · View workflow run →

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

  3. added
    feature
    triaged
    on Nov 3, 2026
  4. fullsend-ai-triage commented on Nov 3, 2026

    @fullsend-ai-triage

    Triage notes for this request:

    • Scope is clear and not a regression. The listed file targets exist in this repo, including the Codex version pin (CODEX_VERSION in images/sandbox/Containerfile), which will need a bump alongside the Go changes.
    • No in-flight implementation found. The open docs PR for codex runtime: run the review/retro sub-agent rosters through codex's native spawn_agent roles #6970 (fix(#6970): stop advising claude for review and retro on codex #9081) touches the same documentation files and codex_bootstrap.go, so expect merge conflicts or rebases; it does not add V2 support. codex: a spawn denied for a mistyped role name drops the sub-agent silently #9073 (recoverable spawn denials for unregistered roles) is closely related to the V2 agent_type check and is worth landing or coordinating with, but it is not treated as a blocker.
    • Open design point for implementers (not for the reporter): whether send_message/followup_task are denied outright or allowed only for open children. The new ADR should record the choice.
    • Manual step: scope item 7 (live review/retro run with a gpt-6.1-* parent) needs real Codex credentials and probably has to be done or verified by a maintainer.
    • Auto-promotion: this is categorized as a feature, which is outside the auto-promotion categories, so it will not be sent to the code agent automatically. A maintainer can mark it ready to code.

    Suggested test coverage:

    Spawn guard (V2): allow spawn_agent with registered agent_type and fork_turns absent/0;
      deny unregistered agent_type, fork_turns>0, any model/reasoning_effort;
      send_message/followup_task per chosen policy; allow list_agents/interrupt_agent/wait_agent.
    Catalog: gpt-6.1-sol/terra resolve to V2 and are admitted; gpt-5.6-luna and gpt-5.5 still V1;
      unknown models not admitted.
    Config: V2 parent renders [agents] and [features] multi_agent_v2.
    Transcripts: V2 child rollouts parse; run totals include child token_count.
    

    Next steps:

    • /fs-code — agent creates a PR to implement this issue
    • /fs-code <your instruction> — agent implements with your specific guidance
  5. moved this from Todo to In progress in fullsend-ai Workstreamon Nov 3, 2026
  6. fullsend-ai-triage commented on Nov 3, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 9:43 PM UTC · Completed 9:45 PM UTC

    Commit: 90b7310 · View workflow run →

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

  7. added
    pr-open
    and removed
    feature
    triaged
    on Nov 3, 2026
  8. fullsend-ai-triage commented on Nov 3, 2026

    @fullsend-ai-triage

    Open PRs already cover part of this issue's scope: the Codex 0.166.0 bump (scope item 4) and ADR 0159 for Codex sub-agents on collaboration V2 (scope item 5, and the design basis for the spawn guard, bootstrap gate and child-result security items). Both are ready for review, not drafts.

    These PRs don't cover the rest of the scope. That includes the V2 spawn guard, the bootstrap gate change, the child token accounting check, the docs updates, the live check, and the child-result security delivery path. The issue stays open for that work, and the remaining items should be sequenced after the ADR settles the design.

    A few notes for whoever picks up the rest:

    Addressed by:

  9. 14 remaining items

  10. added a commit that references this issue on Nov 15, 2026
  11. dhshah13 commented on Nov 16, 2026

    @dhshah13
    Contributor

    Item 7 ran against #9444 at 9c54377 and agents main 5fa2e3a3 (with fullsend-ai/agents#1971 and fullsend-ai/agents#2013): Codex 0.166.0 in the pinned images, OpenShell 0.0.116 on macOS arm64, a gpt-6.1-sol parent, children on the built-in gpt-5.6-luna, harness security on, no post-script.

    Live:

    Cell Children Results delivered Peak running Spawns admitted / denied Parent / children tokens
    review, a small throwaway PR 8: correctness, security, style-conventions, intent-coherence, cross-repo-contracts, docs-currency, risk-assessment, challenger 8, one each 3 8 / 0 1 request, 17,802 out / 8 requests, 9,202 out
    retro on fullsend-ai/agents#2013 4 unnamed tasks 4, one each 3 4 / 0 1 request, 3,618 out / 4 requests, 16,067 out
    • Every child ran at depth 1 under its task name, with no grandchild spawn. per_model_usage lists both models and sums to token_usage.
    • Both sandboxes registered SubagentStop with the post-tool chain, and each child's result reached the parent once as a FINAL_ANSWER message.
    • No child result was flagged in either run, so no block happened live. The review PR carried a case meant to provoke one, and no persona produced it.

    Block and withhold, run on the stock Codex 0.166.0 binary against a fake Responses server that records every request, with this PR's adapter and chain scripts:

    • A flagged child result, then the notice: the flagged text was in none of the parent's requests, and the parent got RESULT WITHHELD BY FULLSEND once.
    • A flagged result, then a different clean reply, then the notice: the clean retry was blocked too and never reached the parent.
    • A clean result: delivered once, unchanged.
    • A hook that cannot start: the result is delivered unscreened, the fail-open limit the docs list.

    Observation: the review parent dropped the challenger's kept findings after its own check of the repository. Every child result had reached it.

  12. added a commit that references this issue on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

pr-opentype/feature

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions