DEV Community

Paragon666
Paragon666

Posted on

Codex app: 'connected' but zero chats? Connect from the phone over SSH instead

TL;DR

If the Codex mobile app shows your host as connected but the chat list is empty ("No tasks yet"), do not assume the chats are gone. In the incident below, the audited local histories were intact and repeated thread/list requests reached the daemon — the loss was in what the phone rendered.

What worked for us:

  1. In the iOS app: Add connection → SSH (not "Pair with a new device").
  2. Enter a host address the phone can actually route to, the port, and the exact user who owns the Codex sessions.
  3. Authentication: Private key — paste a key in PEM PKCS#8 format. The app rejects the default OpenSSH key format; that conversion is the only non-obvious step (details below).
  4. Connect. In our tests the full list appeared — and survived the tested app restarts.

Everything below is how we got there, what the evidence does and does not prove, and a manual recipe you can follow without any assistant.

Symptoms

Setup during the audited incident: Codex CLI 0.169.0 on Linux servers, app-server running with Remote Control enabled. Clients: the iOS app (1.2026.307) and the Windows desktop app. (A later update to CLI 0.170.0, and the symptom being unchanged by it, are separate owner observations — the audit below covers 0.169.0.)

For roughly two days, the iOS app showed the host as connected — green dot, no errors — and showed no chats. Not stale chats, not a partial list: an empty list, as if the host had just been provisioned.

The desktop app, connected to the same host, showed every chat normally.

The audited sequence on one host was exact: one post-pairing iOS connection rendered the full list; two later cold-open connections rendered empty. Owner observation from the same days: newly created chats behaved the same way — openable from their completion notification, absent from the list after a restart. The chats were never deleted. The rendered list was the problem.

This is not a one-off

During this incident's audit we went through the archive and found an earlier episode from September: a thread that existed on the host became unreachable from the app ("no active thread"). The mechanism there was different — a duplicate durable ordinal, reused by two distinct records, stalled the local history projection on the host; it was not an enrollment or list problem. The remedy at the time was a successor thread as a continuity workaround; lossless recovery remained incomplete and the old history was not restored in place, though later durable records remained in the rollout. What the two episodes share is the symptom and the moral: the view vanished, the underlying records remained. A report was filed with the vendor at the time; no reply was found in the checked material from that host (an external support-account reply was outside the audit).

In day-to-day use since then — this part is our experience, not an archive finding — the paired connection has been repeatedly flaky: hosts dropping out of the mobile list, re-pairing ceremonies that restore things for a while, lists that disagree with the host. This week's two-day disappearance is the worst instance of that pattern, not the first.

And in the app versions we used, until recently pairing was the only option we saw in the add-connection flow. The manual SSH form — host, port, user, your own key — appeared only recently. That, more than anything, is what changed: the app grew a second door, and manual SSH creates a separate, direct phone-to-host route.

