codex - 💡(How to fix) Fix Desktop: first turn sometimes shows "Reconnecting... 2/5" even though app-server transport remains connected [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#18471Fetched 2026-04-19 15:12:44
View on GitHub
Comments
2
Participants
3
Timeline
9
Reactions
0
Timeline (top)
labeled ×5commented ×2unlabeled ×2

In Codex Desktop on Windows, the first message in a newly created conversation sometimes shows:

Reconnecting... 2/5, 3/5, 4/5, 5/5

However, the local desktop logs suggest this is not always a real transport reconnect. In the failing case below, the app-server transport stayed connected, and the problem looked more like a conversation/turn state sync race:

  • client receives turn/started for an unknown conversation
  • then repeatedly reports No turns for conversation
  • UI surfaces this as Reconnecting...

This makes the issue look like a model/network reconnect, but the underlying failure appears to be conversation state initialization on the first turn.

Root Cause

In Codex Desktop on Windows, the first message in a newly created conversation sometimes shows:

Reconnecting... 2/5, 3/5, 4/5, 5/5

However, the local desktop logs suggest this is not always a real transport reconnect. In the failing case below, the app-server transport stayed connected, and the problem looked more like a conversation/turn state sync race:

  • client receives turn/started for an unknown conversation
  • then repeatedly reports No turns for conversation
  • UI surfaces this as Reconnecting...

This makes the issue look like a model/network reconnect, but the underlying failure appears to be conversation state initialization on the first turn.

RAW_BUFFERClick to expand / collapse

Summary

In Codex Desktop on Windows, the first message in a newly created conversation sometimes shows:

Reconnecting... 2/5, 3/5, 4/5, 5/5

However, the local desktop logs suggest this is not always a real transport reconnect. In the failing case below, the app-server transport stayed connected, and the problem looked more like a conversation/turn state sync race:

  • client receives turn/started for an unknown conversation
  • then repeatedly reports No turns for conversation
  • UI surfaces this as Reconnecting...

This makes the issue look like a model/network reconnect, but the underlying failure appears to be conversation state initialization on the first turn.

Environment

  • OS: Windows
  • App: Codex Desktop
  • Desktop package version seen in logs: 26.415.4139.0
  • CLI/app-server version seen in logs: 0.122.0-alpha.1

Minimal Reproduction

  1. Launch Codex Desktop on Windows.
  2. Open or create a fresh conversation.
  3. Send the first message in that conversation.
  4. Observe that the UI may show:
    • Reconnecting... 2/5
    • Reconnecting... 3/5
    • etc.

This seems more likely on the first turn of a newly created conversation than on later turns in the same thread.

Expected Behavior

  • The first turn in a new conversation should start streaming normally.
  • If the underlying issue is conversation initialization rather than transport loss, the UI should not display a reconnecting state.

Actual Behavior

  • UI shows Reconnecting... N/5.
  • The turn may still eventually proceed, but the user sees what looks like a transport failure.
  • Desktop logs show conversation-state errors rather than a clean transport disconnect/reconnect cycle.

Key Evidence

1. Transport appears to initialize and remain connected

From the desktop log:

  • app_server_connection.state_changed ... next=connecting
  • initialize_handshake_result ... outcome=success
  • app_server_connection.state_changed ... next=connected

This suggests the app-server transport successfully initialized.

2. First-turn state race symptoms

During the timeframe matching the UI reconnecting behavior, the log shows:

  • Received turn/started for unknown conversation
  • followed by thread/read
  • followed by repeated No turns for conversation

This strongly suggests the client receives turn events before the local conversation state is ready.

3. UI likely maps this state failure to reconnecting

The user-facing UI showed reconnect attempts, but the log did not show a fresh app-server state transition from connected -> disconnected -> reconnecting at that same moment.

Relevant Log Excerpts

Log file: C:\Users\Think\AppData\Local\Packages\OpenAI.Codex_2p2nqsd0c76g0\LocalCache\Local\Codex\Logs\2026\04\18\codex-desktop-40ba8e35-9737-40fa-9cea-d938935f4635-10792-t0-i1-072620-0.log

Startup / connected:

  • line 4: app-server state changed to connecting
  • line 13: initialize_handshake_result ... outcome=success
  • line 15: app-server state changed to connected

First-turn failure pattern:

  • line 3810: Received turn/started for unknown conversation conversationId=019da05c-a16c-7bb2-8526-9a32097ba214
  • line 3811: response_routed ... method=thread/read ... conversationId=019da05c-a16c-7bb2-8526-9a32097ba214
  • line 3816+: repeated No turns for conversation conversationId=019da05c-a16c-7bb2-8526-9a32097ba214

A second similar case happens immediately after:

  • line 3941: Received turn/started for unknown conversation conversationId=019da05f-447e-7941-98ec-ffce9ac2bb3d
  • line 3942: response_routed ... method=thread/read ... conversationId=019da05f-447e-7941-98ec-ffce9ac2bb3d
  • line 3943+: repeated No turns for conversation conversationId=019da05f-447e-7941-98ec-ffce9ac2bb3d

Interpretation

This looks like a race between:

  • conversation creation / local state hydration
  • incoming turn/started events

The UI may be treating this as a reconnect-worthy failure, even when the underlying transport is still healthy.

Additional Note

I also saw a separate earlier log entry on the same date where analytics/event traffic hit a 403 Forbidden Cloudflare challenge page. That may indicate an independent network/environment issue, but it does not appear to be the primary cause of this specific first-turn reconnecting symptom.

Possible Fix Direction

  • Delay handling of turn/started until conversation state is guaranteed present locally, or
  • buffer unknown-conversation turn events briefly and retry state resolution before surfacing reconnect UI, or
  • distinguish transport reconnect from conversation-state hydration failure in UI messaging.

extent analysis

TL;DR

Delay handling of turn/started events until conversation state is guaranteed to be present locally to prevent the UI from showing a reconnecting state due to conversation state initialization issues.

Guidance

  • Investigate the possibility of delaying the handling of turn/started events until the conversation state is fully initialized locally to prevent the race condition.
  • Consider buffering unknown-conversation turn events briefly and retrying state resolution before surfacing reconnect UI to handle cases where the conversation state is not yet available.
  • Review the UI messaging to distinguish between transport reconnect and conversation-state hydration failure to provide more accurate user feedback.
  • Analyze the logs to confirm that the issue is indeed caused by the conversation state initialization and not by any underlying transport issues.

Example

No code example is provided as the issue seems to be related to the logic of handling turn/started events and conversation state initialization, which requires a deeper understanding of the application's architecture and codebase.

Notes

The provided log excerpts suggest that the issue is related to the conversation state initialization, but further investigation is needed to confirm the root cause and to determine the best approach to fix the issue. Additionally, the separate log entry mentioning a 403 Forbidden Cloudflare challenge page may indicate an independent network/environment issue that should be investigated separately.

Recommendation

Apply a workaround by delaying the handling of turn/started events until conversation state is guaranteed to be present locally, as this seems to be the most likely cause of the issue and can help prevent the UI from showing a reconnecting state due to conversation state initialization issues.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Desktop: first turn sometimes shows "Reconnecting... 2/5" even though app-server transport remains connected [2 comments, 3 participants]