Allow switching away from active CLI sessions while their turns keep running

Resolved 💬 1 comment Opened Jul 20, 2026 by hmooko Closed Jul 20, 2026

What variant of Codex are you using?

CLI

What feature would you like to see?

I would like Codex CLI to allow switching away from a session while its active turn continues running in the background.

Currently, /resume is disabled while a task is in progress:

'/resume' is disabled while a task is in progress.

This prevents a workflow where, for example, a long-running task continues in project A while I switch to a session in project B, respond to an approval request there, and later return to project A without cancelling or restarting its task.

The session picker should be available during an active turn. Selecting another session should detach the current TUI view from the previous session without cancelling that session's work.

I propose grouping the picker into three sections:

  1. Needs attention
  • Waiting for user input
  • Waiting for approval
  • Completed in the background and not yet viewed
  1. Running
  • Has an active turn and does not currently require user input
  1. History
  • Inactive sessions

There should be a blank line between sections. Individual rows do not need redundant status dots or labels such as run, because the section already communicates the state.

A configurable shortcut could open the picker when the composer is empty. For example, Left Arrow could provide a quick-switch workflow similar to Claude Code, while /resume remains the explicit command. Normal cursor movement should be preserved whenever the composer contains text.

Selecting the session already being viewed should simply close the picker rather than displaying an error such as:

Already viewing ...jsonl

Additional information

This is related to #6500, but its scope is narrower: #6500 proposes general session management such as list, rename, delete, and switch. This request focuses specifically on live session switching, background turn continuity, and attention/running state in the picker.

Expected workflow:

  1. Start a turn in session A.
  2. Open the session picker while A is still working.
  3. Switch to session B, including a session from another working directory.
  4. Session A continues running in the background.
  5. If A requires approval or input, it moves to Needs attention.
  6. If A completes in the background, it remains in Needs attention until opened.
  7. Returning to A restores its live conversation and task state.
  8. Its Working timer continues from the original turn start rather than resetting to zero after each switch.

Suggested acceptance criteria:

  • /resume can open during an active turn.
  • Switching sessions does not interrupt or cancel the previous session.
  • Sessions associated with different working directories can be opened.
  • Runtime state is sourced from the active Codex process rather than inferred only from persisted JSONL files.
  • The picker has Needs attention, Running, and History sections.
  • Background completions remain unviewed until opened.
  • Selecting the current session closes the picker without an error.
  • Elapsed working time is preserved when switching away and returning within the same CLI process.
  • The quick-switch shortcut is configurable and does not interfere with editing non-empty input.

I have implemented a working local prototype with tests and can submit a PR if the proposed UX and scope are acceptable.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