/agent command takes extremely long to switch back to the main agent

Open
#34,776 4 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
cli

Research direction

Start by reproducing the regression with /agent and session resume in Codex CLI 0.145.0 using the uploaded thread 019f6908-95ff-73d2-92c5-ba698e0e9bec, then compare behavior with 0.144.6. Focus on the long-session path and the difference between switching to a subagent and switching back to the main agent. Done means agent switching completes within 2 seconds and session resume within 15 seconds, or provides progress for longer operations.

Written by the indexing model from the issue text.

Description

bug CLI performance session subagent
What version of Codex CLI is running?

codex-cli 0.145.0

What subscription do you have?

Pro 20x

Which model were you using?

gpt-5.6-luna

What platform is your computer?

Linux 6.18.33.2-microsoft-standard-WSL2 x86_64 x86_64

What terminal emulator and version are you using (if applicable)?

Windows Terminal

Codex doctor report
{
  "schemaVersion": 1,
  "generatedAt": "1784733292s since unix epoch",
  "overallStatus": "warning",
  "codexVersion": "0.145.0",
  "checks": {
    "app_server.status": {
      "id": "app_server.status",
      "category": "app-server",
      "status": "ok",
      "summary": "background server is not running",
      "details": {
        "control socket": "/home/gili/cat/.codex/app-server-control/app-server-control.sock",
        "daemon state dir": "/home/gili/cat/.codex/app-server-daemon",
        "mode": "ephemeral",
        "pid file": "/home/gili/cat/.codex/app-server-daemon/app-server.pid (missing)",
        "settings": "/home/gili/cat/.codex/app-server-daemon/settings.json (missing)",
        "status": "not running",
        "update-loop pid file": "/home/gili/cat/.codex/app-server-daemon/app-server-updater.pid (missing)"
      },
      "remediation": null,
      "durationMs": 0
    },
    "auth.credentials": {
… +301 lines (ctrl + t to view transcript)
        "terminal title project value": "2.1-add-divide-and-co...",
        "terminal title source": "default"
      },
      "remediation": null,
      "durationMs": 0
    },
    "updates.status": {
      "id": "updates.status",
      "category": "updates",
      "status": "ok",
      "summary": "update configuration is locally consistent",
      "details": {
        "cached latest version": "0.145.0",
        "check for update on startup": "true",
        "last checked at": "2026-07-22T14:22:04.036380264Z",
        "latest version": "0.145.0",
        "latest version status": "current version is not older",
        "update action": "manual or unknown",
        "version cache": "/home/gili/cat/.codex/version.json"
      },
      "remediation": null,
      "durationMs": 262
    }
  }
}
What issue are you seeing?

I am seeing a major performance regression when switching agents or resuming sessions in version 0.145.0 compared to 0.144.6.

In version 0.144.6, switching agents using /agent was almost instantaneous. Resuming the session took ~15-30 seconds, not 8 minutes.
In version 0.145.0 resuming the session or using /agent to switch from a subagent back to the main agent takes 8 minutes to complete with little to no visible CPU, disk or network usage.

Switching from the main agent to a subagent remains fast.

What steps can reproduce the bug?

Uploaded thread: 019f6908-95ff-73d2-92c5-ba698e0e9bec

What is the expected behavior?
  • Switching between agents using /agent should take no longer than 2 seconds
  • Resuming sessions should take no longer than 15 seconds. Consider showing a progress indicator for long operations.
Additional information

This is a long session, spanning continuous work over ~2-3 days of work.

Dominant language
Rust
Stars
125k
Forks
19.5k
Avg merge
1m
Merged PRs (30d)
1k

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.