Skip to content

[Windows Desktop] Sending is permanently blocked once a turn is stuck in inProgress — survives full app restart (repro on 26.915.3509.0) #46375

Open

Description

@zhengfei303101-cmyk

Environment

  • OS: Windows 10 Pro 22H2 (build 19045.6466)
  • Codex Desktop: 26.915.3509.0 (app-server client_version=26.915.31029)
  • Previously reproduced on: 26.908.4834.0, 26.908.9136.0
  • Not a fresh install; long-lived heavy usage (approx. 250 conversations, 2,300 turns on this machine)

Symptom

The message send button becomes disabled (greyed out) and never recovers. There is no error
toast, no retry, no visible failure
— the UI silently swallows the send. Typing a new message does
not re-enable it.

It is reproduced by reopening an existing conversation and sending. Concretely:

  1. A turn enters inProgress and never terminates (the sampling stream dies silently — see below).
  2. From that point on, every send attempt in that conversation is silently dropped, permanently,
    including after full app restart.

Hard evidence

1) Client never dispatches the request. Log window after a cold start on 26.915.3509.0:

thread/resume              86
thread/start                0
turn/start                  0     <-- key
op.dispatch.turn_input      0     <-- key
turn/completed              0

86 thread/resume, zero turn/start. The message never leaves the renderer — this is a
client-side gating failure, not a network or backend issue.

2) The gating predicate. Inspecting the Electron client bundle (app\resources\app.asar),
canSend() delegates to a predicate with this shape:

function gate({ conversationNeedsResume, hasConversation, latestTurn, message, streamRole }) {
  return message.pausedReason                                    // ①
      || !hasConversation                                        // ②
      || streamRole?.role === 'follower'                          // ③
      || latestTurn?.status === 'inProgress'                      // ④
    ? true                                                       //    true = BLOCK the send
    : conversationNeedsResume || latestTurn == null
      ? false                                                    // ⑤ bypass (on reconnect)
      : latestTurn.status !== 'completed'                         // ⑥
        || !latestTurn.items.some(x => x.type === 'agentMessage'  // ⑦
             || (x.type === 'contextCompaction' && x.source === 'manual'));
}

The ordering is the bug. Conditions ①–④ are hard blocks evaluated before the ⑤
conversationNeedsResume bypass. So when a turn is stuck at inProgress, ④ wins, and nothing —
including a full reconnect — can ever unblock that conversation.

3) The poisoning turn. Persistent state on disk (thread_history_1.sqlite → thread_turns):

completed    2140
interrupted   119
failed         36
inProgress      2   <-- turns that will never complete; the 2 conversations owning them are dead

4) Upstream cause of the stuck turn. Fatal retry loop against the API, then silence:

WARN codex_core::responses_retry
  stream disconnected - retrying sampling request (N/5)...
  sampling_error = stream disconnected before completion:
    IO error: peer closed connection without sending TLS close_notify: unexpected EOF

After retries are exhausted the turn never emits a terminal event — it stays inProgress
forever. Durability note: this still occurs on 26.915.3509.0 (unlike issues caused by local config).

5) Verified NOT fixed in 26.915.3509.0. Bit-level comparison of app.asar between
26.908.9136.0 (310 MB) and 26.915.3509.0 (345 MB): all five identifiers around the gate
(conversationNeedsResume, pausedReason, markAllConversationsNeedResumeAfterReconnect,
streamRole, Interrupted before the steer was accepted) appear the same number of times
(4 / 25 / 12 / 69 / 6)
, and the predicate control flow is byte-identical modulo minifier
renaming (aSe → mCe). The 35 MB of new code did not touch this path.

Why this compounds badly

sampling stream dies (peer closes TLS without close_notify)
  -> retries exhausted, no terminal event
  -> turn stays inProgress persistently (thread_turns.status)
  -> gate condition ④ blocks every future send in that conversation, forever
  -> user force-quits the app to recover
  -> the in-flight turn is hard-interrupted, leaving only a userMessage in the rollout
  -> conversation becomes even harder to recover

We observed this loop produce ~25 conversations containing only a userMessage and no assistant
reply — i.e. the product's own failure mode trains users into a behavior that makes it worse.

Reproduction

  1. Use the desktop app normally until a turn's sampling stream is killed mid-flight
    (peer closed connection in logs).
  2. Observe the turn stops producing output and never completes.
  3. Reopen that conversation and try to send. The send button is greyed out; nothing is dispatched
    (turn/start count stays at 0 in the logs).

Suggested fixes

  1. Timeout / staleness escape hatch. Do not treat inProgress as an indefinite hard block.
    If a turn has produced no events for N minutes, allow sending (optionally resuming or aborting
    the stale turn).
  2. Reorder the predicate. Evaluate the conversationNeedsResume bypass (⑤) before the
    inProgress check (④), or expose an explicit user override ("force send" / "abort turn and send").
  3. Surface the failure. A silently disabled send button with no explanation is the worst part
    of this bug — at minimum show why sending is blocked.

Relationship to #37401 — please note, this looks like a DIFFERENT failure mode

#37401 describes sends timing out after opening the Plugins page, and states that a full app
restart restores sending. What we report here differs on both points:

#37401 This report
Trigger Opening the Plugins page A turn's sampling stream dying mid-flight
Does a full restart help? Yes No — the gate never clears
Local mitigation — [features] plugins = false already applied; does not help

We have already applied the workaround discussed in #37401's thread — [features] plugins = false
in config.toml, plus physically moving .codex/.tmp/plugins aside (180 plugin directories).
The failure still reproduces, which indicates the path reported here is independent of
plugin-discovery / app-server queue saturation. It is a purely client-side send-gating issue.

(Unrelated observation, present on both old and new builds, so not the cause:
codex_mcp::rmcp_client server_name="node_repl" MCP server startup failed,
error 系统找不到指定的路径。(os error 3) on 26.915.3509.0 — was os error 267 on older builds.)

Happy to provide filtered log excerpts (error / retry / request-timeline lines only — any
conversation content will be stripped before sharing) or additional instrumentation you need.

Activity

  1. added
    bug
    app
    windows-os
    session
    connectivity
    on Sep 18, 2026
  2. zhengfei303101-cmyk commented on Sep 18, 2026

    @zhengfei303101-cmyk
    Author

    Follow-up after deeper local forensics — correcting part of my original root-cause claim

    1. Retry exhaustion does terminalize the turn — my original claim was wrong

    My original report attributed the orphaned inProgress row to retry exhaustion emitting no terminal
    signal. The retained log does not support that. codex-rs/core does emit a terminal turn error on
    these paths — 9 occurrences on this machine, e.g.:

    INFO codex_core::session::turn  ... run_turn: Turn error: Selected model is at capacity. Please try a different model.
    INFO codex_core::session::turn  ... run_turn: Turn error: You've hit your usage limit. Upgrade to Pro ...
    

    So "retries exhausted → no terminal event" is not the mechanism here, and the comment above suggesting
    that boundary be tested separately from the renderer gate is correct. Thanks for the pointer.

    2. What the two orphaned turns actually look like

    thread_history_1.sqlite::thread_turns currently holds, across all threads:

    completed    2140
    interrupted   119
    failed         36
    inProgress      2   <-- orphaned
    

    Filtering the retained app-server log by each orphaned turn_id:

    turn_id last log line for that turn last event process lifetime
    01a09f39-9525-… 09-14 17:23:58 Output item item_type="custom_tool_call" process log runs 17:20:57 → 17:24:03 (one unrelated account/read 5 s after the turn's last line, then nothing)
    01a0a5e6-ff35-… 09-16 00:36:11 codex_core::tools::parallel / feedback_tags process log runs 09-15 22:18:57 → 00:36:11 — the turn's last line is the process's last line

    Both turns end with ordinary in-flight stream output. Neither has a Turn error, turn/completed,
    interrupt received, or op.dispatch.shutdown entry — and those do appear normally elsewhere in the
    same log (the abort path logs interrupt received: abort current task / aborting running task, and
    interrupted rows do get written). Nothing in the retained log reconciles either row to a terminal state.

    3. Revised trigger

    The two orphaned rows coincide with an abrupt termination of the app-server process while a turn was
    in flight
    (no shutdown sequence logged; whether that termination was a close, a kill, or a crash is
    not determinable from the log alone). On the next start, a new process reopens the thread, but the
    inProgress row is left as-is.

    So I would now separate the defect into two layers rather than one:

    1. Persistence / reconciliation (origin): a turn that is in flight when the sidecar stops is never
      terminalized, and is never reconciled on the next start → permanently inProgress.
    2. Renderer gate (amplifier): canSend() ranks latestTurn.status === 'inProgress' above the
      conversationNeedsResume bypass, so that stale row makes the conversation unable to send again,
      including after a full restart. Still byte-identical in 26.915.3509.0, so the amplifier is unchanged
      in the current build.

    I'm keeping the gate section of the original report, but demoting it from "origin" to "second layer".

    4. Re: the potential duplicates

    5. Offered, not requested

    This machine reproduces on demand on 26.915.3509.0. If useful I can capture a fresh correlated set on
    a build you nominate — sidecar exit reason plus thread_turns state before and after — and post the
    filtered excerpt (conversation content stripped).

  3. SergeyNesterov-Azur commented on Sep 21, 2026

    @SergeyNesterov-Azur

    Same problem

  4. zhang452110549 commented on Sep 22, 2026

    @zhang452110549

    same problem

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

    appbugconnectivitysessionwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions