Skip to content

CLI: command approval dialog leaks into unrelated Codex sessions across worktrees #48349

Description

@creep1ng

What version of Codex CLI is running?

codex-cli 0.157.1

What subscription do you have?

Not disclosed.

Which model were you using?

gpt-6-sol in the requesting thread. Other Codex sessions were open concurrently.

What platform is your computer?

Linux x86_64 (uname -mprs: Linux 7.2.7-1-cachyos-server x86_64 unknown). Multiple Codex CLI TUIs ran in separate Herdr 0.9.1 panes, each in a different Git worktree.

What terminal emulator and version are you using?

Herdr 0.9.1 multiplexed the Codex panes. Outer terminal details were not captured.

Codex doctor report

codex doctor --json completed. Overall status was warning because config.load reported an unrecognized configuration setting; config parsing succeeded. The full report is withheld because it includes local paths and configuration metadata. No notify or tui.notifications override is configured.

What issue are you seeing?

A command-approval dialog belonging to one Codex thread is rendered inside other Codex CLI sessions in unrelated worktrees. A 38-second screen recording shows the same modal's Thread: Agent (<same thread ID>) field in at least two different Codex panes that visibly contain unrelated conversations. The requested command changes as the originating thread makes subsequent requests, but the unrelated panes show the new approval modal too.

Herdr then marks those panes as Action Required, apparently because their terminal screens now contain a real Codex approval dialog. The reporter also hears spurious completion sounds when the originating thread finishes; the video supports the approval/UI and Herdr state behavior, but does not establish the sound's underlying event path.

This is not just a notification banner: the full interactive Would you like to run the following command? dialog, with Yes/No choices, appears in a different session's TUI. I did not test whether accepting from the wrong pane executes the command, so approval execution crossing remains unconfirmed. Nevertheless, the UI makes it hard to know which session owns the requested command.

What steps can reproduce the bug?

  1. Open multiple Codex CLI sessions in separate Herdr panes, each in a distinct Git worktree and with a different conversation.
  2. In session A, request a command requiring user approval; leave the dialog pending.
  3. Focus session B and then session C. In the recording, an approval modal with the same Thread: Agent ID from A is visible over each unrelated conversation, and Herdr labels multiple panes Action Required.
  4. Resolve or dismiss the pending approval. The cross-pane modal disappears and Herdr's sidebar state changes again.

The issue was observed with several panes open. The screen recording includes private project text and paths, so it is not attached publicly. A redacted excerpt can be prepared if maintainers need it.

What is the expected behavior?

Only the Codex session that owns the command request should render its approval dialog. Other sessions should continue displaying their own conversation and should not become actionable due to a foreign thread's request. If cross-session approval notification is intentional, it should identify the owning thread and must not replace another session's interactive TUI state.

Additional information

  • The Herdr Codex integration installed here reports session identity only via SessionStart. Herdr's Codex lifecycle state is screen-detected; the same foreign approval dialog was visibly present in the Codex panes themselves. This makes Herdr's simultaneous Action Required labels a downstream effect rather than proof of a Herdr routing defect.
  • Codex's tui.notifications = false setting can suppress Codex TUI notifications, but it does not explain or fix an interactive approval modal rendered in another thread's terminal.
  • I found no clearly equivalent open or closed Codex CLI issue. Related but different: Rogue approval across Codex sessions plus frozen/stale TUI after interrupt #30714 concerns suspected cross-session approval execution after an interrupted Windows task; this report is directly observable cross-session approval UI rendering on Linux, without claiming cross-session execution.

Activity

  1. added
    bugSomething isn't working
    CLIIssues related to the Codex CLI
    sandboxIssues related to permissions or sandboxing
    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal display
    sessionIssues involving session (thread) management, resuming, forking, naming, archiving
    on Sep 26, 2026
  2. etraut-openai commented on Oct 2, 2026

    @etraut-openai
    Contributor

    (response from codex)

    Thanks for the detailed report. We investigated the approval-routing path in Codex 0.157.1 and confirmed that approval requests are scoped to app-server connections subscribed to the owning thread; pending approvals are also keyed by thread ID.

    The reported reproduction relies entirely on Herdr, which owns the pane PTYs, derives status from terminal output, records Codex session identities, and can restore panes with codex resume <id>. Without logs, actual thread IDs, a public recording, or a reproduction in independent terminals, we don’t have evidence that Codex routed an approval to an unrelated session rather than Herdr duplicating or restoring a pane/session attachment.

    We’re closing this as an external integration issue. If this reproduces in separate ordinary terminals or tmux without Herdr, please open a new issue with the thread IDs and redacted logs/video, and we’ll investigate.

  3. sbasurto commented on Oct 9, 2026

    @sbasurto

    I am experiencing this issue as well, with an additional serious usability problem.

    I run multiple Codex CLI sessions in separate Linux terminals, working on different projects.

    When one Codex session requests command approval, the approval dialog can appear in another unrelated terminal and interrupt what I am actively typing.

    This is more than an inconvenient notification. It disrupts the workflow, creates confusion about which session is requesting authorization, and introduces the risk of accidental approval through unintended keyboard input.

    Expected behavior:

    • Each Codex instance must handle its own approval requests.
    • Approval dialogs must never interrupt input in unrelated sessions.
    • Terminal input should remain isolated between independent Codex instances.
    • Users must be able to work in multiple terminals simultaneously without interference.

    Disabling approvals or bypassing the sandbox is not an acceptable workaround, because it sacrifices security to compensate for a user-interface defect.

    Please reconsider this issue. Session isolation should be a fundamental requirement for a professional command-line development tool.

  4. etraut-openai commented on Oct 9, 2026

    @etraut-openai
    Contributor

    @sbasurto, are you using Herdr? If so, please report the issue to them. If you're not, please open a new bug report and use /feedback to send your logs. That will allow us to investigate further.

  5. sbasurto commented on Oct 9, 2026

    @sbasurto

    6. @sbasurto, are you using Herdr? If so, please report the issue to them. If you're not, please open a new bug report and use /feedback to send your logs. That will allow us to investigate further.

    Sorry what is Herdr?, I am using codex in gentoo with terminator terminal. The codex version is: OpenAI Codex (v0.162.0).

  6. etraut-openai commented on Oct 9, 2026

    @etraut-openai
    Contributor

    @sbasurto, this bug report was closed because the behavior was diagnosed as a problem with Herdr, which is an alternate TUI that uses the codex harness. If you're not using Herdr, then you are not seeing the same bug. Please open a new bug report with the details requested in the bug template.

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 displaybugSomething isn't workingsandboxIssues related to permissions or sandboxingsessionIssues involving session (thread) management, resuming, forking, naming, archiving

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions