codex - 💡(How to fix) Fix When running multiple agents in a session, switching between agents clears the message queue in the main thread. [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#20191Fetched 2026-04-30 06:32:23
View on GitHub
Comments
2
Participants
2
Timeline
9
Reactions
0
Author
Timeline (top)
labeled ×5commented ×2unlabeled ×2
RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

0.125.0

What subscription do you have?

Pro x20

Which model were you using?

gpt-5.5

What platform is your computer?

Linux

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

WSL/PowerShell

What issue are you seeing?

If there are multiple messages queued in the main session thread (added by pressing Tab), switching to another agent and then back to the main thread removes them from the queue. Instead of remaining in the send queue, all these messages are merged together and placed back into the text input field.

What steps can reproduce the bug?

  1. Start a session with multiple agents.
  2. In the main session thread, type a message and press Tab to add it to the queue.
  3. Repeat step 2 to have several messages in the send queue.
  4. Switch to any other agent.
  5. Switch back to the main session thread.

What is the expected behavior?

The messages should remain in the send queue in their original state, waiting to be sent. Switching between agents should not affect the queue in the main thread.

Additional information

It's annoying to separate the messages again by rebuilding the queue.

extent analysis

TL;DR

The issue can be mitigated by avoiding switching between agents while there are messages queued in the main session thread.

Guidance

  • Verify that the issue only occurs when switching between agents with queued messages in the main thread.
  • Try queuing messages in a different agent and switching between agents to see if the issue is specific to the main thread.
  • Consider using a temporary workaround, such as sending messages immediately instead of queuing them, to avoid losing message separation.
  • Check if the issue persists when using a different terminal emulator or platform to rule out environment-specific causes.

Notes

The root cause of the issue is unclear, but it appears to be related to the interaction between the Codex CLI, agent switching, and message queuing. Further investigation is needed to determine the underlying cause.

Recommendation

Apply workaround: Avoid switching between agents while there are messages queued in the main session thread, or send messages immediately instead of queuing them, to prevent message merging and loss of separation.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING