Android Remote fails during thread/list when unbounded previews make the first response ~259 KB
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)?
- Microsoft Store package:
OpenAI.Codex 26.818.2441.0 - Desktop client version observed in logs:
26.818.21641 - Bundled CLI/app-server:
codex-cli 0.148.0-alpha.21 - ChatGPT Android:
1.2026.223
What subscription do you have?
Not captured in the local diagnostics. Pairing and the Remote relay both authenticated successfully.
What platform is your computer?
Host:
Microsoft Windows NT 10.0.26200.0 x64
Remote client:
- Android 14
- moto g power 5G - 2023
What issue are you seeing?
Android Remote paired successfully with the Windows host, but repeatedly cycled through Looking for ChatGPT desktop → Reconnecting → Failed to connect.
The desktop Remote WebSocket was connected and a fresh revoke/re-pair completed successfully. The failure began after the remote connection received initialize and then requested thread/list. The request never completed over Remote, even though the identical call completed locally in about 1.5–2.0 seconds.
A controlled before/after test isolated the active thread-list payload as the trigger:
| Case | thread/list path |
100-item response | Largest preview | Local time | Android Remote |
|---|---|---|---|---|---|
| Before workaround | default scan/reconcile | 258,954 bytes | 13,810 bytes | ~1.5–2.0 s | fails/reconnects |
| Control | useStateDbOnly: true |
97,319 bytes | ~512 chars | ~0.02 s | local control only |
| After workaround | default scan/reconcile | 90,054 bytes | 391 bytes | ~1.9 s | connects |
The active profile contained 162 unarchived vscode threads. Twenty-seven had first user messages longer than 512 characters; many were handoff prompts between 8,437 and 13,796 characters.
The state DB already held bounded cached previews, but default thread/list ignored those values while scanning/reconciling rollout JSONL and returned the full first user message as Thread.preview. Migrating one rollout to paginated history did not change that default list behavior.
Using the supported thread/archive API to archive those 27 long-preview threads reduced the same default 100-item response from 258,954 to 90,054 bytes. After toggling Remote off/on, the already-paired Android device connected immediately and successfully sent a message to the desktop task.
This A/B result strongly indicates an unhandled Remote payload-size/envelope boundary combined with unbounded list previews. The exact transport threshold was not established.
Sanitized host sequence from a failing attempt:
remote connection: initialize
remote connection: thread/list
(no response delivered; request remains open)
subsequent retry: initialize -> client disconnect
There was one desktop app-server process, the relay connection was healthy, and both Codex state databases passed integrity checks. Restarting Windows, revoking/re-pairing the phone, and toggling Remote did not fix the problem while the large list payload remained.
What steps can reproduce the bug?
- On a desktop Remote host, retain enough active threads that the first page includes many large first user messages. In this case, 27 threads began with 8–14 KB handoff prompts.
- Confirm that default
thread/listwithlimit: 100andsourceKinds: ["vscode"]returns a response around 259 KB, with full first messages mapped intopreview. - Enable Remote and pair ChatGPT Android.
- Attempt to connect. Observe that
initializesucceeds,thread/listis received by the host, and the phone then reconnects/fails. - Bound the previews or archive enough long-preview threads so the default response is around 90 KB.
- Toggle Remote off/on and retry from the same paired phone.
- Observe that Remote connects and can send messages.
A useful implementation-level regression test would send a thread/list result larger than the Remote envelope limit and verify that it is chunked/paged or rejected explicitly instead of silently leaving the client in a reconnect loop.
What is the expected behavior?
- Long initial prompts should not prevent Android Remote from connecting.
thread/listshould send a bounded display preview rather than the complete first user message.- The Remote initial list could use the bounded state-DB representation, request
useStateDbOnly: true, or chunk/page the response. - If a transport limit is exceeded, the host/client should receive a clear error and the outstanding request should be cancelled rather than silently stalling.
Additional information
Related, but not exact duplicates:
- #39815 tracks the same-day Windows/Android symptom cluster; this result replaces the earlier service/handshake hypotheses for this particular host with a reproducible local data-volume trigger.
- #36416 is the same initial
thread/liststage, but its failure is a 26–57 second rollout scan timeout. Here, the default call completed locally in about 2 seconds and payload size was the changing variable. - #36423 reports a Remote envelope failure for oversized
thread/read; this may be the same transport/error-handling family at a different endpoint. - #21211 already documents that
first_user_messagecan makethread/listpreviews unbounded.
No account, device, server, environment, installation, or pairing identifiers are included. Raw logs are not attached because nearby headers contain authentication material; sanitized excerpts can be provided.
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 Remote initialize/thread/list entry points and the thread/list preview path; compare default scanning with useStateDbOnly: true using the 100-item reproduction. Add a regression test with an oversized thread/list result and verify that previews are bounded or the request fails clearly and is cancelled instead of stalling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, rust
- Domain
- api, backend, mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100