openai / openai/codex

Desktop agent is not resumed when a background exec session completes

Open
#42,908 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app app-server enhancement tool-calls
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

Product

Codex desktop agent invoking Codex CLI through a long-running exec/PTY session.

Problem

When an exec command yields a session ID and continues in the background, completion is not delivered back to the parent agent as an event. The parent can discover completion only by explicitly polling the session. If the conversational turn has already ended, the workflow cannot automatically resume and run its next step.

Reproduction
  1. From a Codex desktop task, start a long-running command such as codex exec.
  2. Let the command yield a PTY/session ID while it keeps running.
  3. End or yield the parent turn.
  4. Allow the child process to finish.
Actual behavior

No completion event wakes or resumes the parent task. The result remains undiscovered until the user sends another message or the agent manually polls the PTY session.

Expected behavior

The parent task should receive a terminal-session completion event containing at least the session ID, exit status, and an output cursor. It should then be able to continue the workflow, similar to completion notifications from managed subagents.

Impact

Long-running CLI orchestration requires busy polling or user reminders. Multi-stage flows such as generate, review, and package cannot reliably proceed unattended.

Environment
  • Codex CLI 0.153.4
  • macOS
  • Codex desktop task using an exec/PTY tool

A completion callback from the app-server or desktop terminal-session layer would address this without requiring output polling.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the app-server or desktop terminal-session layer responsible for exec/PTY sessions, then reproduce the long-running Codex CLI command described in the issue. Done means the parent task receives a completion event with the session ID, exit status, and output cursor, allowing it to resume without polling or another user message.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, rust
Domain
cli, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.