Repository navigation
docs(remote): the desktop client now shares the phone's catalog, replay and gaps - #1019
Merged
Merged
Conversation
…ay and gaps Bring §2.2.2 (The Desktop as a client) back in line with origin/main after the remote-alignment round (#1007, #1009, #1010, #1012, #1013, #1014, #1015, #1017, #1018): - The two "mechanism, not a gap" table rows are gone: the desktop replays with get_events_since (falling back to one whole-page read) and probes get_prompt_receipt on a stored send, both as the phone does. The one remaining mechanism difference -- get_presence on a suspect socket vs. the presence subscription -- is stated in prose. - The capability paragraph names the gains: workspace rename on the phone, and per-host/per-conversation drafts, the stored outbox, the done bell, question navigation, list search and image zoom on the desktop. - The merged-list paragraph describes the pushed catalog: domain-tagged snapshots gated by {epoch, revision}, healed by the presence heartbeat, with a slow per-host read only as the fallback for older hosts. - CONNECTION.zh-CN.md carries the same edits.
huichen
enabled auto-merge (squash)
October 13, 2026 05:46
huichen
added a commit
that referenced
this pull request
Oct 13, 2026
…1020) * feat(remote): read the run's log on the desktop, so a reply is whole A remote conversation is read from two lanes: the host's *record* (a page of its journal) and its *stream* (the events it pushes). Neither is the run: the page ends where the agent last saved, and the pushes begin where this window subscribed, so a reader who opens a conversation while the host is answering sees a fragment — and used to see it twice, as the page's copy and the pushed one were folded together on the assumption that the two lanes do not overlap. They can. The run's own log is the third lane, and this makes the desktop read it the way the phone already does (`get_events_since`): at an open (the state read says which run is in flight, before any frame happens to arrive), when a link comes back, and when a push declares a gap the feed could see. A reply rebuilt from its log covers the run from its beginning, so the record's partial copy of that run is hidden and the reply is drawn once — with the run's *own* start time, which no push can carry, and continued in place by the frames that follow. What moved to `@future-os/thread-projection`, because both clients read the same host: the run cursor (`runCursor`), the replay page loop and its integrity rules (`replay`, `readRunReplay`), and the run's own start and duration in the projector. The desktop's duplicate port of the cursor (replayWindow) is gone, and so is the second copy of the page loop the phone kept for itself. The fold is kept, but demoted: it is the answer for a run this client has *not* read the log of — an older host that does not serve the command, or the first read still in flight. A fragment built from pushes alone is dropped when the run ends (its beginning is only in the record, so keeping it draws the words twice), where a rebuilt reply is kept until the record is readable (the record trails the terminal frame, which is what used to make a settled reply blink). Verified: desktop 297 files / 3978 tests, mobile 153 suites / 3076 tests, the shared package's 19 files / 595 tests, `tsc`, `eslint` on both clients. The harness gained the two commands the desktop now reads and `remote-mid-flight` asserts what only the log can give: one row, carrying the page's words and the run's, timed at the run's own eight minutes. It fails without the read ("the reply is timed from the reader's arrival"), and `remote-streaming` and `remote-lean-stream` — which cover the fold path — still pass. * docs(remote): the two clients' read of a run's log, as it now stands The paragraph #1019 wrote described the state #1013 left: the desktop replayed on resume and handed everything else to one whole-page read. Both clients now read a run's log at the same three moments, the reply they draw comes from it, and the page is kept for the part the log cannot answer. Says what the fallback is when a host does not serve the command, which is no longer "one whole-page read" but the fold. * test(mobile): clear the lane in the refusal test, so jest exits The rewritten case exercises a path that arms the lane's retry timer, and it is not a fake-timer test: leaving it armed kept the node process alive after the suite finished. Locally that is a jest warning; in CI it is the mobile job stuck `in_progress` (35 minutes and counting) on a step whose tests had all passed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
目的
把远程客户端对齐这一轮的成果写回唯一维护位置的内部文档
docs/internals/desktop/CONNECTION.md§2.2.2(The Desktop as a client: connecting out),以及它的中文对照CONNECTION.zh-CN.md。只改文档,最小 diff。逐句改动与依据(按 origin/main 的实际代码核对)
get_events_sinceincremental replay | re-reads history when a link returnsget_events_since重放,「整页重读」只作兜底(旧宿主回Unsupported command、重放窗口校验不过)perf(remote): incremental replay on remote timeline resume(desktop/src/features/remote-peer/useRemoteTimeline.ts:401,:443注释写明回退条件)get_prompt_receiptpolling | waits for the send acknowledgementget_prompt_receiptfeat(remote): durable remote composer drafts and offline prompt outbox with idempotent receipts(remotePromptOutbox.ts、remotePeerClient.ts:349)Two differences are **mechanism, not gaps**get_presence探活再决定是否断开,桌面端读它本就持有的presence订阅grep -rn get_presence desktop/src desktop/src-tauri/src/remote_peer/→ 0 命中;mobile/src/remote/client.ts:357有(restoreServingConnection,用于「先验证再拆连接」)…workspaces; approval mode; skill recommendation)including renaming one;并补一句「原本只有手机具备的行为也已补齐」:草稿按宿主+会话隔离落盘、离线 outbox、完成铃、问题导航、列表搜索、图片缩放平移mobile/src/remote/useSessionCatalog.ts:646发rename_workspace);#1012(remoteComposerDraft.ts:25-26,key = desktopId+sessionId);#1009(useRemoteDoneBell.ts、desktop/src/lib/windowAttention.ts);#1018(RemoteConversationView.tsx:13,15挂QuestionNavControl);#1014(ActivityRail.tsx:265searchQuery);#1010(features/filepreview/ImagePreview.tsx、imageZoom.ts)state.sessions快照,未说它怎么来{epoch, revision}、按版本门应用;presence心跳让丢掉的推送可见并一次补齐;对早于该机制的宿主保留低速按宿主读取perf(remote): adopt push-based remote catalog with version gate and slow-poll fallback(remote_host/catalog.rs:24写version:{epoch,revision};useRemotePeers.ts:154-155收catalog、:290handleCatalog、:19CATALOG_POLL_MS = 60_000兜底)未改动(仍然成立):Known limitations 三条(宿主单槽位 / mobile 非活动桌面只读观察者 / 设备识别需新宿主)——第三条与本次无关,按纪律不动;第一条、第二条本轮未涉及。同理「远端做不到的要隐藏」(终端/Review/文件树/Reset-Debug)与「右侧面板进一步对齐尚未做」仍成立,未动。
用户可见文档(
docs/wiki/{en,zh}/Remote.md)未动:其searchable指的是「分享进 FutureOS」时选择会话的搜索,与本次新增的桌面会话列表搜索不矛盾,且本轮成果是内部能力对齐。核对命令与结果(改动后重跑,均在 origin/main 之后)
「该断言现在是否仍成立」:
get_events_since优先,整页读兜底remotePromptOutbox.ts(localStorage 落盘 + 回执核对)remoteComposerDraft.ts按 desktopId+sessionIdrename_workspacemobile/src/remote/useSessionCatalog.ts:646mobile/src/remote/useDesktopCatalogs.ts:16CATALOG_POLL_MS = 20_000、:24注释 read-only observers验证
文档无构建。已核对:所有引用的路径/标识符都在 origin/main 上真实存在(见上);改动后文中不再出现「desktop 只用轮询」「重连整页重读」「两处机制不同」等过期断言(
grep -n "15 s\|re-reads history\|Two differences" docs/internals/desktop/CONNECTION.md无命中)。