Skip to content

Codex Desktop macOS: read_thread_terminal cannot see a working integrated terminal #31417

Open

Description

@jlecerf62

Summary

In Codex Desktop on macOS, the integrated terminal is open and fully functional, but the agent-side read_thread_terminal tool cannot read it and always returns:

No app terminal session is attached to this thread yet.

The desktop logs show that the visible route uses the permanent thread ID while panel/session ownership continues to use a temporary client-new-thread:... ID. This appears to prevent the terminal snapshot lookup from finding the current thread's terminal.

Environment

  • Codex Desktop: 26.623.141536 (build 4753)
  • Bundled Codex CLI: 0.142.5
  • macOS: 26.5.1 (25F80)
  • Architecture: Apple Silicon (arm64)
  • Authentication: ChatGPT
  • Thread type: local/projectless desktop thread

Actual behavior

  1. The integrated terminal opens inside the Codex app.
  2. Commands run normally. codex doctor --all reports that stdin, stdout, and stderr are TTYs, with TERM=xterm-256color, and correctly identifies the current project.
  3. Asking the agent to inspect the current terminal invokes read_thread_terminal.
  4. The tool responds that no app terminal session is attached.
  5. The same failure occurs with a second terminal tab.

Relevant sanitized desktop-log pattern:

conversationId=client-new-thread:<temporary-id>
ownerRoutePath=/local/<permanent-thread-id>

The IDs remain different after switching to another chat and returning.

Expected behavior

The terminal session visible in the current thread should be associated with the permanent thread ID, and read_thread_terminal should return the active integrated-terminal snapshot.

This is also the behavior described in the Codex app documentation: Codex can read the current integrated-terminal output.

Steps to reproduce

  1. Open Codex Desktop on macOS.

  2. Create a new local/projectless thread.

  3. Open the integrated terminal in that thread.

  4. Run:

    printf 'codex-terminal-check\n'
  5. Ask the agent to read/check the built-in terminal.

  6. Observe:

    No app terminal session is attached to this thread yet.
    

Recovery attempts

  • Closed and reopened the terminal panel.
  • Created another terminal tab and selected it.
  • Switched to another chat and returned.
  • Quit and restarted Codex, then created a fresh terminal.
  • Confirmed the Codex installation, databases, configuration, authentication, network, and thread inventory pass codex doctor --all.

The issue persists.

Additional information

No raw logs or full thread identifiers are included here because they can contain private information. A sanitized log excerpt or an in-product /feedback session can be provided if needed.

Activity

  1. added
    bug
    app
    app-server
    tool-calls
    on Jul 7, 2026
  2. AliAltivate commented on Jul 12, 2026

    @AliAltivate

    I traced the shipped Desktop renderer and found the concrete lookup mismatch described here. Terminal sessions are stored under clientThreadId, while read_thread_terminal initially queries by permanent thread ID. The renderer already maintains a permanent-ID → client-ID alias map; the minimal fix is alias-aware snapshot lookup rather than rekeying/restarting the PTY.

    A related route bug also returns null for client-local-thread, causing the terminal toggle to silently no-op. Full findings, patch pseudocode, and regression cases are in: #28141 (comment)

    I did not open a public PR because these Desktop renderer symbols are not present in the public repository; the public app-server PTY layer does not own Desktop route/session aliases.

  3. Radagast011 commented on Jul 15, 2026

    @Radagast011

    Reproduced on a newer macOS Desktop build.

    Environment

    • Codex Desktop: 26.707.72221 (build 5307)
    • Bundled Codex CLI: 0.144.2
    • macOS: 26.0.1
    • Architecture: Apple Silicon / arm64
    • Thread type: local folder-backed Desktop task

    Observed behavior

    1. Open the integrated terminal in the active task.
    2. Run a sentinel command; the terminal is fully interactive and displays the expected output.
    3. Ask the agent to inspect the active terminal.
    4. read_thread_terminal consistently returns:
    No app terminal session is attached to this thread yet.
    

    The visible terminal remains usable throughout.

    Recovery attempts

    • Closed and reopened the terminal panel.
    • Created and selected a new terminal tab.
    • Quit and restarted the Desktop app.
    • Reopened the task and created another terminal.

    The failure persists.

    Sanitized local inspection shows no shell or PTY startup failure. The behavior is consistent with the reported terminal-owner lookup mismatch: the visible terminal exists, but the snapshot lookup for the permanent thread ID resolves no attached session.

    No raw logs, task identifiers, filesystem paths, hostnames, account details, network addresses, screenshots, or credentials are included here.

  4. bjober commented on Aug 6, 2026

    @bjober

    I got the integration working thus recovering from this situation simply by choosing an avatar. I did not choose an avatar during installation.
    I could then op-out of the annoying little bagger an still have the terminal connection working.

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

    appapp-serverbugtool-calls

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions