Skip to content

Background task management for codex - seeking approval to submit PR #6404

Closed

Description

@leoisadev1

Hey team! I've built a feature that lets AI agents run background tasks so they can do multiple things at once, and wanted to get approval before submitting a PR (per the contributing guidelines).

The problem this solves

Right now when the AI runs a command, it blocks until that command finishes. This is a problem for:

  • Starting dev servers (blocks the AI from making code changes while server runs)
  • Running long builds while continuing to work on other tasks
  • Monitoring logs while deploying
  • Running tests in background while writing more code

What I built

A background task management system that allows the AI to:

  • Start shell commands in the background (e.g., npm run dev keeps running while AI does other work)
  • Check output from background tasks anytime using bash_output tool
  • Kill background tasks when done using kill_shell tool
  • View all active background tasks via TUI (Ctrl+B shows list of running tasks)

Implementation details

  • Built on Tokio for async process management
  • Resource limits: max 20 concurrent tasks, 10k line output buffer per task
  • Clean process cleanup when task/session ends
  • Full test coverage (12 tests)
  • Hex-based shell IDs for easy reference

This is related to #3968 - enables the same workflow where AI can start long-running processes and continue working.

Would you be open to reviewing a PR for this?

Thanks!

Activity

  1. added
    enhancementNew feature or request
    CLIIssues related to the Codex CLI
    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal display
    on Nov 8, 2025
  2. etraut-openai commented on Nov 8, 2025

    @etraut-openai
    Contributor

    Thanks for your interest in codex. This looks like an interesting feature.

    We're not accepting new PRs for new features at this time. Each new feature requires the involvement of the codex team to ensure that the design is sound, the feature composes well with existing and upcoming features, the feature works with all of the codex surfaces, and the implementation does not introduce regressions and is maintainable.

    We have a long backlog of feature requests. We're generally prioritizing based on community feedback. Feature request #3968 has received some "thumbs up" reactions, but there are many features currently ahead of it in the priority queue.

    If you have any thoughts about the design of this feature, we'd appreciate it if you'd add those to the the thread for #3968. We'd welcome any insights that you gained from implementing your proof of concept.

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

    CLIIssues related to the Codex CLITUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displayenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions