Skip to content

[Bug]: Windows long-running Codex tool loses exec cell and completion #6656

Closed

Description

@kingsleyonoh

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/desktop

Steps to reproduce

On Windows with the Codex provider:

  1. Open a T3 Code thread and ask Codex to run a foreground command that lasts longer than the functions.exec yield window. A deterministic example is a pytest suite lasting 1-2 minutes.
  2. Codex calls functions.exec, which calls shell_command. The cell yields with Script running with cell ID <id>.
  3. Codex calls functions.wait with that cell ID until completion.
  4. Observe that T3/Codex can discard the cell before the final result is delivered: a later wait returns exec cell <id> not found even though the child process may still be running or may already have finished.
  5. Separately, run a 5-15 second foreground nested tool call. While it is in flight, the transcript can show only the assistant's preceding status text with no visible command/tool row. Sending a follow-up message then steers the turn and the tool result is returned to the agent only as aborted, with no final child exit status.

The failure reproduced repeatedly in one thread. A full pytest run yielded normally, two waits succeeded, and the next wait lost the cell. Detached Start-Process and WMI-launched descendants also failed to leave a dependable terminal result after the provider/harness lifecycle intervened.

Expected behavior

  • A yielded exec cell remains addressable until its command reaches a terminal state and the final exit code/output has been acknowledged.
  • T3 visibly shows an in-flight foreground tool call.
  • A steered follow-up either leaves the command attached and queryable, or explicitly cancels it and reports the child process's terminal state.
  • After an app/thread interruption, the provider can reattach using a durable job ID and recover the final result. This must be reliable enough for unattended builds, test suites, CI watches, and deployments.

Actual behavior

The execution handle disappears while work is still ambiguous. The agent receives exec cell <id> not found or aborted instead of the final command result. The UI may look idle while the tool is in flight. This makes it impossible to know safely whether an overnight task completed, failed, or is still running, and can cause duplicate reruns.

This overlaps the in-flight visibility symptom in #5043, but adds a separate lifecycle/data-loss failure: the resumable cell and final exit status are lost.

Impact

Major degradation or frequent failure

Version or commit

T3 Code v0.0.33 (Alpha); Codex CLI 0.147.0; bundled command runner observed as 0.146.0-alpha.9.2

Environment

Windows 11 Pro 64-bit, version 10.0.26200 (build 26200); T3 Code desktop; Codex provider; PowerShell; full-access workspace

Logs or stack traces

functions.exec -> Script running with cell ID 16
functions.wait(cell_id=16) -> additional output / still running
functions.wait(cell_id=16) -> exec cell 16 not found

# Separate short foreground calls after a follow-up message was sent:
functions.exec -> aborted

The provider event log is under .t3/userdata/logs/provider/ and records the affected thread/turn. No application secrets are required for the repro.

Screenshots, recordings, or supporting files

The transcript visibly shows the status message but no in-flight tool row while the command is pending. This matches part of #5043's presentation symptom.

Workaround

No reliable in-app workaround. Short foreground shards can avoid yielding, but that does not help genuinely long jobs. We are testing an OS-scheduled runner that writes a durable manifest (queued/running/completed/failed), heartbeat, PID, stdout/stderr, JUnit, and exit-code marker so a later turn can reattach without relying on the T3 exec-cell handle. GitHub Actions is the safer current option for repository test/deploy jobs because its run ID and terminal conclusion remain queryable.

Related upstream Codex report: openai/codex#38069 (comment)

Activity

  1. kingsleyonoh commented on Aug 15, 2026

    @kingsleyonoh
    Author

    Correction after validating collection completeness: this reproduction shows cancellation and a misleading partial artifact, not a post-exit delivery race. The selected shard collects 54 tests; after the user sent a follow-up, the provider received only �borted, no pytest process remained, and JUnit contained just 13 completed tests with 0 failures/errors. Pytest finalized that partial report during interruption. This is the core UX problem: asking whether an invisible command finished can cancel it, and the partial JUnit can look green unless its count is compared with the pre-recorded collection count. The safe current workaround is an external durable executor (for example GitHub Actions with a persisted run ID); local Start-Process, WMI, and Task Scheduler attempts were also reaped in this environment.

  2. maria-rcks commented on Oct 15, 2026

    @maria-rcks
    Collaborator

    Note

    This is an automated response from a bot acting on maria's behalf.
    This issue has had no activity since 2026-08-15.
    Is it still relevant on the current version? If so, your version and OS would help.

  3. added
    needs more infoInitial triage showed no bug. Awaiting more info
    and removed
    needs more infoInitial triage showed no bug. Awaiting more info
    on Oct 22, 2026
  4. juliusmarminge commented on Oct 27, 2026

    @juliusmarminge
    Member

    Re-ran this on current main (5808469018) and on v0.0.33 with the Codex provider (Codex CLI 0.163.0, code mode on, Full access). The thread ran a foreground script that prints a line every 5 s for ~90 s and then exits with code 7, and a second script that runs ~12 s and exits with code 3. Partway through each script I sent a follow-up ("Is it done yet? Keep waiting if not.").

    v0.0.33: while the script ran, the transcript showed only the assistant's status line and "Working for 19s", with no command row. This matches what you saw.

    v0.0.33: no tool row while the command runs

    main:

    • The in-flight command shows as "Running slow.sh" for the whole run.
    • The follow-up is sent to Codex as a native steer (#2829; v0.0.33 sent it as a second turn/start).
    • After the steer, the command stayed attached. Codex polled it three more times and received the real result: exit code 7 with FINISHED-MARKER for the long run, exit code 3 for the 12 s run.
    • The provider event log has no aborted or exec cell … not found for either run.

    main: tool row visible while the command runs
    main: steered mid-command, final exit code delivered

    How long a yielded functions.exec cell stays alive, and whether a cell can be reattached by a durable job ID, is decided by Codex's own exec runtime (codex-code-mode-host and its command runner). T3 doesn't own that handle. The upstream report you linked (openai/codex#38069) is the right place for that part.

    Closing, since the T3 side is fixed on main. If you still get aborted or exec cell <id> not found after a follow-up on a current build, please reopen with the T3 version, the Codex CLI version, and the matching .t3/userdata/logs/provider/events.<thread>.log lines.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions