Skip to content

Android Remote fails during thread/list when unbounded previews make the first response ~259 KB #39860

Open

Description

@FreeLuna2

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?

  1. 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.
  2. Confirm that default thread/list with limit: 100 and sourceKinds: ["vscode"] returns a response around 259 KB, with full first messages mapped into preview.
  3. Enable Remote and pair ChatGPT Android.
  4. Attempt to connect. Observe that initialize succeeds, thread/list is received by the host, and the phone then reconnects/fails.
  5. Bound the previews or archive enough long-preview threads so the default response is around 90 KB.
  6. Toggle Remote off/on and retry from the same paired phone.
  7. 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/list should 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:

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.

Activity

  1. added
    bug
    app
    app-server
    connectivity
    windows-os
    on Aug 21, 2026
  2. guzifer commented on Aug 21, 2026

    @guzifer

    Confirmed the same Android thread/list size regression on macOS, with an exact before/after workaround.

    Environment:

    • ChatGPT/Codex Desktop 26.818.31338 (build 6892), macOS Apple Silicon
    • bundled app-server 0.149.0-alpha.4
    • ChatGPT Android 1.2026.223, Android 16, SM-F7660

    Before workaround, local reproduction of the Remote-style first page (thread/list, limit: 100, sortKey: updated_at, descending) returned:

    • 95 active threads
    • 299,841 bytes
    • 131,159 preview characters
    • 36 previews longer than 512 characters
    • largest preview 15,577 characters

    Android could see/reach the paired host, but could not load even the task directory. Re-pairing, clearing app state, restarting Desktop, and restarting the app-server did not make this stable.

    I then archived (not deleted) older threads in two reversible steps. With only the 35 most recently updated threads left active, the same local response measured:

    • 35 active threads
    • 97,073 bytes
    • 31,115 preview characters

    After that reduction, Android immediately rendered the directory again. This isolates the directory outage to the first thread/list payload size, not pairing, Wi-Fi/5G, host sleep, or authentication.

    There is still a separate second-stage failure when Android opens large paginated tasks. That appears to match #38653 / #38023: the directory works, but conversation hydration does not. A small two-turn paginated control task opens fully.

    A durable fix should apply both a count limit and a byte/preview limit to Remote thread/list; ideally it should use bounded state-DB previews and page the result instead of returning full first-message handoff prompts.

  3. charles1w commented on Sep 10, 2026

    @charles1w

    Related finding at the same initial task-list step: on app-server 0.153.4, the host can also spend too long reading large helper-agent histories before excluding them from the list. In our controlled test, ordinary listing exceeded 25 seconds; early exclusion returned the same 50 tasks in 1.15 seconds (indexed listing: 27 ms).

    A history-preserving scan workaround restored task loading on the phone. Detailed evidence, workaround and recommendations; earlier scan-timeout report: #36416.

    This adds a processing-time problem alongside the response-size problem measured here. Both support using the bounded task index; our result does not establish a shared transport-size threshold.

  4. aimpugn commented on Oct 14, 2026

    @aimpugn

    Additional macOS reproduction on 2026-10-15 KST. The paired Android device remains at “Looking for ChatGPT desktop” / “Connecting…” after reinstalling both apps, updating desktop, signing out/in, and switching Wi-Fi ↔ mobile data. The host receives the remote client's initialize and thread/list requests, but the mobile chat directory does not load.

    Environment: ChatGPT desktop 26.1007.71326 (build 20398), bundled codex-cli 0.162.0-alpha.17.2. Android app version was not captured.

    Read-only local reproduction using the bundled app-server:

    • thread/list with limit: 100, sortKey: "updated_at", sourceKinds: ["vscode"]: 100 chats, 15,463,346 response bytes, 20.15 seconds. Preview text totaled 9,528,728 characters; largest preview was 434,428 characters.
    • The same request with useStateDbOnly: true: 100 chats, 15,626,059 response bytes, 0.174 seconds. On this profile, the state DB's cached previews are also unbounded, so DB-only improves query time but does not bound the response size.
    • The profile has 819 unarchived vscode chats; 610 cached previews exceed 512 characters.

    This is consistent with the issue's initial-list failure, but the Android transport threshold and root cause remain unproven. No raw logs, host identifiers, account details, or conversation content are included.

    Timeline clarification (updated): The user now recalls, with uncertainty, that this same Android-to-Mac connection last loaded normally before October 8. A failure was reported on October 9 and again on October 12, before the latest desktop update. Current read-only metadata shows that 14 still-active chats created on October 8 have about 5.09 million preview characters in total; 11 created on October 5 have about 2.77 million. Large previews also predated October 5. These figures are not exact historical thread/list responses, and we do not know whether the Android client or relay changed during that interval. The timing makes list growth plausible, but it does not establish a payload threshold or root cause.

    Controlled recovery observation (October 15 KST): With the user's permission, we archived only the 14 unpinned October 8 diagnostic chats (about 5.09 million cached preview characters); all other chats remained unchanged, and all 14 original rollout files still exist. The user then fully closed and reopened Android ChatGPT. The Mac chat list loaded normally, and the user opened one Mac chat and read its messages successfully. This is a positive mobile end-to-end result for this limited change; the 14 chats remain archived. It does not by itself prove an exact payload threshold or exclude a concurrent client/relay recovery, though prior app restarts/reinstalls and network changes had not resolved the symptom.

  5. Ktokum commented on Oct 30, 2026

    @Ktokum

    Additional Windows 11 + ChatGPT Android reproduction on 2026-10-31 JST, with read-only host evidence and independent app-server JSON-RPC measurements.

    Versions / environment

    • Codex Desktop (Windows MSIX): 26.1021.3705.0; bundled app-server/CLI: 0.164.0-alpha.11.1.
    • ChatGPT Android: 1.2026.293, Android 15.
    • Local Codex state: 676 threads total; 674 unarchived after a single controlled test archive.
    • The host desktop app-server remained running with its original PID; the main Remote WebSocket did not disconnect in the two network test windows.

    Observed Android Remote behavior, correlated with the Windows host logs

    Test window (JST) Network initialize thread/list thread/resume logical connections closed median connection lifetime
    Oct 31 01:10–01:13 Mobile data 15 30 14 15 7 s (14 completed pairs)
    Oct 31 01:15–01:17 Wi-Fi 11 23 8 10 4 s (10 completed pairs)

    Both mobile and Wi-Fi exhibit approximately 5 logical disconnects/minute. The same existing thread was resumed in both tests; the host logs show composing running thread resume response. That proves host-side request receipt/response construction, not successful relay delivery or Android parsing.

    Measured JSON response sizes from a separate, no-auth, Remote-disabled app-server using a verified snapshot of these threads (same bundled binary; UTF-8 JSON-RPC response line size, not on-wire relay size):

    Read-only RPC Response bytes Elapsed
    thread/list normal scan, 25 most-recent vscode threads 65,108 171 ms
    thread/list normal scan, 50 threads 346,170 297 ms
    thread/list normal scan, 100 threads 1,097,360 461 ms
    thread/list useStateDbOnly=true, 100 threads 1,074,744 30.5 ms
    thread/resume for the thread opened on Android, excludeTurns=true 4,779 59 ms
    thread/resume default (full 3-turn history) 744,476 22 ms
    thread/turns/list summary of those 3 turns 11,741 15 ms

    The isolated snapshot's cached previews are themselves long, so useStateDbOnly helps latency but barely reduces payload size. In an in-memory what-if only, truncating each preview to 512 Unicode code points reduces the 100-thread JSON from 1,097,359 to 176,155 bytes; 256 code points reduces it to 135,517 bytes. No product files or user histories were edited.

    A single safe archive of a completed 1-turn diagnostic conversation was verified as the only archive-state change (original rollout SHA unchanged), but did not improve Android Remote: in equal 180-second windows, logical disconnects were 17 before vs. 23 after. This is not a controlled causal estimate and does not imply archiving caused deterioration. We have not archived additional threads.

    Important limits: Existing production logs identify RPC methods but do not record the actual Android thread/list parameters (limit, sourceKinds, useStateDbOnly), its actual response-byte count over the relay, whether Android sends excludeTurns, or relay send/ACK and Android parse/render outcomes. Therefore this strongly supports examining unbounded previews and hydration payloads, but does not establish a root cause or transport-size threshold. Some remote connections progressed past thread/list to thread/resume before disconnecting.

    Could maintainers correlate the production per-request method/parameters, response JSON size and completion, relay send/ACK/close reason, and Android receive/parse result under a single sanitized request/connection correlation ID? Separately bounding first-page list previews and default resume hydration would be worthwhile regression cases. Related to #39954 and #55005.

    No raw log, transcript, user IDs, host IDs, pairing tokens, local paths, or private data included.

  6. Ktokum commented on Oct 30, 2026

    @Ktokum

    Follow-up to my 2026-10-31 Windows/Android reproduction above: the Android Remote user now reports that previously visible older Codex chats display "Not found" after the Remote error/reconnect loop. The exact UI placement of the message has not yet been captured, so this is a user-visible symptom, not proof of a server-side 404.

    I immediately checked the live Windows Codex data against the independently verified pre-test snapshot, read-only:

    • 676 threads before / 676 now; zero removed or added.
    • All 676 corresponding rollout files still exist; SQLite PRAGMA quick_check = ok.
    • Archived count 1 → 2, solely the previously documented one-thread controlled archive; no other archive-state changes.
    • Both specifically affected existing test threads remain present and unarchived.
    • The desktop/app-server retained the same running process; no restart or user data repair was performed.

    The host logs around Oct 31 02:00–02:12 JST show a sustained initialize → thread/list → logical connection closed loop (approximately 67 initialize, 152 thread/list, 68 connection-close events in the retained time bins), with no thread/resume observed in that interval. The regular host log shows no explicit “thread not found” response to explain the UI message; it only exposes request method/lifecycle, not Android receipt or rendered UI state. Prior tests on Oct 31 01:10–01:17 did reach thread/resume, so the failure stage may shift between attempts.

    This distinguishes Android Remote discovery / client state / relay errors from actual Windows-local history loss. Please investigate how the client can render a “not found” state when the host index and rollout files remain intact, in addition to the suspected unbounded list/resume responses. A correlated diagnostic should identify the failed resource (host, project, thread, or list request), response status, and Android cache/relay generation. No account IDs, host identifiers, thread IDs, chat contents, raw logs, or local paths included.

  7. Ktokum commented on Oct 30, 2026

    @Ktokum

    Further controlled A/B result from 2026-10-31 02:16–02:20 JST (same Android Remote client/host, no app-server restart, no history edits):

    • User opened a short existing thread A (1 turn, 9 locally indexed items; independent same-version app-server default thread/resume JSON response 17,444 bytes) and still saw the same repeated reconnects.
    • The host did receive A's correct thread/resume at 02:16:55 JST, then logged the logical connection closing at 02:16:59. It resumed A repeatedly at 02:17:04, :10, :17 and :24 with further rapid closes. The host received thread/turns/list too. Therefore the issue is not limited to large per-thread hydration responses.
    • User then selected the larger thread B (independent default resume size approx. 744,475 bytes), which also reconnected. However, the expected B thread ID does not appear in the host log window. Instead, beginning 02:17:43, thread/resume requests were observed for a different older thread. One of these generated 119 thread_history WARN entries: dropping turn-scoped item for unknown turn id. We cannot prove the mobile UI misrouted a tap without Android per-request/client instrumentation; it might have been a retained or background selection.
    • During 02:15–02:20 JST, the host logged 48 thread/list requests, 12 thread/resume requests, and 24 logical connection-close events.
    • Both A and B still exist unarchived in the Windows state DB with their rollout files present; SQLite quick_check passes, and the original 676 threads are unchanged. The earlier transient Android "Not found" banner has disappeared, but reconnecting persists.

    Revised diagnosis: Potentially two stages: an oversized first-page list (100-thread clone response ~1.10MB) and an independent Android Remote session/relay lifecycle or stale thread-selection/response-routing problem, because even the short A session fails after the host reaches resume and turns/list. Please correlate exact client-selected thread ID, host request ID, response completion, relay delivery/ack, and Android parse/render/close reason. No raw logs, account details, device IDs, host IDs, thread IDs or conversation contents disclosed.

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

    appapp-serverbugconnectivityremotewindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions