Review live query keeps polling deleted managed worktrees until app restart

Open 💬 1 comment Opened Aug 12, 2026 by ItsColby

What version of the Codex App are you using?

26.803.5235.0

What platform is your computer?

Microsoft Windows NT 10.0.19045.0 x64

What issue are you seeing?

I was investigating a period when my desktop had become severely sluggish and found Codex App repeatedly checking two managed-worktree paths that no longer existed.

For example, I expected a worktree’s review activity to stop after the directory was removed. Instead, the logs continued recording failed Git status operations for that path until I restarted the app:

source=review_model
requestKind=subscribe-live-query
failureReason=wait_failed
cwd=C:/Users/<user>/.codex/worktrees/<id>/<repo>

From 2026-08-10 16:26:46Z through 17:35:13Z, the logs contained 5,591 such failures:

  • Worktree f0f3: 4,044
  • Worktree fb4a: 1,547

Both directories were absent when checked. Restarting Codex App stopped the activity, and it did not recur during the subsequent observation period.

The failed operations coincided with severe Windows UI and cursor lag. I have not established that this loop caused every responsiveness problem during that period, but thousands of operations against deleted paths are unexpected background work.

What steps can reproduce the bug?

I do not yet have a deterministic clean reproduction. The observed sequence was:

  1. Use Codex tasks backed by managed worktrees.
  2. Allow review-related live queries to run.
  3. The managed-worktree directories are subsequently removed. I did not capture the precise removal transition during this incident.
  4. Leave Codex App running.
  5. Inspect the Desktop logs and observe continuing source=review_model, requestKind=subscribe-live-query Git operations against the missing paths.
  6. Restart Codex App and observe that the operations stop.

This was observed for two separate managed-worktree paths during one app session.

What is the expected behavior?

Removing a managed worktree should also remove any review live-query subscription associated with its path. If one query races with deletion, the missing-path result should terminate or suspend that subscription instead of continuing indefinitely.

Additional information

Related reports cover neighboring failure modes but not this exact lifecycle:

  • #30820 covers review_model work against restored existing repositories.
  • #32113 covers scans of saved but inactive valid repositories.
  • #34473 covers retries while resolving malformed Git roots.
  • #33401 covers processes retaining a removed managed-worktree directory.

This report is specifically about a subscribe-live-query subscription retaining paths after the managed worktrees themselves no longer exist.

Maintainer question: Is managed-worktree removal expected to unregister every review live-query subscription associated with that path?

No /feedback ID was captured during the incident. I can provide additional sanitized log excerpts if useful.

View original on GitHub ↗

1 Comment

demyte · 12 days ago

Codex Desktop runaway live query against a deleted managed worktree

Canonical issue: https://github.com/openai/codex/issues/38109

Environment

  • Codex App: 26.803.10989.0
  • Platform: Microsoft Windows NT 10.0.28120.0 x64
  • CPU: Intel Core i9-14900K, 24 cores / 32 logical processors
  • RAM: 64 GB
  • Managed worktrees are located under D:\.codex\worktrees

Impact

Codex Desktop entered a focus-sensitive runaway state after a managed worktree was deleted:

  • With the Codex window focused, the machine fans immediately ran hard.
  • Minimizing Codex made the machine quiet almost immediately.
  • Live measurement while affected showed the bundled codex.exe app-server reading approximately 165-190 MB/s and using approximately 1.5 CPU cores. The main ChatGPT/Codex UI process was separately using about two CPU cores.
  • Windows process counters accumulated approximately 65.7 TB read I/O on the main UI process and 686 GB read I/O on the app-server process during the app lifetime. These are cumulative Windows I/O counters and can include cached I/O, but the live 165-190 MB/s read rate independently confirms sustained churn.
  • The local Codex profile occupied approximately 15 GB on C:, despite managed worktrees being located on D:. This included 5.9 GB of archived sessions, 2.3 GB of active session JSONL, and a 656 MB logs_2.sqlite database. This storage is contextual evidence, not all attributed to this one loop.
flowchart LR
    A["Managed-worktree task completes"] --> B["Worktree is deleted"]
    B --> C["Stale local conversation/review subscription remains"]
    C --> D["git status fails against missing path"]
    D -->|"retry every second"| C
    D --> E["134,436 log events"]
    C --> F["Focused window: 165-190 MB/s reads and sustained CPU"]
    G["Window minimized"] --> H["Load drops almost immediately"]

Direct evidence

The affected deleted managed worktree was:

D:\.codex\worktrees\6b18\main

The directory no longer exists. The primary task/session associated with it is:

019ff8f0-e007-7f63-97d9-d9e87461ebd5

The task completed its teardown and reported ReadyForWorktreeDeletion. Three completed child review sessions also retained the same worktree path:

019ff942-d9e3-77b1-8b88-1b6e26bc192e
019ff943-24fc-7a60-a4c8-cf12419e448b
019ff98a-e888-7a71-b898-2c0a831436fa

Across Desktop logs from 13-16 August, the deleted worktree appeared in 134,436 log events. The dominant event was a failed Git status command retried approximately once per second:

[git] git.command.complete
command="git ... status ... -- '?/D:/.codex/worktrees/6b18'"
cwd=D:/.codex/worktrees/6b18/main
failureReason=wait_failed
requestKind=subscribe-live-query
source=local_conversation_thread
success=false

The logs also show Windows path normalization failures immediately before/around this lifecycle:

method=fs/watch
error="Invalid request: AbsolutePathBuf deserialized without a base path"
path=/D:/.codex/worktrees/6b18/main/D:.codex/worktrees/6b18/main/...

The doubled/malformed path and the Git path argument beginning with '?/D: suggest a Windows \\?\ long-path prefix is being normalized incorrectly somewhere in the Desktop watcher/live-query path.

Reproduction sequence

  1. Create/use a Codex task backed by a managed Windows worktree on D:\.codex\worktrees.
  2. Allow local conversation and/or review live queries to subscribe to that worktree.
  3. Complete the task teardown and delete the managed worktree.
  4. Leave Codex Desktop running with the completed task retained in local task state.
  5. Focus the main Codex window.
  6. Observe sustained CPU, high read I/O, fan noise, and once-per-second git status failures against the deleted path.
  7. Minimize the Codex window and observe that the load drops almost immediately.

Expected behavior

  • A missing managed worktree must be a terminal state for its Git live query.
  • Deleting or archiving a worktree-backed task must unsubscribe local_conversation_thread and review subscriptions for that path.
  • Completed/unloaded child review sessions must not keep a deleted worktree active.
  • Windows long-path prefixes must round-trip without becoming '?/D: or duplicated /D:/.../D:... paths.
  • Transient failures should use bounded exponential backoff rather than an unbounded one-second retry.
  • Focusing the Desktop window must not activate expensive history or repository polling for inactive tasks.

Suggested regression coverage

  1. Subscribe both local_conversation_thread and review_model to a managed Windows worktree.
  2. Delete the worktree while the app remains open.
  3. Assert the subscription is removed after the first permanent missing-path result.
  4. Assert no further Git child processes are spawned for that path.
  5. Repeat with a \\?\D:\... worktree path and completed child review sessions.
  6. Assert focus/minimize transitions do not change background polling for inactive tasks.

Local evidence retained

  • codex-runaway-process-io.png - process CPU, memory and cumulative I/O counters
  • codex-profile-storage.png - local .codex profile size

No credentials, API keys, prompt contents, financial data, or repository source code are included.