Skip to content

Proposal: parallel-first subagents and nonblocking background task management #22099

@LEON-gittech

Description

@LEON-gittech

Summary

This issue collects several related discussions around subagent delegation, background terminal/subagent lifecycle management, and task visibility in the TUI.

We have implemented a working fork, Open Codex CLI, that explores one possible direction:

  • more proactive parallel-first subagent planning
  • nonblocking background execution for terminals and subagents
  • a persistent Down task panel for inspecting and managing background work
  • task-list visibility in the same panel, so plan/task progress is not only visible as a compact status-line counter

Fork: https://github.com/LEON-gittech/codex

The implementation is fork-specific today, but the interaction model may be useful as prior art for upstream Codex.

Related upstream discussions

Subagent planning / delegation

These point to a common theme: Codex needs a clearer policy for when to split work into subagents, how aggressive that split should be, and how repo/user instructions should shape the delegation strategy.

Background terminals / nonblocking execution

These discussions all touch the same interaction problem: long-running terminal or subagent work should remain visible and manageable, but it should not block the main conversation loop.

Design direction explored in Open Codex CLI

1. Parallel-first subagent planning policy

Open Codex currently implements this mostly through the instruction layer rather than a hardcoded scheduler.

The policy asks the main agent to classify non-trivial work by independent axes before editing:

  • investigation
  • review
  • test discovery
  • docs/reference comparison
  • validation
  • implementation

When independent axes exist, the agent is encouraged to spawn read-only subagents first, while keeping final code changes in one implementation lane unless write ownership is clearly disjoint.

This is intentionally more proactive than the default conservative behavior, but still bounded:

  • do not duplicate work between main thread and subagents
  • do not spawn if the next critical-path step is blocked on the result
  • prefer read-only lanes for evidence gathering
  • keep implementation centralized unless ownership is cleanly separable
  • report what each lane found before finalizing

2. Nonblocking background execution

Open Codex treats long-running terminals and subagents as background work by default.

The goal is to avoid this pattern:

Waiting for background terminal...
Waiting for subagent...

Instead, background work continues independently while the user can keep typing and submitting new messages.

The foreground model turn still shows normal Working state when the model is active, but background terminals/subagents are tracked separately and summarized in the status line.

3. Persistent Down task panel

Open Codex adds a persistent bottom-pane panel opened with Down.

The panel separates:

  • Tasks
  • Subagents
  • Terminals

It updates in place rather than inserting a chat-stream summary.

For terminals, the detail view shows:

  • status
  • elapsed runtime
  • wrapped command/task metadata
  • recent output tail
  • stop action when the process is stoppable

For subagents, the detail view shows:

  • agent title / nickname
  • role
  • task prompt
  • status
  • elapsed runtime
  • progress lines when available

4. Plan/task monitoring

In addition to background terminals and subagents, Open Codex also surfaces the latest plan/task list in the same Down panel.

This matters because compact status-line counters are useful, but insufficient when the user wants to inspect:

  • what tasks exist
  • which tasks completed
  • which task is currently active
  • what remains pending

So the panel acts as a lightweight task manager for the current session.

Other features in Open Codex CLI

Open Codex also includes several adjacent TUI / workflow improvements:

  • /effort slash command for changing reasoning effort
  • query-level ulw / ultra / xhigh marker support for one-turn xhigh reasoning
  • per-turn reasoning effort visibility in the status line while the turn is running
  • /export <path> for markdown session export
  • status-line token throughput visibility
  • workspace git diff stats in the status line
  • Open Codex-aware npm update prompts
  • active memory staging on top of upstream memories
  • stale turn output protection in the TUI
  • improved user-query highlighting in chat history and composer

More details are in the fork README:

https://github.com/LEON-gittech/codex

Why this may be useful upstream

The core idea is that background work should be first-class TUI state, not a blocking foreground wait state.

A useful upstream design could separate three concepts:

  1. foreground model activity
    The main assistant is currently generating or deciding.

  2. background task activity
    Terminals/subagents are still running, but they should not block input.

  3. task management UI
    Users need a stable place to inspect, switch, stop, and review background work.

This distinction makes the TUI easier to reason about:

  • Working means the foreground model is active
  • background work is visible but nonblocking
  • users can inspect details through a dedicated panel
  • completed work can be surfaced without hijacking the chat stream

Implementation reference

The current implementation is available here:

https://github.com/LEON-gittech/codex

This is not proposed as a direct patch to copy verbatim. It is a working fork implementation that may help evaluate the interaction model and identify which parts would be appropriate for upstream Codex.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLITUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displayenhancementNew feature or requestplanIssues involving plan modesubagentIssues involving subagents or multi-agent features

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions