Skip to content

[Windows desktop] Runaway recursive subagents continue after final response and consume weekly quota #42032

Open

Description

@Crypox

Component

  • Codex desktop app for Windows
  • Version: 26.825.6671.0
  • Multi-agent workflow
  • Date: 2026-09-01 (Europe/Lisbon)

Summary

A completed review task left a recursive subagent tree running after the parent had returned its final answer. Descendants continued creating more descendants. Interrupting parent/coordinator agents did not cascade, so newly created agents replaced agents as they were stopped.

Observed scale

  • 61 subagents had been intentionally created before the failure.
  • The task eventually showed 469 created subagents in total.
  • Approximately 408 subagents were therefore created by the runaway recursion.
  • Concurrent activity repeatedly reached the physical limit of 101 agents.
  • The app had to be closed and terminated with Windows Task Manager to stop the activity.

Usage impact

  • More than 50% of the user's weekly quota was consumed by this incident on a 20x usage plan.
  • Approximately 20 percentage points were consumed while attempting to interrupt the runaway tree.
  • Usage continued after the assistant had already presented the final response.

Reproduction pattern

  1. A coordinator starts an independent review using multi-agent delegation.
  2. A reviewer delegates to children, which recursively delegate again.
  3. The coordinator returns a final answer without waiting for or cancelling the complete descendant tree.
  4. Descendants remain active and continue creating agents.
  5. Interrupting an ancestor does not cascade to all descendants.
  6. As individual agents finish or are interrupted, other descendants create replacements until the app process is terminated.

Expected behavior

  • A task must not return a completed final state while its descendant agents are still running without a clear warning and explicit user choice.
  • Cancelling/interruption of a coordinator should support recursive cancellation of the complete descendant tree.
  • A hard recursion/delegation budget should prevent hundreds of descendants from one review task.
  • There should be an emergency Stop all agents in this task control.
  • No further quota should be consumed by orphaned descendants after the parent task is complete or cancelled.

Requested investigation

Please investigate recursive multi-agent lifecycle management, parent/child cancellation propagation, concurrency replacement after interrupts, and usage accounting for orphaned agents. Task/account identifiers can be provided privately to OpenAI staff; they are intentionally omitted from this public issue.

Activity

  1. added
    bugSomething isn't working
    appIssues related to the Codex desktop app
    windows-osIssues related to Codex on Windows systems
    subagentIssues involving subagents or multi-agent features
    rate-limitsIssues related to rate limits, quotas, and token usage reporting
    on Sep 1, 2026
  2. michaelmanly commented on Sep 1, 2026

    @michaelmanly

    @Crypox
    that’s wild. when you killed the Codex app/process, did all the subagent activity and quota usage stop straight away?

    also were those 469 agents all spawned through Codex itself, or were any coming through MCP/tools outside the main Codex process?

  3. 84dnnvbdvp-debug commented on Sep 1, 2026

    @84dnnvbdvp-debug

    A current-source discriminator may help narrow the replacement-spawn behavior here (not proof that Windows build 26.825.6671.0 used this exact source).

    On current public main, multi-agent v2 exposes interrupt_agent, not the v1 close_agent control. codex-rs/core/src/tools/handlers/multi_agents_v2/interrupt_agent.rs resolves one target and calls AgentControl::interrupt_agent; that path sends Op::Interrupt only to that thread. By contrast, codex-rs/core/src/agent/control/legacy.rs::close_agent calls shutdown_agent_tree() to shut a target plus descendants.

    There is a second race worth testing even if recursive shutdown is reused: shutdown_agent_tree() first snapshots live_thread_spawn_descendants() and then shuts threads down. session/turn_suspension.rs explicitly describes its own descendant check as “a snapshot of currently loaded descendants, not a spawn-admission seal” and notes that concurrent future spawns remain best-effort. Since v2 explicitly allows children to spawn children, a one-time recursive enumeration can still lose to a descendant that spawns a replacement during teardown.

    A focused regression would be P -> C -> G, with G able to spawn G2 while cancellation is in flight. For task-finalization / emergency stop, first seal further spawn admission for the task/subtree, then cancel/drain descendants, and verify the subtree is quiescent before reporting completion (unless the user explicitly detached it). I would also keep a cumulative per-root delegation/spend budget separate from the concurrency-slot cap; a concurrency cap alone can be reused indefinitely as agents finish or are interrupted.

  4. Crypox commented on Sep 19, 2026

    @Crypox
    Author

    @michaelmanly Yes—force-terminating the Codex app in Windows Task Manager stopped both the subagent activity and further quota consumption immediately.

    All 469 agents were created through Codex’s native subagent system. No MCP server, external agent framework, or other tool was used to spawn them. I intentionally created 61; the remaining ~408 resulted from the runaway recursive delegation.

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

    appIssues related to the Codex desktop appbugSomething isn't workingrate-limitsIssues related to rate limits, quotas, and token usage reportingsubagentIssues involving subagents or multi-agent featureswindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions