Skip to content

Codex subagents fail with network connection error (stdio transport) #90424

Closed

Description

@ruben2000de

Description

When using openai/gpt-5.5 with the bundled Codex plugin in stdio transport mode, the main session works but subagents consistently fail with:

FailoverError: LLM request failed: network connection error.

Environment

  • OpenClaw version: 2026.6.1
  • Runtime: agentRuntime.id: "openclaw"
  • Codex standalone: 0.137.0 (installed separately)
  • Codex daemon: running (ephemeral mode)
  • Codex doctor: 18/18 OK, ChatGPT backend reachable (HTTP 101)
  • Auth: ChatGPT OAuth, tokens valid
  • Docker: Yes (Debian 12, Unraid host)

Reproduction

  1. Configure Codex plugin with stdio transport and bundled binary
  2. Spawn a subagent: sessions_spawn(model="openai/gpt-5.5", task="hello")
  3. Subagent fails with network connection error

What works

  • ✅ Main session on openai/gpt-5.5 with agentRuntime.id="openclaw" — works initially
  • ✅ Codex daemon running, codex doctor all green
  • ✅ OpenAI API reachable from container
  • ✅ Auth tokens valid and fresh

What does not work

  • ❌ Subagents on openai/gpt-5.5 — always network connection error
  • ❌ Codex app-server in stdio mode — exits immediately when spawned by OpenClaw
  • ❌ WebSocket transport to daemon socket — connection fails

Hypothesis

The subagent code path uses a different transport/resolution mechanism than the main session. When agentRuntime.id="openclaw" is set, OpenClaw uses its built-in HTTP transport, but subagents may not inherit the same auth context or may have a different network resolution path.

Impact

GPT-5.5 via ChatGPT subscription OAuth is unusable for subagents and cron jobs, limiting it to main session use only.


Reported by Otti (OpenClaw assistant) on behalf of Ruben.

Activity

  1. clawsweeper commented on Jun 4, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 4, 2026, 1:23 PM ET / 17:23 UTC.

    Summary
    Keep open: the report is fresh, matches documented OpenAI/Codex subagent and auth-routing surfaces, and current main has no behavioral fix beyond v2026.6.1 in the relevant paths.

    Reproducibility: yes. source-backed but not live reproduced: the issue supplies concrete steps and current source shows the subagent model/session/harness/auth path, but the failure requires a live ChatGPT/Codex OAuth environment not exercised here.

    Next step
    The repair crosses subagent session setup, OpenAI/Codex runtime selection, OAuth profile forwarding, and app-server transport startup, so it needs maintainer debugging with live Codex proof before a safe fix PR.

    Review details

    Best possible solution:

    Reproduce the explicit sessions_spawn path with openai/gpt-5.5, confirm whether the child keeps the intended runtime and auth profile, then fix the narrow session/auth/transport propagation break with regression coverage and live Codex proof.

    Do we have a high-confidence way to reproduce the issue?

    Yes, source-backed but not live reproduced: the issue supplies concrete steps and current source shows the subagent model/session/harness/auth path, but the failure requires a live ChatGPT/Codex OAuth environment not exercised here.

    Is this the best way to solve the issue?

    No patch is proposed; the best likely fix is to preserve one canonical runtime/auth decision for child sessions rather than add a new config knob or broad fallback.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    Codex review notes: model gpt-5.5, reasoning high; reviewed against 1794efbba18d.

    Label changes

    Label changes:

    • add P1: The reported failure breaks subagent and cron-style agent workflows for an affected OpenAI/Codex OAuth setup while the main session still works.
    • add impact:session-state: The issue centers on child subagent sessions failing to inherit or resolve the same effective runtime path as the main session.
    • add impact:auth-provider: The suspected failure surface includes OpenAI/Codex OAuth profile selection and Codex app-server auth propagation.
    • add issue-rating: 🐚 platinum hermit: Current issue advisory state selects this label.
    • add clawsweeper:needs-live-repro: Current issue advisory state selects this label.
    • add clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.
    • add clawsweeper:needs-maintainer-review: Current issue advisory state selects this label.

    Label justifications:

    • P1: The reported failure breaks subagent and cron-style agent workflows for an affected OpenAI/Codex OAuth setup while the main session still works.
    • impact:session-state: The issue centers on child subagent sessions failing to inherit or resolve the same effective runtime path as the main session.
    • impact:auth-provider: The suspected failure surface includes OpenAI/Codex OAuth profile selection and Codex app-server auth propagation.
    Evidence reviewed

    Acceptance criteria:

    • Reproduce on current main with a ChatGPT/Codex OAuth profile and sessions_spawn(model="openai/gpt-5.5", task="hello").
    • Capture /status, /codex status, child session entry runtime/model/auth fields, app-server stderr tail, and Gateway logs with secrets redacted.
    • After any fix, run the focused subagent model/runtime tests plus a live Codex stdio subagent smoke.

    What I checked:

    • Issue report: this issue reports that the main openai/gpt-5.5 session works but sessions_spawn(model="openai/gpt-5.5", task="hello") fails with FailoverError: LLM request failed: network connection error, with Codex doctor green and valid ChatGPT OAuth.
    • Repository policy applied: Root policy requires full AGENTS.md reading and direct sibling ../codex source inspection before any Codex verdict; scoped agent and extension AGENTS files were also read. (AGENTS.md:11, 1794efbba18d)
    • Vision fit: VISION.md lists bug fixes/stability and better agent harness capabilities as project priorities, so this subagent/Codex runtime failure is in-scope core maintenance rather than ClawHub-only work. (VISION.md:16, 1794efbba18d)
    • Documented expected OpenAI route: OpenAI docs say openai/* embedded agent turns run through the native Codex app-server runtime by default, while explicit agentRuntime.id: "openclaw" remains a compatibility route for selected OAuth/API-key handling. Public docs: docs/providers/openai.md. (docs/providers/openai.md:14, 1794efbba18d)
    • Documented auth order: Docs state native Codex app-server auth should use ordered OpenAI auth profiles first, then the app-server account, then stdio-only env key fallback, which directly overlaps the reported OAuth/stdio failure mode. Public docs: docs/plugins/codex-harness.md. (docs/plugins/codex-harness.md:448, 1794efbba18d)
    • Subagent model propagation path: Subagent spawn planning resolves the requested model and includes it in the initial child-session patch with modelOverrideSource, so an explicit openai/gpt-5.5 spawn is expected to carry a runtime-relevant model into the child session. (src/agents/subagent-spawn-plan.ts:49, 1794efbba18d)

    Likely related people:

    • Peter Steinberger: Authored major Codex app-server harness, controls, harness-selection, lifecycle, and subagent planning work across the central files; shortlog shows the most commits in this sampled area. (role: recent area contributor; confidence: high; commits: dd26e8c44d4e, 31a0b7bd42a5, 47c0ce5f8531; files: extensions/codex/harness.ts, extensions/codex/src/app-server/run-attempt.ts, src/agents/harness/selection.ts)
    • Vincent Koc: Recent commits routed Codex runtimes through canonical OAuth and reused bound auth profiles for app-server startup, directly adjacent to the reported auth/transport failure. (role: recent area contributor; confidence: medium; commits: f1cc8f0cfc7c, 859eb06662; files: extensions/codex/src/app-server/run-attempt.ts, src/agents/harness/policy.ts, src/agents/model-runtime-policy.ts)
    • Tyler Yust: Worked on subagent lifecycle and nested retry/drop behavior, which is adjacent to failed child runs even though the Codex auth/transport root cause is not established. (role: adjacent owner; confidence: medium; commits: fe57bea088c7; files: src/agents/subagent-spawn.ts)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. added
    P1High-priority user-facing bug, regression, or broken workflow.
    impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.
    impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    on Jun 4, 2026
  3. self-assigned this
    on Jun 8, 2026
  4. joshavant commented on Jun 9, 2026

    @joshavant
    Collaborator

    Thanks for the detailed report and repro notes.

    I was able to reproduce the failure class live with ChatGPT/Codex OAuth on AWS Crabbox against v2026.6.1: openai/gpt-5.5 through the OpenClaw runtime failed with FailoverError: LLM request failed: network connection error. That matched the error surface from this issue.

    After comparing against current main, the same live Gateway + OAuth + agentRuntime.id: "openclaw" setup passed a main turn plus sessions_spawn / sessions_yield. I then cherry-picked only the existing fix commit onto v2026.6.1, and the same scenario passed there too. That isolates the root cause to ab0a633.

    What happened: the ChatGPT/Codex backend can return valid streamed SSE/JSON responses without a content-type header. In v2026.6.1, OpenClaw rejected that response before the OpenAI SDK could consume it, and the error surfaced as the generic network connection failure. Current main now sniffs and normalizes those valid missing-header streamed responses while still rejecting invalid HTML/non-API responses.

    Live proof:

    • v2026.6.1: reproduced on AWS Crabbox, run run_4aa6b5d46047
    • current main: passed on AWS Crabbox, run run_23c5b3b81e51
    • v2026.6.1 + fix commit ab0a633ab98b4676370eec31eee57d2fbe163647: passed on AWS Crabbox, run run_4fec2376a0af

    One note: the WebSocket daemon path mentioned in the report is separate; upstream Codex currently documents WebSocket as experimental/unsupported. The supported stdio/OpenClaw runtime path is the part validated here, and that path is fixed on main.

    Closing as fixed on main.

  5. locked as resolved and limited conversation to collaborators on Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions