openai / openai/codex

[Regression][Remote Control] wait_threads rejects valid hostId until host discovery rehydrates the route

Open
#42,331 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app app-server bug remote
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?
  1. Keep an existing Codex task on a connected Remote Control host; it may be idle with a completed turn.
  2. Call list_threads and record its exact threadId and hostId=remote-control:<redacted>.
  3. Call read_thread with those exact values. It succeeds and returns the task and completed turn.
  4. Call wait_threads with the same values and a previously returned cursor.
  5. Observe an immediate 'No Codex thread found' routing failure.
  6. Call wait_threads with the same threadId and cursor but omit hostId.
  7. It succeeds and returns the same task with the expected remote host, completed turn, result metadata and next cursor.
  8. Repeat the explicit-host call. It can now succeed without any task, host, network, account or configuration change.
What is the expected behavior?
  • A hostId returned by list_threads and accepted by read_thread should be accepted deterministically by wait_threads.
  • Omitting hostId should 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 local routing must not override an explicit Remote Control host.
Additional information

Environment

  • Controller: ChatGPT Desktop 26.831.21537, build 7579
  • 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_threads handler 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.