Skip to content

Subagents and Auto review fail on Codex subscriptions because they skip the bot transport #446

Description

@linear-code

Problem

On a Codex (ChatGPT subscription) bot, normal turns worked but subagents and Auto review failed. Both built their own non-streaming model requests instead of using the bot's normal transport. Codex requires stream: true and rejects the reviewer's output-token cap. The Mastra Codex middleware also inserted generic CLI instructions in place of the bot's own.

Goal

Subagents (children) and Auto review reviewers build their model the same way as the bot's normal turns: same instance credentials, endpoint, model, and model options, streamed. Children keep the bot's instructions and their assigned task.

Deliberate behavior changes:

  • The reviewer inherits the bot's reasoning settings instead of a forced low setting.
  • Codex OAuth requests omit the unsupported output-token limit; API-key transports keep it.
  • Standard OpenCode cannot run Auto review. The review asks the human instead, with an explicit reason.

Acceptance criteria

  • Children and reviewers share normal-turn model construction, instance credentials, endpoint, and model options
  • Children keep the bot instructions and the assigned task; Akeru's Codex instructions replace the generic CLI ones
  • Codex and Claude request-capture tests cover subscription routing, the default model, and unavailable standard OpenCode review
  • Live check with a real Codex subscription: a bot runs a subagent and an Auto review, and both complete
  • Merged to main

How to verify

vp test run apps/server/src/provider

Then, on an isolated dev server with a Codex subscription, ask a bot to run a subagent and trigger Auto review, and confirm both stream and finish.

Context

  • Committed locally on the branch cos/child-model-routing as c21164ace fix(server): stream subagents and reviews on the bot transport, with internal and user docs and a patch changeset. Follow-up d2e47b4c8 makes the Claude child-transport test clear ANTHROPIC_BASE_URL and similar variables so it passes in shells that proxy Anthropic. The commit is also merged into cos/orchestration-proactive, cos/subagent-rows, and other cos/ branches. Not on main, no PR.
  • Verification (2026-10-06): provider and orchestration sweep 339 files and 2346 tests passed (2 files and 6 tests skipped); server tsgo typecheck and lint on changed files passed; fake-fetch transport and child-runner tests 14 passed. On the base commit, 4 of these failed; the Codex output-limit regression failed 2 before the fix and passed 4 after. An independent GPT-6.1 Sol review (Standard, medium) found no remaining issues.
  • Not checked: live subscription end to end. The coordinator owns integrated verification; the worker was not allowed to start servers.
  • Related: AKR-144 (how subagent runs show in the chat).

Created with GPT-6.1 Sol in T3 Code Codex harness. Restructured with Claude Opus 5.5 in Claude Code.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions