Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

docs(config-sync): state the progress contract in both locales

vastsafbe2ec6e7f62
diff --git a/docs/spec/03-runtime/01-ipc-protocol.md b/docs/spec/03-runtime/01-ipc-protocol.md
index 7230857da..31ee5b757 100644
--- a/docs/spec/03-runtime/01-ipc-protocol.md
+++ b/docs/spec/03-runtime/01-ipc-protocol.md
@@ -2303,3 +2303,10 @@ renderer. The `configSync.changed` event carries the same redacted state and
is emitted by Host-originated changes, including the Host scheduler. Main is a
transport/lifecycle coordinator and does not schedule, merge, encrypt, or
apply configuration.
+
+A manual sync reports `configSync.progress` while it runs: the phase
+(`capture`, `download`, `merge`, `upload`, `apply`, or `cleanup`), the units
+done and total for that phase, and the bytes when they are known. A long upload
+of many resource objects is therefore not an interface with nothing to show.
+Background polls report nothing, since only the manual path has a caller
+watching.
diff --git a/docs/spec/03-runtime/22-config-sync.md b/docs/spec/03-runtime/22-config-sync.md
index 566fd841f..a9c31b185 100644
--- a/docs/spec/03-runtime/22-config-sync.md
+++ b/docs/spec/03-runtime/22-config-sync.md
@@ -170,6 +170,16 @@ support. The renderer displays
and `error` as distinct states. Disconnect keeps local data and does not delete
remote data.
+A manual sync reports what it is doing while it runs. `configSync.progress`
+carries the current phase — `capture`, `download`, `merge`, `upload`, `apply`,
+or `cleanup` — the units finished in that phase, and the bytes when they are
+known: `done`/`total` count resource objects while transferring and entities
+otherwise, a `total` of 0 means the phase cannot know its size, and a
+`bytesTotal` of 0 means the byte size is unknown, which is the normal case for a
+download. Reports are throttled, a phase change is never dropped, and the state
+event plus the call's return value stay the terminal signal. Background polls
+report nothing: only the manual path has a caller watching.
+
Credentials and memory are unchecked by default. The setup preview reports
supported, excluded, secret-bearing, mapping-required, and pending-activation
counts. Raw secret values, vault keys, and backup passwords never cross the
diff --git a/docs/zh-CN/spec/03-runtime/01-ipc-protocol.md b/docs/zh-CN/spec/03-runtime/01-ipc-protocol.md
index fbce33017..f9d551336 100644
--- a/docs/zh-CN/spec/03-runtime/01-ipc-protocol.md
+++ b/docs/zh-CN/spec/03-runtime/01-ipc-protocol.md
@@ -1841,3 +1841,5 @@ unchanged. See [provider configuration](12-provider-config-schema.md).
| `pi-desktop/configSync/disconnect` | `configSync.disconnect` | 移除本地同步元数据和 key;不会删除远端 vault 数据 |
输入密码只会被传给需要它的操作。原始秘密、vault key、解密资源或远端 archive 不会返回到 Renderer。`configSync.changed` 事件携带相同的脱敏状态,并由 Host 发起的变更(包括 Host scheduler)触发。Main 只是传输/生命周期协调器,不负责调度、合并、加密或应用配置。
+
+手动同步会在运行期间报告 `configSync.progress`:当前阶段(`capture`、`download`、`merge`、`upload`、`apply` 或 `cleanup`)、该阶段已完成与总量,以及已知时的字节数。因此上传大量资源对象时,界面不会无内容可显示。后台轮询不报告进度,因为只有手动路径有调用方在等待。
diff --git a/docs/zh-CN/spec/03-runtime/22-config-sync.md b/docs/zh-CN/spec/03-runtime/22-config-sync.md
index 8a38269a6..ff6fb0bc1 100644
--- a/docs/zh-CN/spec/03-runtime/22-config-sync.md
+++ b/docs/zh-CN/spec/03-runtime/22-config-sync.md
@@ -70,6 +70,8 @@ Host 绝不会仅因为 UI flag 被设置就激活暂存的可执行内容。新
设置 → 云同步提供 WebDAV endpoint 凭据、vault 密码、设备标签、服务器兼容模式、类别选择、能力测试、立即同步、解锁、暂停、文件夹映射、批准/拒绝、revision history/restore、vault 密码重新包裹以及断开连接控制。严格 CAS 是默认模式。选择追加式兼容模式会显示持续风险提示,并在保存配置前要求确认;其测试成功提示目录列表支持,而不是条件写支持。Renderer 将 `notConfigured`、`locked`、`upToDate`、`localChangesPending`、`syncing`、`offline`、`unsupportedServer`、`conflict`、`awaitingActivation`、`paused` 和 `error` 显示为不同状态。断开连接会保留本地数据,不会删除远端数据。
+手动同步会在运行期间报告它正在做什么。`configSync.progress` 携带当前阶段(`capture`、`download`、`merge`、`upload`、`apply` 或 `cleanup`)、该阶段已完成的单位数,以及已知时的字节数:`done`/`total` 在传输时计资源对象、其他阶段计实体;`total` 为 0 表示该阶段无法预知总量;`bytesTotal` 为 0 表示字节数未知,这是下载阶段的常态。报告会节流,阶段变化绝不丢弃,状态事件与调用的返回值仍是终态信号。后台轮询不报告进度:只有手动路径有调用方在等待。
+
凭据和 memory 默认未选中。设置预览报告 supported、excluded、secret-bearing、mapping-required 和 pending-activation 计数。原始秘密值、vault key 和备份密码永远不会跨过 Renderer 边界。
Host 负责自动同步启用后的启动即时检查、30 秒本地变更防抖以及有界的五分钟远端轮询。失败网络请求使用带 jitter 且有上限的指数重试;paused、locked、不兼容、认证和错误密码状态不会启动重试循环。应用退出时 worker 会随 Host 取消;退出后没有额外 daemon。