What we verified on the host (so you don't chase ghosts)

We established the host side as carefully as the logs allow — and the logs have limits, stated where they bite. A planned synchronized three-plane capture (daemon registry, desktop, phone, same minute) remained incomplete; what follows is per-host evidence, not a single synchronized proof.

Host A — the storage is intact. 79 current visible unarchived histories reconciled to complete rollout bytes, and all 289,818 inspected records were sequential. Thirty histories carried the current account ID, 49 were legacy-null, none carried another account — so a zero list was not explained by missing storage or by a strict current-account filter.

Host D — a different, lesser check. All 290 thread rows matched the current enrollment account. That is an account-matching check, not an equivalent complete-rollout reconciliation.

The phone's requests reach the daemon. In the rendering window and in both empty cold-open windows, the daemon's log showed the phone's connections issuing repeated thread/list requests, with no list-method error recorded in either. The logs do not retain request parameters, filters, returned counts, response markers, bodies, or durations — so they cannot show what any of those requests returned.

The surfaces diverge. A remoteControl/client/list query after the incident boundary returned exactly one enrolled client — the phone, with a lastSeenAt from that minute. Minutes earlier, the desktop UI had shown zero enrolled devices for the same host while the phone reported "Connected". Host D's same-time registry result was never recovered. Treat these as distinct surfaces (registry response, desktop rendering, phone rendering) observed at different times — not as one contradictory registry.

The supported boundary. No A storage or projection failure was demonstrated, and no D list-request rejection was logged. Which branch failed — different request parameters or results, a secondary account-side index, or the client failing to consume/render a valid answer — remains open, because the evidence that would separate those branches was never recorded.

Why the two paths behave differently

The iOS app's "Add connection" menu offers two doors, and they are not the same mechanism:

Door 1: "Pair with a new device" (Remote Control). In this mode the phone never talks to your server. It talks to the vendor's backend, which relays to the daemon enrolled for your account. On host D, one post-pair iOS connection rendered the list; two later cold-open connections rendered empty. All three logged list calls, and no list-method error distinguished them. The logs do not retain request parameters, response bodies, returned counts, or durations, so they cannot distinguish different filters or results, a secondary account-side index, or client-side consumption/rendering. A later owner-tested SSH route rendered the list and survived the tested restart; that makes it a workaround, not proof of which Remote Control branch failed. Public issue openai/codex#23351 reports a similar symptom shape — reporter evidence, not a vendor architecture statement.

Door 2: "SSH". Here the phone does what the desktop app does: it opens an SSH connection to the host itself and speaks to the app-server over that channel. In the tested population — three cards, below — the list matched the host's own and survived the tested restarts. That is the observed behavior; we make no claim about the app's internals.

Two honest qualifications:

  • The boundary above is measured: no demonstrated storage failure on A, no logged list-request rejection on D, failure observed only in the paired path's cold opens, the SSH route working in the owner's tests. The exact reason for the empty rendered list is not observable from outside.
  • On the desktop we found extra soil for failure: after a hard power-off of the workstation, its connection objects had diverged — the host had been re-added by bare IP with a default identity file that matched no authorized key, next to the original, correctly configured connection. (Source: the workstation's own SSH config — a separate workstation observation, not evidence about the audited Remote Control mechanism; the server-side enrollment was stable throughout.) Whether that divergence contributed is plausible but unproven.

The fix, step by step

Everything below is manual. You need: one ordinary SSH login to your server from your computer, and Python 3 with the cryptography package for one conversion step (check with python3 -c "import cryptography"; install it with pip install cryptography if missing).

1. Choose the exact user

The SSH user in the card must be the user whose home holds the Codex sessions on that host — the chats live in that user's Codex state. A different OS user has a different home and different Codex state; landing there and seeing no chats is expected separation, not this bug. Everything below happens as that user.

2. Preflight: the phone must be able to reach the endpoint

The SSH path makes the phone a real network client of your server. Before creating anything, confirm:

  • The endpoint and port are correct, and sshd is listening there.
  • Public-key authentication is enabled for the exact user from step 1.
  • The phone-to-host path is permitted: for a public IP, routing plus NAT/security-group/firewall policy and the SSH listener must all allow it — a public address alone does not guarantee reachability. For a VPN address (e.g. a Tailscale 100.x.x.x), the phone additionally needs that VPN client installed and connected, the correct tailnet, the host online, and applicable ACL/policy allowing the path.

Diagnostic note: if connections fail, check the server's SSH log. Zero connection attempts there indicates a pre-sshd problem — endpoint, path, or logging — of which routing is one possibility, not a unique diagnosis. Attempts present but rejected is an authentication problem. (In our incident, the second host lived on a VPN address and the phone had no VPN client; installing it was the fix. That is a bounded owner observation, not a general rule.)

3. Create a dedicated key for the phone (on the server)

Use a separate key for the phone — if the phone is lost, you revoke one line in authorized_keys and nothing else changes. Log into the server as the user from step 1, then:

mkdir -p ~/.ssh && chmod 700 ~/.ssh
test -e ~/.ssh/phone_ed25519 && echo "STOP: key already exists" || \
  ssh-keygen -t ed25519 -f ~/.ssh/phone_ed25519 -C "phone-codex"
Enter fullscreen mode Exit fullscreen mode

Leave the passphrase empty (press Enter twice) — the app's form has no passphrase field, and the conversion below loads the key without one; an encrypted key will fail there.

Install the public half — idempotently, so re-running this is safe:

touch ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys
grep -qxF "$(cat ~/.ssh/phone_ed25519.pub)" ~/.ssh/authorized_keys || \
  cat ~/.ssh/phone_ed25519.pub >> ~/.ssh/authorized_keys
Enter fullscreen mode Exit fullscreen mode

Record the fingerprint:

ssh-keygen -lf ~/.ssh/phone_ed25519.pub
# 256 SHA256:AbCdEf... phone-codex (ED25519)
Enter fullscreen mode Exit fullscreen mode

That fingerprint is your reference value. The end-to-end confirmation comes later: after the phone's first successful login, the server's auth log line for it shows the same SHA256:... fingerprint.

What you now have, and where it lives:

  • ~/.ssh/phone_ed25519 — the private key, OpenSSH format. The master copy; keep it protected on the server. It and the converted PEM below encode the same credential.
  • ~/.ssh/phone_ed25519.pub — the public key. Safe to share; a copy now sits in ~/.ssh/authorized_keys, which is what the server checks at login.
  • ~/.ssh/phone_ed25519_pem — created in the next step: the same private key converted to the format the app demands. Whoever holds it can log in as you — never disclose it except through the intended transfer to your own phone (step 5).

Computer-side alternative: generate and convert on your own computer instead (Windows 10/11 ships ssh-keygen too), transfer only the .pub file to the server, append it to the exact user's authorized_keys as above, and keep all private material local.

4. Convert the private key to PKCS#8 PEM

The app's key field demands, verbatim: "Enter a valid PEM private key in PKCS#8 or SEC1 format." The default ssh-keygen output is the OpenSSH format (-----BEGIN OPENSSH PRIVATE KEY-----) and is rejected.

You need the first line to be exactly:

-----BEGIN PRIVATE KEY-----
Enter fullscreen mode Exit fullscreen mode

Run this from any directory — the paths are absolute:

python3 - <<'EOF'
from pathlib import Path
from cryptography.hazmat.primitives import serialization

src = Path.home() / ".ssh" / "phone_ed25519"
dst = Path.home() / ".ssh" / "phone_ed25519_pem"
key = serialization.load_ssh_private_key(src.read_bytes(), password=None)
dst.write_bytes(key.private_bytes(
    serialization.Encoding.PEM,
    serialization.PrivateFormat.PKCS8,
    serialization.NoEncryption(),
))
dst.chmod(0o600)
print(dst.read_text().splitlines()[0])
EOF
Enter fullscreen mode Exit fullscreen mode

The printed line must read -----BEGIN PRIVATE KEY-----. If it doesn't, stop — do not paste that file into the app.

5. Move the PEM to the phone — carefully

cat ~/.ssh/phone_ed25519_pem
Enter fullscreen mode Exit fullscreen mode

Copy the entire output, including the -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY----- lines — they are part of the format; without them the app refuses the key. Treat this text like a password while it travels: it will sit in your terminal scrollback and clipboard, so clear transient copies (clipboard managers, synced note apps, the intermediate file on any other machine) once the phone has it. Keep exactly one protected recovery copy — the OpenSSH master on the server is enough; you can reconvert it any time. You will want that path if the app ever drops the stored key (see the credential gotcha below).

6. Add the connection on the phone

In the Codex iOS app:

  1. Add connection → SSH
  2. Display name: anything distinct (e.g. Devbox iPhone)
  3. Host: 203.0.113.10 (your server's address, reachable per step 2)
  4. Port: 22
  5. Username: dev (the exact user from step 1)
  6. Authentication: Private key
  7. Paste the entire PEM from step 5.
  8. Save, connect.

Same chats, with the conditions stated: you see the same chats as the desktop when it is the same host, the same SSH user, and the same Codex home/environment and account context. Change any of those and you are looking at a different — legitimately different — set of chats.

7. Verify

Open the host: the expected list renders. Create a test chat. Then the decisive test the paired path kept failing in our incident: fully close the app, reopen it, open the list. In our tests the chats were still there.

Multiple servers under one account — the tested population

On 2026-11-18 the owner tested three SSH cards under one app account — two hosts, plus a second user account on one of them — and switching between app accounts did not disturb those cards; in that test the app's "All" view showed all three hosts' chats in one list. That is the tested population; we claim nothing beyond it.

The credential gotcha

In one tested case, after the app lost an account session and the owner logged in fresh, a card remained but its key field was empty ("SSH credentials are missing"); re-pasting the PEM restored access. Normal restarts and account switches in our tests did not do this — those are observations from our tests, not guarantees. Keep the recovery path from step 5 available; the re-paste takes 30 seconds.

What does NOT fix it (save yourself the hours)

We tried all of these, several more than once, on two hosts:

  • Revoke + re-pair the phone — in the audited sequence, the one rendering session followed a pairing; the next cold opens were empty again.
  • Re-adding the host on the desktop with the correct parameters — the desktop was never the failing client.
  • Logging out and back in on either client.
  • Updating the CLI — owner observation: 0.169.0 → 0.170.0 changed nothing. (Outside the audit's scope, but consistent.)
  • Restarting the server / the daemon — no daemon fault was found in the audited evidence.
  • Deleting and recreating chats — new chats vanished from the list exactly like old ones in the owner's observation.

Is it the same pattern? A 60-second triage

  1. Desktop app shows the chats; the phone shows the host connected with an empty list.
  2. On the host, the histories exist (session files present; the thread store reconciles).
  3. A fresh pairing is followed by a rendering session — and a cold open later renders empty again.

Three out of three: it matches this incident's symptom pattern. The exact branch was never resolved in our case either — but the SSH door does not need it resolved. Add the SSH connection on the phone and get back to work.


Numbers from this incident: host A — 79 visible unarchived histories, 289,818 sequential records; host D — 290 thread rows matching the enrollment account; audited sequence — one rendering connection, two empty cold opens; CLI 0.169.0 (iOS app 1.2026.307, iOS 26.6.1); ~2 days of invisible chats. Hostnames, addresses, and usernames in the examples are illustrative. The chats were never deleted — two days of "lost" work turned out to be a list that would not render, and a second door that would.

Top comments (0)