Skip to content

codex runtime: run the review/retro sub-agent rosters through codex's native spawn_agent roles #6970

Closed

Description

@waynesun09

Goal

Run the fleet review and retro sub-agent rosters on the codex runtime (#6920) using codex's native multi-agent tools (spawn_agent / wait / close_agent, multi-agent v1 — Stable and on by default at 0.152.1), so the docs' "keep review and retro on Claude Code" recommendation can be dropped. This is the codex counterpart of #6756 (pi Agent tool).

Verified by probe (2026-09-03, sandbox image, codex-cli 0.152.1)

  • Roles declared as [agents.<name>] description, config_file with a config_file layer setting developer_instructions act as personas; children spawned with agent_type=<name> followed them and returned their final reply through wait.
  • fullsend's PreToolUse hooks fire inside children with agent_id and agent_type in the payload — no extra wiring.
  • One rollout file per thread (root + each child); the child rollout names its role.
  • The parent's turn.completed.usage excludes children; child tokens are in each child rollout's token_count events.
  • spawn_agent with model="opus" fails safely: Unknown model \opus` … Available models: gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-5.5, gpt-5.2` (no silent remap; Claude aliases stay Claude-only).
  • Codex syncs a bundled plugin marketplace at startup (the denied chatgpt.com/api.github.com probes in the sandbox) — turn it off in the rendered config.

Design (→ ADR 0101)

  • Bootstrap generates agents/<persona>.toml roles from the uploaded skills' sub-agents/*.md (frontmatter description + body as developer_instructions), plus a built-in explore role for subagent_type: Explore (instruction-only — no read-only sandbox exists per child on codex).
  • Children run the parent's OpenAI model; optional FULLSEND_CODEX_SUBAGENT_MODEL → agents.default_subagent_model; agents.max_concurrent_threads_per_session = 4; depth 1.
  • A bridge paragraph appended to the orchestrator's developer_instructions maps the Claude Agent contract to spawn_agent(agent_type, message) + wait.
  • The roles directory joins the runner-held digest set (exhaustive entries, filename-bound digests) — it is agent-writable.
  • ExtractTranscripts collects and redacts every rollout (children as <agent>-sub<seq>-<role>.jsonl); child usage folds into RunMetrics.PerModelUsage (type from feat(pi): Agent tool for sub-agents on the pi runtime #6756).

PRs

  • F0 (only if feat(pi): Agent tool for sub-agents on the pi runtime #6756 has not merged): extract PerModelUsage/ModelUsage into a small main PR
  • F1 fullsend codex-subagents: roles + [agents] config + bridge + digests + transcripts/usage + plugin sync off + ADR 0101 + docs internals
  • F2 fullsend-ai/agents: runtime-neutral dispatch wording in skills/pr-review/SKILL.md (helps pi too)
  • F3 fullsend docs flip after a fleet-shaped review and retro run on codex (macOS, then Fedora)

Plan with sources: research/fullsend-codex-subagents-plan.md in ai-workspace-public.

Related: #6920 (codex runtime), #6756 (pi Agent tool), #6527 (runtime parity backlog), ADR 0099 / 0100.

Activity

  1. added
    type/feature
    component/runner
    component/docs
    on Sep 3, 2026
  2. fullsend-ai-triage commented on Sep 3, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 3:42 PM UTC · Completed 3:47 PM UTC

    Commit: 48eac1a · View workflow run →

    Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $0.88

  3. added
    feature
    triaged
    component/harness
    on Sep 3, 2026
  4. fullsend-ai-triage commented on Sep 3, 2026

    @fullsend-ai-triage

    Re-checked at a maintainer's request (2026-09-24) to confirm this issue is still relevant given how much has changed in fullsend and fullsend-ai/agents since it was filed.

    Still relevant and unimplemented. The shipped docs (docs/runtimes/codex.md, docs/guides/getting-started/choosing-a-runtime.md) still say codex has no sub-agent roster and recommend keeping review/retro on Claude Code there. The codex runtime source (internal/runtime/codex_bootstrap.go, codex_config.go) confirms this gap is still open — it only emits a placeholder note that no sub-agent roster is wired. No docs/ADRs/0101-* exists yet, and no open or merged PR in either repo references this issue, spawn_agent, or codex-subagents, so F1 has not landed.

    Both previously identified blockers have since cleared:

    This means the issue is no longer blocked on other work — a developer could start on F1 today using the design already recorded in the issue and its comments (role shape, model defaults, dispatch policy, integrity guards).

    Per the reviewer's instruction, this is being left as triaged-but-unpromoted for human prioritization rather than auto-dispatched; it also falls outside the categories eligible for automatic ready-to-code promotion. All previously documented design decisions and proposed test cases are carried forward and expanded above.


    Next steps:

    • /fs-code — agent creates a PR to implement this issue
    • /fs-code <your instruction> — agent implements with your specific guidance
    Previous run

    Triage notes

    Conditional dependency on #6756: Since #6756 (pi Agent tool) is still open, the F0 PR to extract PerModelUsage/ModelUsage into a standalone PR will be needed before F1. The author already accounts for this in the PR plan.

    Codex runtime foundation is in place: The internal/runtime/codex*.go implementation (bootstrap, run, config, hooks, transcripts, integrity) already exists from #6920's PR stack, so F1 can build on top of it.

    Proposed test cases:

    // Unit: bootstrap generates persona roles from skill frontmatter
    // Given a skill with sub-agents/*.md containing description + developer_instructions
    // When bootstrap renders the codex config
    // Then agents/<persona>.toml exists with matching description and developer_instructions
    // And the built-in 'explore' role is also generated
    
    // Unit: [agents] config section
    // When codex config is rendered with sub-agent support
    // Then [agents] includes max_concurrent_threads_per_session = 4
    // And default depth is 1
    // And plugin marketplace sync is disabled
    
    // Unit: transcript extraction collects child rollouts
    // Given a parent rollout and two child rollouts
    // When ExtractTranscripts runs
    // Then child rollouts are named <agent>-sub<seq>-<role>.jsonl
    // And child token_count events fold into RunMetrics.PerModelUsage
    
    // Negative: spawn_agent with unsupported model alias
    // When spawn_agent is called with model="opus"
    // Then the call fails with "Unknown model" error
    // And no silent model remap occurs
    

    Labels: Adding component/harness since bootstrap config generation and digest tracking are harness responsibilities; existing type/feature, component/runner, and component/docs labels are correct.


    Next steps:

    • /fs-code — agent creates a PR to implement this issue
    • /fs-code <your instruction> — agent implements with your specific guidance
  5. waynesun09 commented on Sep 3, 2026

    @waynesun09
    MemberAuthor

    Plan update (2026-09-03), two inputs folded in:

    • Reuse the local port's role shape. ai-agent-base/codex-agents/*.toml already runs the shared sub-agents on host codex as single-file roles (name, description, developer_instructions), linked into $CODEX_HOME/agents/. The runner will generate the fleet roster (skills/*/sub-agents/*.md) into that shape at Bootstrap, applying the lessons from that port: model: is dropped entirely (a role model is copied verbatim into the child, so a Claude alias fails at spawn and model = "inherit" fails at the child's first request with 404 The model inherit does not exist; omitting it is the only way to inherit), tools/permissionMode/background/maxTurns are dropped with a log line rather than turned into prompt text, no sandbox_mode, no migration boilerplate in the child's system prompt. Roles are written as regular files: codex's role discovery skips symlinks (verified on 0.152.1). Codex's own Claude→codex migrator is TUI-only (the CLI exposes only migrate-rollouts), so the mapping stays a small runner function.
    • Depends on fix(#6920): withhold unsafe codex tool results #6952. Hooks fire inside child threads, so children inherit whatever the adapter does with a security rewrite; fix(#6920): withhold unsafe codex tool results #6952 changes that from warn-only to withhold. F1 bases on main after it merges.
    • Integrity. Role loading walks the config layers and merges same-named roles across layers, so the plan pins all three: /etc/codex is root-owned, $CODEX_HOME/agents/ joins the runner-held digest set, and the repo's .codex/agents/ never loads because the config carries no [projects] trust entry (the guard already refuses a rewritten config); F1 adds a test for a planted repo role.
    • Pre-F1 check, no Go code: convert the pr-review roster with the same mapping into ~/.codex/agents/ on a laptop (copies, not symlinks) and drive host codex exec with agents/review.md plus the bridge paragraph against a real PR.
  6. waynesun09 commented on Sep 3, 2026

    @waynesun09
    MemberAuthor

    Decision (2026-09-03): children run a cheaper model by default. The runner sets agents.default_subagent_model to gpt-5.6-luna (the cheap tier of the latest GPT-5.6 family, already used for the codex runtime's fleet-shaped runs); FULLSEND_CODEX_SUBAGENT_MODEL overrides it, OpenAI ids only. Roles carry no model, so the default applies to every child.

    Dispatch stays need-based. The pr-review skill already selects sub-agents by triage (correctness + style-conventions always, the rest conditional, typically 3–6, challenger sequential, re-reviews narrowed). On codex every generated role is available to spawn_agent, which is not a reason to spawn it: the bridge paragraph says "spawn only the sub-agents step 3c selected", and the verification run asserts the spawn count against the triage classification, not the roster size. Known trade-off: correctness loses its strong-tier assignment on codex; the first fleet-shaped run checks its finding quality.

  7. ralphbean commented on Sep 24, 2026

    @ralphbean
    Member

    /fs-triage lots of things have changed between when this was originally filed and now across both the https://github.com/fullsend-ai/fullsend and https://github.com/fullsend-ai/agents repos. Is this still relevant? This is a stale-issue review, not an implementation request: even if the issue is still a valid bug and has sufficient information, do not recommend or trigger ready-to-code yet. Leave it for human prioritization after confirming whether it remains relevant. Do not close a still-relevant bug merely to avoid coding it.

  8. fullsend-ai-triage commented on Sep 24, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 8:59 PM UTC · Completed 9:03 PM UTC

    Commit: d565f76 · View workflow run →

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

  9. removed
    feature
    on Sep 24, 2026
  10. 37 remaining items

  11. dhshah13 commented on Nov 3, 2026

    @dhshah13
    Contributor

    Fleet-shaped run on main, macOS: two review runs on the same PR and one retro, all with --runtime codex, parent openai/gpt-5.6-luna at effort medium, children on gpt-5.6-luna, harness security on.

    • fullsend c7652ad, fullsend-ai/agents@201f513e6, Codex CLI 0.159.3 in both sandbox images (fullsend-code for review, fullsend-sandbox for retro).
    • All ran locally with --no-post-script, not through the fleet workflows, so there are no run links. OpenShell 0.0.116 locally (CI pins 0.1.4). Fedora was not run.
    • The production review and retro harnesses, with the Vertex provider and its credential files removed, under a config.yaml listing only those two. github-public-ro (review) and github-artifacts (retro) carry no credential, which OpenShell 0.0.116 refuses, so each got an empty dummy credential.
    review, run 1 review, run 2 retro
    Target one-file Go fix on a private throwaway repo the same PR fullsend-ai/agents#1856
    Outcome exit 0, request-changes, 2 findings exit 0, request-changes, 1 finding exit 0, no proposals
    Native Codex children, one rollout each, in spawn order correctness, style-conventions, docs-currency, risk-assessment, challenger correctness, style-conventions, intent-coherence, docs-currency, cross-repo-contracts, risk-assessment, challenger, explore four default
    Most open at once, open at the end 4, 0 4, 0 4, 0
    Spawns admitted, denied 5, 1 8, 0 4, 0
    per_model_usage gpt-5.6-luna, requests 6, output_tokens 12,752 (parent 6,914 + children 5,838) gpt-5.6-luna, requests 9, output_tokens 15,124 (parent 8,712 + children 6,412) gpt-5.6-luna, requests 5, output_tokens 19,743 (parent 2,885 + children 16,858)
    Run wall time 315 s 355 s 296 s

    No spawn of a registered role was denied. The one denial, in review run 1: the parent selected intent-coherence but passed agent_type: "intent", which is not registered, so the spawn guard denied it. The parent then neither ran that persona itself, which the runtime note directs after a denied spawn, nor recorded a sub-agent-failure finding, so that review result lacks intent-coherence coverage without saying so. Run 2 spawned intent-coherence under its registered name.

    Every parent's first fullsend-check-output call exited 127: the agent definitions call it by name, and on Codex /sandbox/workspace/bin is not on the agent's PATH, as Adding executables documents. Each then ran it by its full path and validation passed.

  12. dhshah13 commented on Nov 3, 2026

    @dhshah13
    Contributor

    Fedora leg of the run above, on the same commits: one review on the same PR and one retro on fullsend-ai/agents#1856, with --runtime codex, parent openai/gpt-5.6-luna at effort medium, children on gpt-5.6-luna, harness security on.

    • Host: Fedora Linux 42 (CoreOS, aarch64), the podman machine VM on the same Mac, with OpenShell 0.1.4, the version CI pins, as a user-level gateway on the podman driver. Codex CLI 0.159.3 in both sandbox images.
    • The production review and retro harnesses, with the Vertex provider and its credential files removed, under a config.yaml listing only those two. No dummy credentials: 0.1.4 accepts providers that carry none.
    • Both ran locally with --no-post-script, not through the fleet workflows, so there are no run links.
    review retro
    Outcome exit 0, request-changes, 1 finding exit 0, no proposals
    Native Codex children, one rollout each, in spawn order correctness, style-conventions, intent-coherence, risk-assessment, challenger, then default for the label-conventions lookup five explore
    Most open at once, open at the end 4, 0 4, 0
    Spawns admitted, denied 6, 0 5, 0
    per_model_usage gpt-5.6-luna, requests 7, output_tokens 13,885 (parent 7,391 + children 6,494) gpt-5.6-luna, requests 6, output_tokens 22,882 (parent 3,491 + children 19,391)
    Run wall time 308 s 425 s

    No spawn was denied. Review read skills/pr-review/SKILL.md only to line 800 of 1,457 and missed the Codex dispatch rules after it: every wait_agent used timeout_ms 3600000, where they set at most 120000. It also left out docs-currency as "not staged", though it was. Retro passed agent_type: "explore" for its investigation tasks, where retro.md says to pass no agent_type; explore is registered, so the guard admitted them.

    Both parents' first fullsend-check-output call exited 127 again. Review reran it by its full path, retro checked the JSON itself instead, and the runner's schema validation passed for both. The macOS review run that dropped intent-coherence is tracked in #9073.

  13. added a commit that references this issue on Nov 3, 2026
  14. added a commit that references this issue on Nov 13, 2026
  15. added a commit that references this issue on Nov 15, 2026
  16. added 2 commits that reference this issue on Nov 17, 2026
  17. added 2 commits that reference this issue on Nov 20, 2026
  18. added a commit that references this issue on Nov 23, 2026
  19. 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

component/docscomponent/harnesscomponent/runnerfeaturetriagedtype/feature

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions