Skip to content

[Windows] Threads stuck on "Waiting for worktree setup…", app auto-quits: projector rejects own token_count record (invalid type: map, expected f64) and cursor desyncs (expected ordinal 10, got 11) #42794

Open

Description

@zx2021210538

What version of the Codex App are you using?

  • Codex Desktop 26.901.4073.0 (Microsoft Store MSIX), native Windows x64 (build 10.0.26200), PowerShell as default shell
  • Bundled app-server: codex-cli 0.145.0-alpha.18

What subscription do you have?

Plus

What issue are you seeing?

Since updating to 26.901.4073.0, new threads intermittently get stuck forever on "Waiting for worktree setup…" / "Starting your task" even when the run target is Local, and sometimes the app closes itself without any crash report. The stuck state is thread-correlated (first conversation may work, a later one sticks; sometimes the very first one sticks) and survives app restarts.

Observable symptoms, all verified from ~/.codex/logs_2.sqlite, state_5.sqlite and the rollout file:

  1. The composer is disabled and the user_input never reaches the app_server. The stuck thread exists only as an empty shell: a threads row with has_user_event=0, model=NULL, and no rollout file written. So this is not the model/backend being slow — the UI state machine refuses to dispatch the message.

  2. The paginated history projector rejects the thread's own token_count record, then the projection cursor desyncs and every later record is rejected too:

    [codex_thread_store::local::thread_history_materialization] WARN
    skipping rejected rollout line while projecting
    "C:\Users\<me>\.codex\sessions\2026\09\04\rollout-2026-09-04T23-25-24-01a06d06-....jsonl":
    invalid type: map, expected f64 at line 1 column 846
    

    The rejected line is ordinal=10, type=event_msg, payload.type=token_count, exactly 846 bytes (so the reported column points at end-of-line). It contains the new rate_limits structure written by this same build:

    "rate_limits":{"limit_id":"codex","limit_name":null,"primary":{"used_percent":20.0,"window_minutes":300,"resets_at":1788544770},"secondary":{"used_percent":3.0,"window_minutes":10080,"resets_at":1789131570},"credits":{"has_credits":false,"unlimited":false,"balance":"0"},"individual_limit":null,"spend_control_reached":null,"plan_type":"plus","rate_limit_reached_type":null}

    All 12 lines of the rollout parse as valid JSON independently — the file is not corrupt; the projector schema just doesn't match what the writer produces.

  3. After the rejection the projection cursor desyncs and the turn can never be persisted:

    [codex_thread_store::local::live_writer] WARN
    failed to project durable rollout for 01a06d06-...: thread-store internal error:
    thread history projection for 01a06d06-... expected ordinal 10, got 11
    

    The following task_complete (ordinal 11) is rejected as well, so the turn never materializes even though the model call itself completed fine (token usage 22672 in / 12 out is logged).

  4. While stuck, the app_server log floods with app/list → app/list/updated (targeted_connections=0) plus a new codex_http_client::custom_ca HTTP client per request, hundreds of times per minute. Eventually the app_server process terminates silently (no Windows Application Error, no WER crash entry, no panic in logs — only generic MoAppHang AppHang reports for the UI earlier in the day), and the desktop window closes by itself.

  5. Enabling/disabling user MCP servers changes the timing/probability but not whether it happens: it reproduced with all user MCP servers enabled, with only one enabled, and with all of them disabled.

Steps to reproduce

Not fully deterministic, but it reproduced many times within a single day on this build:

  1. Codex Desktop 26.901.4073.0 on Windows, PowerShell shell (note: every thread logs Failed to create shell snapshot for powershell: Shell snapshot not supported yet for PowerShell).
  2. Start new conversations (target = Local) and send short messages.
  3. Intermittently, a thread sticks on "Waiting for worktree setup…". The stuck thread's rollout is either missing or contains a token_count record that the projector rejects with invalid type: map, expected f64, followed by expected ordinal 10, got 11 for the rest of the session.
  4. After minutes the app either recovers the stuck turn or the app_server dies silently and the window closes.

Expected behavior

The paginated history projector should tolerate volatile telemetry fields written by its own writer (e.g. rate_limits), and the projection cursor should resynchronize after a rejected record instead of rejecting all subsequent records including task_complete.

Suggested fix

Related issues

Happy to provide the full 12-line minimal rollout sample and additional log excerpts if useful.

Activity

  1. added
    bugSomething isn't working
    appIssues related to the Codex desktop app
    windows-osIssues related to Codex on Windows systems
    app-serverIssues involving app server protocol or interfaces
    rate-limitsIssues related to rate limits, quotas, and token usage reporting
    on Sep 4, 2026
  2. github-actions commented on Sep 4, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  3. 84dnnvbdvp-debug commented on Sep 4, 2026

    @84dnnvbdvp-debug

    Source history suggests this may be two already-fixed projector defects reappearing because the Desktop package is bundling an older app-server.

    The reported codex-cli 0.145.0-alpha.18 maps to rust-v0.145.0-alpha.18, tagged July 16. That version predates:

    • Preserve floating-point values when decoding rollout lines #38399 / 2bd8727 (Aug 13), which changed persisted rollout decoding specifically because nested floats inside flattened/internally-tagged records could fail under serde_json/arbitrary_precision. Its regression fixture is a token_count event with floating rate_limits.primary/secondary.used_percent, i.e. the same record family here.
    • Keep SQLite history projection moving past invalid records #42369 / 095ac4f (Sep 2), which changed thread-history projection so an unknown/invalid record advances the byte checkpoint and a later forward ordinal becomes a SkippedOrdinalRange instead of poisoning all subsequent projection. That directly addresses the expected ordinal 10, got 11 cascade.

    So I would first run the sanitized 12-line rollout through current main (or another build known to include both commits) before adding a new rate_limits-specific deserializer. If it projects cleanly there, the useful boundary is likely Desktop packaging/version skew: the Sept 4 app is shipping an app-server old enough to miss both fixes. If it still fails on current source, then the exact current record is a new compatibility case worth isolating.

    A regression for the Desktop packaging path could assert that the bundled app-server can project a token_count record with the current structured rate_limits payload and continue through the following task_complete ordinal.

  4. nt49949390 commented on Sep 6, 2026

    @nt49949390

    I'm experiencing the same issue on Windows with Codex version 26.901.4073.0.

    Codex gets stuck on “Starting your task” and never proceeds. Restarting the Codex app does not resolve the issue.

    This appears to be the same behavior described in this issue.

    Windows 11
    Codex version: 26.901.4073.0

  5. divyanshj16 commented on Sep 6, 2026

    @divyanshj16

    I am also getting this issue on the codex app via vscode. Is there any workaround?

  6. Demimonde5000 commented on Sep 13, 2026

    @Demimonde5000

    I’m experiencing similar symptoms on Windows app version 26.908.4834.0 with ChatGPT Pro.

    Work locally hangs indefinitely at “Starting your task,” even for “hello.” Navigating away causes the new chat to disappear. This happens in two projects and outside projects. Codex also fails to respond.

    Cloud Work works outside the affected project, but Cloud is greyed out within that project.

    Closing/reopening the app and using Windows’ Repair option did not resolve the problem.

    I submitted diagnostic feedback:
    no-active-thread-01a09cc6-985e-7982-9f35-17648796315a

    Could you check whether the submitted logs indicate the same startup issue?

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

    appIssues related to the Codex desktop appapp-serverIssues involving app server protocol or interfacesbugSomething isn't workingrate-limitsIssues related to rate limits, quotas, and token usage reportingwindows-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