[Regression][Remote Control] wait_threads rejects valid hostId until host discovery rehydrates the route
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What version of the Codex App are you using (From “About Codex” dialog)?
26.831.21537 (build 7579)
What subscription do you have?
ChatGPT Pro 20x
What platform is your computer?
Controller: Darwin 25.6.0 arm64; target: Windows development host with a WSL-backed Codex task via Desktop Remote Control
What issue are you seeing?
Summary
codex_app.wait_threads can reject a valid Remote Control hostId while list_threads and read_thread resolve the same task through that exact host. Calling wait_threads once without hostId discovers the correct route; afterward the previously failing explicit-host call can work again.
This looks like a transient remote route-registry or hydration inconsistency, not task loss or failed remote execution.
Actual behavior
Errors include:
No Codex thread found for threadId: <redacted>.
Hosts without a readable match: local
On another occurrence the unreadable-host list contained both local and the exact Remote Control host, even though the task had just been readable. The task remained present and executed normally.
Impact
This breaks unattended orchestration. A coordinator can miss a completed result or stall while waiting for route hydration. Blindly retrying effectful work risks duplicate delivery, so safe coordinators must stop and reconcile state.
What steps can reproduce the bug?
- Keep an existing Codex task on a connected Remote Control host; it may be idle with a completed turn.
- Call
list_threadsand record its exactthreadIdandhostId=remote-control:<redacted>. - Call
read_threadwith those exact values. It succeeds and returns the task and completed turn. - Call
wait_threadswith the same values and a previously returned cursor. - Observe an immediate 'No Codex thread found' routing failure.
- Call
wait_threadswith the samethreadIdand cursor but omithostId. - It succeeds and returns the same task with the expected remote host, completed turn, result metadata and next cursor.
- Repeat the explicit-host call. It can now succeed without any task, host, network, account or configuration change.
What is the expected behavior?
- A
hostIdreturned bylist_threadsand accepted byread_threadshould be accepted deterministically bywait_threads. - Omitting
hostIdshould not be required to initialize or repair the route. - Temporary route unavailability should return a structured recoverable host error, not report that the task does not exist.
- Cached
localrouting must not override an explicit Remote Control host.
Additional information
Environment
- Controller: ChatGPT Desktop
26.831.21537, build7579 - CLI visible on controller:
codex-cli 0.152.1 - Controller OS: Darwin
25.6.0, Apple Silicon (arm64) - Target: Windows development host with a WSL-backed Codex task via Desktop Remote Control
- Both devices use the same ChatGPT account and workspace
- First observed on 2026-09-02 UTC
All task IDs, host environment IDs, repository names, paths, prompts and user data are redacted.
Workaround
Call wait_threads without hostId for discovery, accept only an exact returned thread/host match, then use read_thread with the explicit host. Never blindly resend effectful work when discovery is missing or mismatched.
Related issues
- #40105 -
wait_threadshandler unavailable while list/read/send remain healthy - #41295 - orchestration breaks after remote reconnect
- #36969 - Remote Control route loses or rebases source host
- #41419 - inconsistent Remote Control thread discovery
- #40014 - completed turn visible while task tools return empty items
This reproduction is narrower: the handler is present, the explicit host remains valid through other tools, and an unscoped discovery call makes the explicit-host wait route recover.
Exact redacted timestamps and private task/host identifiers can be provided to OpenAI maintainers if needed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the wait_threads handler and trace explicit hostId route resolution, comparing it with the list_threads and read_thread paths described in the reproduction. Verify the behavior using the listed sequence and ensure completion means a valid host returned by list_threads and accepted by read_thread is handled deterministically by wait_threads, with temporary route failures distinguishable from missing threads.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend-api-design, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100