Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
Merge pull request #2233 from yg2224/fix/session-window-cache-race
vastsa1ea89e1f1de8
diff --cc docs/spec/04-ux/08-component-spec.mdindex 20424a7bb,3b2cd1fae..5a4b6bcb4--- a/docs/spec/04-ux/08-component-spec.md+++ b/docs/spec/04-ux/08-component-spec.md@@@ -1,11 -1,7 +1,13 @@@# 08. Component Spec+Workspace file index Git queries settle at their deadline or output limit,+even when inherited child pipes do not close. Composer file search and the+Files index then use the existing bounded filesystem fallback (Refs #1731).++The Composer queue mirror accepts only the current read for each session. A newer queueChanged event invalidates earlier reads so an already delivered prompt cannot reappear. Reads in other sessions remain independent, and future refreshes still reconcile authoritative entries (Refs #1699).++ A bounded session detail read must not overwrite an idle transcript cache changed while that read was pending. Keep its newer messages and history window together. Running sessions still merge unflushed live rows, and the requesting caller receives its own read response (Refs #2086).+A full transcript read may fill its session cache only when that cache has notchanged during the request. New streaming or edit snapshots retain ownership;the caller still receives the requested history for its own action validation.diff --cc docs/spec/06-delivery/04-e2e-test-plan.mdindex 5576dc262,7b3c7ac97..645735072--- a/docs/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/spec/06-delivery/04-e2e-test-plan.md@@@ -1,16 -1,9 +1,20 @@@# 04. E2E Test Plan+### E2E-FILE-INDEX-git-deadline++Drive `getWorkspaceFileIndex` and `searchWorkspaceFiles` against real fixture+files. Hold Git's close event beyond its deadline: both calls return the bounded+filesystem listing. Coverage: `fs-index-git-deadline.test.mjs`. Existing index+tests cover Git ignore semantics, Unicode chunk boundaries and deep search.++### E2E-QUEUE-late-read-after-event++Render two queued prompts, hold a production refresh, deliver a queueChanged event removing the first prompt, then return the old read. Only the second remains visible; a later authoritative refresh still applies. `queue-refresh-event-order.test.mjs` covers event/read order, reversed reads and session independence; `e2e-queue-refresh-event-order.mjs` renders production ComposerStatus/useAppStore in real Electron. No prompt is dispatched to a provider.++ ### E2E-TRANSCRIPT-window-cache-edit-race++ Hold a bounded production session read, publish an idle edit cache with a different history window, then return the older window. Navigate/render from cache and observe the edited content. Also cover unchanged hydration and running live-tail merge. `session-window-cache-race.test.mjs` exercises the runtime API; `e2e-session-window-cache-race.mjs` renders the recovered snapshot through production MessageRow in real Electron. The API is controlled and no provider executes.+### E2E-EXTENSION-thinking-request-stateSet high thinking through the production extension bridge, send a prompt anddiff --cc docs/zh-CN/spec/04-ux/08-component-spec.mdindex cb2e7646c,b2efff498..0ddb1120d--- a/docs/zh-CN/spec/04-ux/08-component-spec.md+++ b/docs/zh-CN/spec/04-ux/08-component-spec.md@@@ -1,10 -1,7 +1,12 @@@# 08. 组件规格+工作区文件索引的 Git 查询在截止时间或输出上限直接结束等待,即使继承的+子进程管道未关闭。输入框文件搜索及 Files 索引使用现有有界目录回退(Refs #1731)。++Composer 队列镜像仅接受每个会话当前读取。更新的 queueChanged 事件使旧读取失效,已送出的提示不会重新出现。其他会话读取相互独立,后续刷新仍可同步权威队列条目(Refs #1699)。++ 有界会话详情读取期间,空闲会话缓存发生修改时,旧读取不能覆盖新消息及其历史窗口。运行中会话继续合并未落盘的实时消息,读取调用方仍得到自己的响应(Refs #2086)。+全量会话读取仅在请求期间缓存未改变时写入该会话缓存。新的流式消息或编辑快照保留所有权;调用方仍得到读取的历史,用于独立动作校验。diff --cc docs/zh-CN/spec/06-delivery/04-e2e-test-plan.mdindex a4f0542e6,89d5a0426..b1f1e05aa--- a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md@@@ -1,16 -1,9 +1,20 @@@# 04. E2E 测试 Plan+### E2E-FILE-INDEX-git-deadline++对真实测试文件调用 `getWorkspaceFileIndex` 和 `searchWorkspaceFiles`,+保持 Git 的 close 事件未到达,推进截止时间后两者均返回有界目录列表。+覆盖:`fs-index-git-deadline.test.mjs`。原有索引测试覆盖 Git 忽略规则、+Unicode 字节分块及深层搜索。++### E2E-QUEUE-late-read-after-event++呈现两个排队提示,保持生产刷新,发送 queueChanged 事件移除第一个提示,再返回旧读取;只显示第二个提示,后续权威刷新继续生效。`queue-refresh-event-order.test.mjs` 覆盖事件与读取顺序、逆序响应及会话独立性;`e2e-queue-refresh-event-order.mjs` 在真实 Electron 中呈现生产 ComposerStatus/useAppStore。不向提供商发送提示。++ ### E2E-TRANSCRIPT-window-cache-edit-race++ 保持生产有界会话读取,发布带新历史窗口的空闲编辑缓存,再返回旧窗口;从缓存恢复并呈现编辑后的正文。同时覆盖未变化时正常填充及运行中实时尾部合并。`session-window-cache-race.test.mjs` 验证 runtime API;`e2e-session-window-cache-race.mjs` 在真实 Electron 中使用生产 MessageRow 呈现恢复快照。仅控制 API,不执行提供商。+### E2E-EXTENSION-thinking-request-state通过生产扩展桥接设置 high,发送提示并捕获提供商流参数。真实 Agent 循环