Skip to content

First /status after pairing misses the sync storage line on a non-hosted relay address #2528

Closed

Description

@AbirAbbas

What happened

On dev@b5b7dead1, a codeaf window that is already open while pairing happens in another terminal shows no sync storage off line on its first /status, for an account whose storage is off on a relay at a non-hosted address. The second /status, or any /status about a minute later, does show it.

No saved storage answer exists yet: /status answers at once from the last reading and only then asks the relay. The window's own once-a-minute check of the setup writes the answer within a minute. The three hosted addresses are not affected, because they read as off until the relay answers.

Replication

Deterministic (no model).

Setup used by the replications below (no provider key, no real home):

make build                                   # bin/codeaf
go build -o /tmp/o/modelstub ./test/remote/stub
/tmp/o/modelstub -addr 127.0.0.1:8804 &      # keyless scripted model; `PROBE-ECHO <text>` gets a reply
(cd relay/hosted && npm ci && npx wrangler dev --local --ip 127.0.0.1 --port 8803 --persist-to /tmp/o/relay-state) &
# every codeaf command below runs with:
export HOME=/tmp/o/a CODEAF_HOME=/tmp/o/a      # or /tmp/o/b for the second computer
export CODEAF_SYNC_URL=http://127.0.0.1:8803 CODEAF_TELEMETRY=off DO_NOT_TRACK=1 CODEAF_NO_UPDATE_CHECK=1
export OPENROUTER_API_KEY=stub CODEAF_BASE_URL=http://127.0.0.1:8804/api/v1

Pair the two homes: codeaf pair with home b, then codeaf pair approve <token> with home a. Storage is off for the new account by default.

  1. With home a, open codeaf chat --model stub/scripted before pairing.
  2. In another terminal, pair a and b.
  3. Within a few seconds, type /status in a's window. There is no sync storage line. Press it again, and sync storage off appears.

Where

runStatusCommand and refreshSyncSpace in internal/tui3/syncspace.go; the storage answer kept beside sync-url (internal/syncsetup/storage.go); the pairing commands in cmd/codeaf (search pair approve).

The fix

A successful pairing, in any process, asks the relay once for this account's storage state and saves the answer where every window reads it. An already-open window's next /status shows the line straight away. A relay that reports no storage state saves nothing, and a failed ask changes nothing.

Acceptance

  • e2e: pair through the real pairing code against a localhost relay that reports storage; a window that was already open shows sync storage off on its first /status.
  • e2e: control: a relay that reports no storage state (the self-hosted codeaf relay) saves nothing and shows no line.

Activity

  1. added a commit that references this issue on Nov 9, 2026
  2. added a commit that references this issue on Nov 9, 2026
    35d38c5
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions