Skip to content

WSL tab close during running turn leaves resumed session stuck in Working (missing task_complete) #12843

Closed as duplicate

Description

@Ryogoooo

Summary

When an interactive Codex session is still running and the WSL Ubuntu terminal tab is closed via the tab-bar x button, reopening with codex resume can leave the session stuck in Working (...) forever.

In the affected session file, the last turn has task_started but no matching task_complete (and no turn_aborted).

Environment

  • OS: WSL Ubuntu (user environment)
  • Codex CLI: 0.104.0
  • Date observed: 2026-02-25 to 2026-02-26 (UTC timestamps in logs)

Reproduction (observed flow)

  1. Start a normal interactive Codex session.
  2. While a turn is still running (Working shown), close the terminal tab using the tab bar x button (abrupt terminal close).
  3. Reopen terminal and run codex resume for that session.
  4. UI remains in Working (..s • esc to interrupt) and does not recover.

Expected

Session should recover gracefully on resume, or auto-mark the interrupted turn as aborted/completed so Working does not stay forever.

Actual

Working remains indefinitely. The underlying session JSONL has an unmatched task_started turn.

Evidence

1) Missing terminal turn-end event in session logs

Session A:

  • file: ~/.codex/sessions/2026/02/25/rollout-2026-02-25T23-20-34-019c952c-4e6d-7dc3-bdfd-b070a914b7aa.jsonl
  • has: task_started for turn_id=019c9578-4a8a-7e33-9d1e-d65708ffa679
  • originally missing: task_complete / turn_aborted for same turn

Session B:

  • file: ~/.codex/sessions/2026/02/15/rollout-2026-02-15T18-21-15-019c609a-ad65-7761-a862-3af2e958375a.jsonl
  • has: task_started for turn_id=019c9517-3f2d-7b50-8057-32c3df1d850d
  • originally missing: task_complete / turn_aborted for same turn

2) TUI error around the same period

From ~/.codex/log/codex-tui.log:

  • 305225: 2026-02-26T00:02:57.055045Z ERROR codex_tui::chatwidget::agent: failed to submit op: internal error; agent loop died unexpectedly
  • 305226: 2026-02-26T00:02:57.055061Z ERROR codex_tui::chatwidget::agent: failed to submit op: internal error; agent loop died unexpectedly

Temporary workaround (worked)

Manual log repair:

  1. Backup the affected session JSONL.
  2. Append a synthetic event:
{"timestamp":"<utc>","type":"event_msg","payload":{"type":"task_complete","turn_id":"<stuck_turn_id>","last_agent_message":null}}
  1. Resume/restart Codex.

After this, stuck Working was cleared in both reproduced sessions.

Notes

This looks like resume recovery does not reconcile dangling task_started turns after abrupt terminal/tab termination.

Activity

  1. added
    bugSomething isn't working
    CLIIssues related to the Codex CLI
    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal display
    windows-osIssues related to Codex on Windows systems
    on Feb 26, 2026
  2. github-actions commented on Feb 26, 2026

    @github-actions
    Contributor
  3. Ryogoooo commented on Feb 26, 2026

    @Ryogoooo
    Author

    Duplicated!!
    Good luck

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 workingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions