Skip to content

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

Open

Description

@cowwoc

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.

Activity

  1. added
    bug
    on Jul 22, 2026
  2. added
    CLI
    subagent
    session
    on Jul 22, 2026
  3. github-actions commented on Jul 22, 2026

    @github-actions
    Contributor
  4. cowwoc commented on Aug 13, 2026

    @cowwoc
    Author

    @etraut-openai For what it's worth, in version 0.147.0 I'm able to /resume long sessions fairly quickly but switching back from a subagent to the main agent still seems to hang forever. I keep on having to kill codex and /resume to return to the main agent.

    All this to say, it sounds like there are two separate bugs at play.

  5. cowwoc commented on Aug 19, 2026

    @cowwoc
    Author

    Closing this as fixed in 0.148.0

  6. reopened this on Aug 26, 2026
  7. cowwoc commented on Aug 26, 2026

    @cowwoc
    Author

    Reopening this issue as I'm seeing the behavior again in version 0.149.1. Maybe it was never fully fixed...

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

    CLIbugperformancesessionsubagent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions