Skip to content

feat(remote): keep thread lists available through a trusted host - #1

Draft
jacobcorbett wants to merge 2 commits into
mainfrom
t3/investigate-offline-thread-sync
Draft

jacobcorbett wants to merge 2 commits into
mainfrom
t3/investigate-offline-thread-sync

Conversation

@jacobcorbett

@jacobcorbett jacobcorbett commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

When a laptop goes offline, a phone can show an older thread list even though another machine already saw its settle and snooze changes. Clients currently keep independent caches, so an online machine cannot supply that newer state.

This adds an opt-in read-only copy on one chosen linked environment. The source exports its bounded thread list; previously authorised clients can read a newer copy from that host while the source is unreachable. The list says which source is offline and when it last synced. Live source data takes over on reconnect. Setup and notices are included for web, desktop and mobile.

The source still owns commands and execution. Copies exclude conversation bodies, error text, goals and background-task descriptions. They include titles, status, timestamps, project folders, branches and pull-request metadata. Reader grants come from the source; access to the host alone does not open a copy. Sequence ordering is scoped to the source database, writes use a persistent ownership secret, and expired copies are dropped.

Related: upstream issue #24530 and proposal #20279. This PR targets Jacob's fork, not upstream.

Screenshots

Setup comparison, before and after enabling the setting in the same local fixture. Screenshots use neutral fixture names, Laptop and Home server, in place of the host machine name. Both captures use this implementation; an original-build baseline was not captured because implementation was already underway when screenshots were requested.

Before: copy switched off After: host selected
Before enabling: thread-list copy switched off After enabling: linked host selected

After-only runtime capture: the source process is stopped and the client shows its saved thread list with the shorter offline notice. The original three-party behaviour check is described below; these refreshed screenshots show the same fixture after the reconnect/un-settle check.

Desktop web: Laptop offline with saved thread state

Responsive web at an iPhone-sized viewport with the same offline fixture. This is responsive web evidence, not a native iOS screenshot.

Responsive web: offline source notice and saved list

Proof uses synthetic data on two isolated local server instances and a separate browser client. No live personal database was used. Selecting Off removed the host's copy; selecting the host recreated it. The browser cached the old list and left the app. Source commands then settled and snoozed threads at sequences 9 and 10; the host acknowledged sequence 10 before the source process stopped. Reopening the client showed Settled 1, Snoozed 1 and the offline notice. Restarting the source cleared the notice; an un-settle at sequence 11 appeared live. Reloading while the source was offline restored the notice.

Validation and limits

  • vp run check:changed passed format, lint, knip, GraphQL checks, typechecks of 41 affected packages, 19 test files and React Compiler checks. git diff --check passed.
  • Focused server mirror tests: 17 passed, including actual HTTP authentication/size boundaries. Client shell tests cover newer/stale copies, database identity, source denial, expiry, cached provenance and live precedence.
  • The Linked environments disabling regression failed before the final fix and passed afterwards.
  • Native mobile and packaged Electron were not run. Device tools reported no Android SDK or iOS host. Relay and credential-renewal end-to-end flows were not exercised. Draft pending native acceptance.
  • Both servers and the client need this version. The client must connect to the source while it is online to obtain its session-specific reader grant. Old caches without database identity cannot accept a copy until a live refresh.
  • Copies expire after seven days without an export. Exports are batched over 15 seconds, renew after six hours and retry failures. A source stopped before acknowledgement may leave the host behind.
  • Writer ownership is trust on first claim by an already approved peer; an approved peer can pre-claim an unseen environment ID. Re-linking preserves ownership, but losing the writer secret requires waiting for expiry. There is no owner-reset UI.
  • Revocation reaches the host at the next successful export; an unreachable host can retain a readable copy until expiry. Pending withdrawals are in memory and do not survive a source restart.

Reviewed with sol-loop: 3 rounds with Claude Sonnet 5.5 on medium. Final verdict: approved. Lifecycle, grant refresh, connection gating, provenance, atomic writes, relinking and transfer frequency findings were fixed. One bounded retry-log nit was declined. The review diff grew from +2,704/−40 to +3,272/−48 lines, chiefly focused regression coverage and lifecycle fixes. A later copy-only edit shortened the shared web/mobile notice to "Showing saved threads. Reconnect to make changes."; it was locally reviewed and visually checked with fresh screenshots. Review usage was not exposed.

Implemented with Claude Sonnet 5.5 (Claude Agent) and GPT-6.1-Sol (Codex), orchestrated in T3 Code.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL labels Nov 10, 2026
@github-actions

Copy link
Copy Markdown

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for ac82727.

This comment will update automatically after the next completed run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant