Feat cloud task outline - #987
Merged
Merged
Conversation
refreshOutline 只在打开会话与轮末触发,且壳的帧落盘走异步写线程,回显 到达时读盘未必看得见——发出提问后整轮执行期间大纲都缺最新一条。加 mergeLiveOutline 把对话流里带 seq 的用户消息合并进大纲尾部(同 seq 以 壳目录为准,目录条目带真实翻页偏移),最新一问的来源从磁盘挪到内存, 天然无竞态。
recentTasks 照抄 Web 侧栏把历史任务硬切最近 5 条,更早的结束任务在桌面 上彻底消失,搜索也搜不到。历史任务在可折叠分组里,一页(50 条)全展示; 快速任务顶层平铺,维持 5 条上限。
对齐 Web 的 task-user-input-index:壳新增 mc_task_user_inputs 代理提问 索引接口(游标分页,content 已解码明文),UI 复用本地 OutlineNav。 - 锚用「时间戳取整到 10ms 单位」而非 chunk seq:Loki 部署无 seq,时间戳 是 REST 索引(纳秒)与帧流(毫秒)之间唯一稳定的对表键;毫秒路径直接 整除不绕纳秒,避开 Number 安全整数的舍入翻界 - useCloudTask 在归约边界给 user-input 帧盖章 seq=锚(core 存原始帧, WS 去重水位不受影响),索引条目经既有 data-mc-seq 定位链找到气泡 - 运行中新发的提问由 mergeLiveOutline 实时合并兜住,不轮询索引;跳转到 未加载的早期提问逐轮「加载更早」,游标无进展即放弃(上限 200 轮)
mc_task_user_inputs 只注册了 generate_handler,漏了 build.rs 的 AppManifest 命令清单与 tauri.conf.json 的 capabilities 白名单,invoke 运行时被 ACL 拒绝;索引拉取的 catch 又全静默,表现为大纲整体不显示且 无报错。补两处注册,catch 改为 console.warn 留痕(降级行为不变)。
第一版把补页循环放在 nav 层,游标经 React 状态回读:连续 await 之间 state 闭包是陈旧的,「无进展」护栏被旧游标误触,点几轮前的提问直接放弃 并弹「未能定位」横幅。重做: - 补页下沉进 useCloudTask 的 ensureLoaded:游标与翻页互斥全走 ref 本地 推进(state 只作渲染镜像),终止条件改为「内存帧集里已有该锚」 (framesHaveAnchor),prepend 后立即可判,不依赖渲染 - 跳转补页步长 1→10 轮(壳 mc_task_rounds 上限),跳很早的提问快一个 数量级;手动「加载更早」维持一次一轮 - 失败横幅撤掉:DOM 定位的残余提交延迟由 jumpWithRetry(12×32ms,与 本地同款)吸收,真对不上锚(无时间戳旧帧)只 console.warn 留痕
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.
No description provided.