Menghuan1918
d35f622e66
merge dev into fix/host-load-without-session-log-offset-runtime
...
# Conflicts:
# src/sidechat-routes.ts
2026-10-05 00:55:34 +08:00
Atlas Zeng
00801f5289
Merge pull request #818 from btsd321/feat/tabbar-right-actions
...
feat(tabbar): 新增 TabDescriptor.rightActions,活跃 tab 可注入 tab 栏右侧操作区
2026-10-05 00:54:50 +08:00
Atlas Zeng
e864dabe6f
Merge pull request #814 from ZinChl/fix/tasks-fold-guards
...
fix(tasks): 任务页折叠守卫的三处不一致(根卡死控制 / run 成员绕过 leaf 测试 / 文档矛盾)(#784)
2026-10-05 00:54:34 +08:00
Atlas Zeng
c571e96c65
Merge pull request #813 from ZinChl/fix/subagent-running-after-restart
...
fix(tasks): 会话「驻留」不再当作「agent 在跑」——崩溃重启后的子代理状态(#800)
2026-10-05 00:54:18 +08:00
Atlas Zeng
c7980cee7c
Merge pull request #811 from ZinChl/fix/fs-trees-batch-split
...
fix(files): fs.trees 按宿主上限分块,展开集 ≥64 的会话不再整树报错(#799)
2026-10-05 00:53:58 +08:00
Atlas Zeng
ce3527ca1e
Merge pull request #809 from ZinChl/fix/archive-status-session-scope
...
fix(files): 修「压缩并下载」必然失败——archive.status 缺 sessionId + ready 交接无护栏(#798)
2026-10-05 00:53:43 +08:00
Atlas Zeng
40f0255ad0
Merge pull request #807 from graydovee/fix/blank-session-bottom-entry
...
fix(client): 空白新会话里恢复「打开底部工作台」入口(#698 / #623)
2026-10-05 00:53:27 +08:00
Atlas Zeng
10e99dba7e
Merge pull request #806 from ZinChl/fix/search-result-directory-click
...
fix(files): 搜索结果里的目录行改为导航文件树,不再当文件打开(#801)
2026-10-05 00:53:09 +08:00
HuanLinOTO
9cc40472f8
fix(paths): Copilot review 四条全修——共享解析契约贯穿 media/html/fs 变更入口
...
- html 路由 decoder 保留 ~ 首段原样(~/x.html 不再被拼成绝对 /~/x.html),
encoder/decoder 往返与相对资产解析均保持 ~ 标记(#713)
- media/download 路由去掉 isAbsolute 预拼接,raw 直达 ensureWorkspacePath
(~ 展开不再被 cwd 前缀遮蔽);fs.trees 同型守卫
- fs-operations 的 rename/remove/mkdir(resolveEntry)与 upload(base)全部
改走 resolveTarget 共享契约,会话相对路径四入口齐活(#646/#713)
- session-path 的 fs 落盘 remote-mirror 用例改为 Windows-only(win32.join 的
meta 路径拼写在 POSIX 上不指向已创建文件,修 ubuntu ci 红)
新用例 8 个;四处变异验证(还原任一修复对应测试必红)。
2026-10-01 18:41:27 +08:00
HuanLinOTO
0500aa045a
Merge PR #789 (ported): fix(files): 在途层渲染 loading 行,消除新展开文件夹的空目录闪烁(移植到 loadLevels 新形状,#693 #687)
2026-10-01 17:46:52 +08:00
HuanLinOTO
14320952be
fix(train): 清理 fs-write-relative-path.spec 的未用导入(lint)
2026-10-01 17:26:29 +08:00
HuanLinOTO
aa82c4aed7
fix(train): #697 测试 harness 适配 #776 的 mounted 观测——会话列表从来沒有 current 字段(AGENTS §3.4.9)
2026-10-01 17:25:16 +08:00
HuanLinOTO
84d89067d4
Merge PR #696 (ported): fix(editor): 打开文件先问原生 tab 注册表,被认领的类型不再被硬编码 editor 顶掉(移植到 sidebar-file.ts 新载体,Fixes #695 #643)
...
# Conflicts:
# src/client/EditorHost.tsx
2026-10-01 17:22:00 +08:00
HuanLinOTO
4836e25aad
fix(train): 合车适配——#730 图标改用改名后的 IconPanelLeftOutlineRegular;#736 测试适配 #776 按会话记账签名
2026-10-01 17:21:42 +08:00
HuanLinOTO
56567b3c4d
fix(editor): 打开文件先问原生 tab 注册表,被认领的类型不再被硬编码 editor 顶掉(#696 移植到 sidebar-file.ts 新载体,Fixes #695 #643)
2026-10-01 17:21:10 +08:00
HuanLinOTO
37fb9204b0
fix(paths): ~ 是主目录路径而不是会话相对路径,展开后再解析(Fixes #713,随 Phase 2 路径簇顺带修)
2026-10-01 17:20:06 +08:00
HuanLinOTO
3345b72699
Merge PR #744 (extracted): fix(paths): 识别 remote-mirror 工作区命名空间投影(#788 #703;html-cwd 半边已由 d71261ac 覆盖)
2026-10-01 17:18:49 +08:00
HuanLinOTO
0f9c7578c0
Merge PR #677 (ported): fix(files): 目录级别加载失败不再被当成缓存命中,自动加载路径可重试(移植到 loadLevels 新形状)
2026-10-01 17:18:49 +08:00
HuanLinOTO
d23bbde0f7
Merge PR #769 : fix(open-external): support Termux (platform android) openers
2026-10-01 17:18:31 +08:00
HuanLinOTO
356c3b1dbc
Merge PR #682 : fix(trust-fence): 允许 bfcache 恢复的图片带过期 cross-site 标记(PNG 预览空白修复)
...
# Conflicts:
# tests/trusted-hosts.spec.ts
2026-10-01 17:18:31 +08:00
HuanLinOTO
a749b20b68
Merge PR #797 : fix(ws): WebSocket 路由改用壳注入的 transport base + 接受桌面壳页面 origin(0.2.0-rc.1 / v0.24.1 基线)
2026-10-01 17:18:19 +08:00
HuanLinOTO
e4cf2fd034
Merge PR #763 : fix(state): 拖动窗格内最后一个 tab 到自身边缘不再直接丢失该 tab
2026-10-01 17:18:09 +08:00
HuanLinOTO
a5c3befc57
Merge PR #664 : fix(diff): 二进制/纯重命名/仅改模式的文件行补回路径,并关掉 git 路径 C 转义
2026-10-01 17:18:09 +08:00
HuanLinOTO
65eb0957fb
Merge PR #665 : fix(diff): 头部 +n/−m 改为 git 口径,一处改写不再两侧各计一次
2026-10-01 17:18:09 +08:00
HuanLinOTO
b1c17af429
Merge PR #779 : fix(markdown): render anchors without a stray close tag and keep <details> summaries as direct children
2026-10-01 17:18:09 +08:00
HuanLinOTO
8bf14268aa
Merge PR #691 : fix(sidechat): inherit the parent's CURRENT model selection, not its stale options snapshot
...
# Conflicts:
# tests/sidechat-routes.spec.ts
2026-10-01 17:18:08 +08:00
HuanLinOTO
8c37a7e7df
Merge PR #663 : fix(sidechat): clear the child inbox after create — fork markers alone do not fence the runtime inbox
...
# Conflicts:
# AGENTS.md
# tests/sidechat-seed-validation.spec.ts
2026-10-01 17:17:57 +08:00
HuanLinOTO
e10510f29a
fix(files): 在途层渲染 loading 行,消除新展开文件夹的空目录闪烁(#789 移植到 loadLevels 新形状)
...
移植 PR #789 的语义到 v0.24.1(98a446b)重写后的加载形状,原 diff 基于
已不存在的 loadDir 形状,不再适用:
- 核心条件原样保留:renderLevel 对「未请求」(undefined)与「在途标记」
(loadLevels 非强制路径写入的 {} —— 无 entries 无 error)都画 loading
行。修复前标记落进 entries ?? [] 渲染零行:展开新目录闪「loading →
看似又折叠了 → 条目」,且首挂载的根层也是空体。settled 层必带 entries
(不可读层另带 error),条件不会误伤真实数据。
- 原 PR 改在 per-level loadDir 请求时代;现形状 loadLevels 非强制路径先
storeLevel(path, {}) 再发批量 fs.trees,在途标记形状未变,故只需渲染
侧一处扩展,加载逻辑零改动(force 路径保留旧行的语义不受影响)。
- 测试 tests/file-tree-loading.spec.tsx 随形状移植:原版 gate 住单层
fsTree 路由,现 gate 住批量 fsTrees 的 { levels } envelope;并按真实
用户流拆成两批——先挂载根层、落地后再展开子目录触发第二批(批量语义
本身由 file-tree-batch-load.spec.tsx 单独守护)。三个用例语义不变:
展开期间 loading 行不消失、真空目录渲染零行不卡 loading、整批失败出
错误行。判别性验证:回退修复后前两用例红(错误路径用例两态都绿,它
守护边界而非本次回归)。
- 原 PR 未新增词典 key(复用既有 t('loading')),本次同样零词典改动,
无需触碰 19 份第三语言词典。
- 全套件对照:改动前后均 1485 通过 / 6 失败;6 个失败(locales ja 缺
2 key、plugin-meta 打包、tasks-model ×4)在干净 origin/main @1499502
上同样复现,属 main 既有问题,与本提交无关。
2026-10-01 17:15:49 +08:00
HuanLinOTO
b0c07c78fb
Merge PR #742 : fix(security): stop git operands parsing as options, and harden the API dispatch
2026-10-01 17:15:48 +08:00
HuanLinOTO
5ce98edcd0
Merge PR #733 : fix(editor): never save a truncated read over the full file ( #732 )
2026-10-01 17:15:48 +08:00
HuanLinOTO
e85ec684ac
Merge PR #764 : fix(fs): fs.write 改用每请求唯一临时文件,避免并发保存互相损坏
...
# Conflicts:
# tests/smoke.spec.ts
2026-10-01 17:15:47 +08:00
HuanLinOTO
24a670c9e8
Merge PR #741 : fix(security): sandbox SVG served by the media route
2026-10-01 17:14:59 +08:00
HuanLinOTO
002046cc47
Merge PR #655 : fix(server): resolve session-relative paths in fs.write and fs.read
...
# Conflicts:
# src/path-security.ts
2026-10-01 17:14:58 +08:00
HuanLinOTO
188fea0328
Merge PR #754 : fix(preview): resolve workspace-relative paths against session cwd for HTML and media routes
2026-10-01 17:13:47 +08:00
HuanLinOTO
ea76981c0e
Merge PR #697 : fix(native): 跨会话打开改为排队到上屏重放(Fixes #694)
...
# Conflicts:
# src/client/native/surface.ts
2026-10-01 17:13:47 +08:00
HuanLinOTO
5256eef3ab
fix(files): 目录级别加载失败不再被当成缓存命中,自动加载路径可重试(#677 移植到 loadLevels 新形状)
...
PR #677 was written against the pre-0.24.1 loadDir shape (one fs.tree per
directory): its error branch stored { error } in the level cache and the
cache-hit guard `dataRef.current[dir] !== undefined` treated that failure as
"already loaded", so the automatic load path never re-requested a failed
level; only the force path (refresh tick / fence-notice retry) recovered.
FileTree.tsx has since been rewritten around batched loadLevels (one fs.trees
POST for the visible set, commit 98a446b ), but the bug survived the rewrite in
a new spot: BOTH failure branches now store an error in the same cache —
(a) a per-level `error` riding an otherwise-successful batch, and
(b) `{ error }` written by the whole-request catch for levels with no listing
— and the non-force `wanted` filter (`dataRef.current[path] === undefined`)
counted both as cache hits.
Port, in current idioms:
- The non-force filter now admits a cached entry only when it carries no
`error`: `cached === undefined || cached.error !== undefined`. The host
guarantees a failed level never carries entries (fs.trees returns
`{ entries: [], error }` in place), so `error` alone identifies "nothing
usable cached" for both failure branches.
- The empty `{}` placeholder of an in-flight load is still a hit, so a
re-render while a batch is open does not duplicate the request.
- The retry rides the batch route (wanted subset only; levels that DID list
stay cached) and reuses the existing non-force flow, which stores `{}`
first — same behavior the original fix gave loadDir.
- loadLevels' doc comment gains the "only a LISTING settles a level" rule.
Not ported: the original diff's comment wording about "the fence notice's
retry button" — that notice (and isOutsideWorkspaceMessage usage in the tree)
no longer exists in the current shape; recovery paths today are the refresh
tick and watch-notice/mutation re-lists, and after this fix any automatic
re-load of the expanded set.
Tests: tests/file-tree-level-retry.spec.tsx adapts the PR's spec to the
batched shape (fsTrees mock, batch-load-spec harness): (1) a per-level error
is re-requested as a batch of 1 on the next automatic load (with an added
assertion that an in-flight batch is NOT duplicated), (2) levels stored by a
failed whole request are all retryable. Both go red on the unfixed filter
(verified: "expected to be called 2 times, but got 1"). All 9 file-tree
suites (47 tests) and tsc --noEmit stay green.
2026-10-01 17:13:10 +08:00
HuanLinOTO
86ec5ccc75
Merge PR #736 : fix(native): focus through the controller on surface.activate; carry meta on close
...
# Conflicts:
# docs/external-plugin-guide.md
# src/client/native/surface.ts
# src/client/service.ts
2026-10-01 17:12:53 +08:00
HuanLinOTO
92ab1f83b8
Merge PR #776 : fix(native): 按会话记账 + 宿主 keepMounted,原生 tab 状态不再跨切换丢失(#636 #661)
...
# Conflicts:
# src/client/native/index.ts
# src/client/native/tab-adapter.tsx
2026-10-01 17:12:10 +08:00
HuanLinOTO
4e02951fb5
Merge PR #662 : fix(native): 文件 tab 图标不再依赖插件侧记录(Fixes #660)
...
# Conflicts:
# src/client/native/index.ts
2026-10-01 17:11:37 +08:00
HuanLinOTO
249968f48c
fix(paths): 识别 remote-mirror 工作区命名空间投影(#744 摘取 remote-mirror 半边,#788 #703)
...
摘取 PR #744 中 remote-mirror 命名空间投影这一半:resolveSessionPath 在
win32 上识别 dsh-remote 镜像会话的 cwd(<home>\.dsh\remote-workspaces\
<host-key>\<workspace>),读取镜像根的 .dsh-remote-meta.json 拿到远端
POSIX 工作区路径(mtime 失效的同步缓存),把命名空间下的远端绝对路径
(/srv/app/src/a.ts)投影到本地镜像目录(mirrorRoot\src\a.ts)——否则
win32 把它盘符根化成 C:\srv\... 导致交付物 ENOENT(#788 / #703 的
Windows 远程会话症状)。只投影落在远端工作区内的路径;区外路径
(/etc/hosts)刻意不投影。无元数据/元数据损坏/非 POSIX remotePath 时
一律放行原路径,不破坏请求。
相对 PR 原版的基线适配:main 的 path-security 重写已删除工作区围栏
(resolve-only),因此「区外路径不投影」的后果从「403 containment 拒绝」
变为「保持斜杠根化 → resolve() 盘符根化 → stat 失败报缺失本地文件」,
文档与测试注释已按此改写;投影决策本身不变。
明确丢弃的另一半(html 路由 cwd hint + $c/$r marker + media 路由
resolveWorkspaceRelative + intercept.tsx 取 cwd):
- cwd hint 半边已被 main 的 d71261ac(PR #372)缓解——sessionCwdOf 现有
header → clientCwd → persistence → process.cwd 回退链,覆盖 detach 场景;
- resolveWorkspaceRelative 与 main 的 resolveTarget 语义重复(后者已把
会话相对目标 join 到 cwd);
- src/client/intercept.tsx 在 main 上已整体删除(turnTail 交还宿主);
- path-security 报错文案子改动随 5c95002 重写失去载体。
PR 中的 html-route / paths / sandbox-views / smoke 测试改动同属该半边,
一并不取。html 路由 clientCwd 入口仍缺(#819,另由 #754 客户端侧覆盖),
不在本提交范围。
测试:tests/session-path.spec.ts 移植 dsh-remote mirror describe 块
(10 例:区内/根/嵌套会话投影、区外与同名前缀不投影、dot 段归一、盘符
路径保留、无/坏元数据放行、非 win32 不重释),18/18 绿。
2026-10-01 17:10:47 +08:00
HuanLinOTO
b47fb12457
Merge PR #652 : fix(state): contain a throwing store listener instead of blanking the sidebar
2026-10-01 17:08:18 +08:00
ymac
4f57cf886e
test(e2e): read the on-screen seat from the visible panel, not any seat
...
The lane's `onScreenSession` walked every `[data-sidebar-right-session]` element
and took the first without a `hidden` attribute. On 0.2.x the host marks BOTH
each RETAINED seat (one per Conversation stays in the DOM) AND each seat's panel
with that attribute, so the walk could name a background Conversation and the
A → B → A round trip failed on `selectConversation` (real mount lane: expected
`session-eeb1…`, read `session-b8e4…`, 60s timeout).
Read the panel that is actually laid out (`[data-sidebar-right-panel]:visible`) —
the same `:visible` convention the rest of this lane already uses — and keep a
visible-seat fallback. Mount lane: 10/10 (was 9/10).
2026-10-01 16:47:43 +08:00
ymac
d1c8208d56
Merge origin/main (v0.24.1, DSH 0.2.0-rc.1) into fix/native-tab-state-retention
...
Two conflicts, both in the native tab adapter's per-session work — main's
`5c95002` moved the expansion set into the plugin store's session state while
this branch moved the RECORD identity to `sessionId::tabId`:
- `src/client/native/tab-adapter.tsx`: keep main's store-backed expansion as
the authority (`attachStore` / `syncExpanded` / `getSessionStates().expanded`)
and this branch's seat-scoped identity (`views` keyed `sessionId::tabId`,
`get/has/update/drop/versionOf/retain` take the seat session). `toggleExpanded`
keeps main's active-`reduce` / background-`reduceFor` split, but locates the
record by its seat and writes the SCOPE session's set — the set every view of
that session mirrors.
- `tests/native-surface.spec.ts`: main's five expansion cases adapted to the
session-scoped API (seat session on `ensure`, two-arg `get`/`drop`, seat on
`toggleExpanded`); the branch's cases now bind a store before toggling, since
expansion no longer lives in the record itself.
The `files` takeover guard and its registration invariants come from
main; this merge drops the branch's duplicate.
2026-10-01 16:37:35 +08:00
HuanLinOTO
8c17648962
fix(tabbar): rightActions 按 review 修复 + 回归测试
...
逐条解决 Copilot review 的 6 条 findings:
1. 空结果不挂载 wrapper:TabBar 先解析 rightActions 节点,
null/undefined/false 直接不渲染容器(空容器是 flex item,
会改变所有既有 tab 栏的布局)。
2. resolver 传入 tab/paneId:签名扩为
(ctx, scope, state, tab, paneId)——single:false 且有分栏时同一类型
可同时开多个实例、每个 pane 各渲染自己的 tab 栏,工具栏操作必须
能定位到正确实例;paneId 与 state.activePane 比较可知聚焦 pane。
API 未发布(本 PR 新增),签名可直接演进。
3. CSS 不再等分:.tabBarRightActions 由 flex:1 改为 0 1 auto
(内容定宽、可收缩裁切),.tabList 独占剩余空间——等分会让
极小的工具栏砍掉 tab 滚动区一半宽度。
4. split 递归转发:NodeView 的递归调用补上 getTabRightActions
(此前 bottomSplits 一旦是 split,所有子 pane 的 resolver
全部丢失,工具栏静默不渲染)。
5. 指南 §7 canonical features 清单补 'rightActions'。
6. 新增 tests/tab-bar-right-actions.spec.tsx(5 用例):节点渲染
位置与参数、跟随活跃 tab、null/无 resolver 不挂载、嵌套 split
树逐 pane 转发(已做变异验证:删掉递归转发该用例即红)。
2026-10-01 16:03:14 +08:00
MXY
e1c7ac3491
fix(ws): fence 接受桌面壳页面 origin,补全自定义协议下的 WebSocket 修复
...
上一个提交把 WebSocket 的 base 改到 `__DSH_TRANSPORT__.streamBaseUrl`,解决了
`ws://app` 解析不了的问题;但握手仍然失败。桌面壳页面位于 `dsh-app://app`,
它的 WebSocket 升级直连 Host 的 loopback 地址(壳的 `protocol.handle` 不承载
upgrade),Chromium 因此带上 `Origin: dsh-app://app`。fence 按 hostname 比较,
字面量 `app` 永远不等于 `127.0.0.1`,socket 在 `handleUpgrade` 之前就被销毁。
HTTP 路由不受影响,原因在壳自己:它转发前会删掉 origin 头,Host 侧看到的是
无 Origin 请求,fence 本就放行。所以同一个 fence 只在 WebSocket 路径上暴露。
改动:fence 在 Host 检查通过之后接受精确字符串 `dsh-app://app` —— 与壳自身
request forwarder 的信任集合(非 null 时只认这一个)逐字一致。同 scheme 的
其他 origin、跨站 origin 仍然拒绝;无 Origin 的请求本来就走放行分支,因此这
不是在既有信任面之外新增入口。
测试:`tests/trusted-hosts.spec.ts` 新增 4 例,其中两条是负向控制(Host 非
我方时仍拒、精确匹配而非前缀匹配)。两条新断言各做过一次变异验证:禁用该
分支只让「接受」一例变红,改成前缀匹配只让「精确」一例变红。
2026-10-01 02:30:26 +08:00
kola
a9a7a9901a
Merge upstream main and preserve absolute preview paths
...
Resolve client preview paths against the session cwd. Limit the server file fallback to relative input and retain upstream absolute HTML path semantics. Cover nested assets, Windows/UNC paths, and external files with workspace shadows.
2026-09-30 13:26:10 +08:00
ZinChl
910c71ed16
fix(tasks): 任务页折叠守卫的三处不一致(根卡死控制 / run 成员绕过 leaf 测试 / 文档矛盾)(#784)
...
1. **根卡的折叠 chevron 是死控制**:绘制条件只有 `settled || state === 'idle'`,
没有「非根」判断;跳进子会话后 `current` 为假,已结算的根卡就会画出 chevron。
而模型里根节点是无条件 push 的,`foldedIds` 全模型只在子层与 run 成员两处消费,
根节点不查 → 点了没有任何变化。改为**根卡不画**:`parentId` 只在根行缺席,用它
做守卫;根卡是页面的锚点,本就不该被折叠(既有的
「The root IS the current session: never foldable」用例固化的就是这个语义)。
2. **run 成员折叠绕过 leaf 测试**:`tasks-model.ts` 的 run 成员分支只做
`(folded || foldedIds) && nodeFoldable(...)`,注释声称成员「leaves by
construction」,但成员常常是从 `agentChildren` **重挂载**过来的真实目录节点
(带 `hasChildren` 与 team 富集)——于是页面级折叠会把一个分支连同整棵子树
收进聚合,正是 `isAutoFoldable` 注释声称要防的形态。改为对**自动**触发器
走 `isAutoFoldable`(结构守卫:分支节点与自己有 run 的节点不折叠)。roster
守卫不适用(成员不是该父级的 roster 行,idle 人数是 roster 扫描规则),
注释里明确写下这条有意保留的差异。
3. **`foldedIds` 的接口文档自相矛盾**:文档写「never a branching one」,而实现
(`nodeFoldable`)只有 running/current 守卫。按 a7338be 的意图(chevron 画在
每张已结算卡上,加分支守卫只会制造更多死控制)实现是对的,删掉文档里那句。
测试(`tests/tasks-page.spec.tsx` +2,均实测回退即红):
- 根卡:读者身处子会话、根已结算时,根卡**不得**有折叠键(回退 TasksGraph 后红:
`expected <button> to be null`)。
- run 成员:重挂载的分支成员**不得**被自动折叠,而同批的叶子兄弟照常收进聚合
(回退 tasks-model 后红:`expected null not to be null`)。
2026-09-30 02:31:38 +08:00
ZinChl
e38aa56fec
fix(tasks): 会话「驻留」不再当作「agent 在跑」——崩溃重启后的子代理状态(#800)
...
宿主目录行的 `activity` 是**会话驻留**而非运行态(宿主自己的字段注释:
"recursive catalog listing observed a resident Session … does not encode a
durable outcome or guarantee continuation delivery")。崩溃重启后,DSH 打开
被中断子会话的历史流会把它 prepare → retain → attach 成驻留 Session,但不会
启动 agent,于是 `activity === 'running'` 成立、卡片显示「运行中」并附带实时
预览行,而实际上没有任何东西在跑。
权威运行位其实早就在手边:会话摘要的 `running`(根卡片已经在用,
`subagent-lineage` 统计后代也在用,DSH 官方子代理下拉同样用它)。改为
「摘要的 running 优先、目录标志兜底」:
- `src/client/tasks-model.ts`:子节点 activity/state 由
`summary.running ?? (view.running === true)` 决定。摘要没有该字段的老宿主
继续走目录标志,行为不变。
- `src/client/team-projection.ts`:同一规则(原先恰好相反,优先了驻留标志)。
测试:
- `tests/tasks-page.spec.tsx` 新增两条:驻留但未运行 → 不是 running 卡片
(旧代码下断言 `data-running` 为 null 会红);摘要无 running 字段 → 回落到
目录标志(旧行为保留)。同时把两条既有用例的 fixture 修正为两路一致
(原先 live 说 running、摘要说 false,本身自相矛盾)。
- `tests/team-projection.spec.ts` 新增两条:摘要 false + live true → idle;
摘要 true + live false → running。
2026-09-30 02:24:36 +08:00
ZinChl
38a82db0e3
fix(files): fs.trees 按宿主上限分块,展开集 ≥64 的会话不再整树报错(#799)
...
宿主对一次 `fs.trees` 批量请求有硬上限 `FS_TREES_MAX_PATHS = 64`,超限
**整批** `bad-request`;而客户端把 root + 全部展开目录放进**一次**请求
(loadLevels)。展开集按会话持久化,所以累计展开到 64+ 的用户每次挂载/刷新
都被整批拒绝,catch 把所有无缓存层写成 error —— 整棵树报错,只能手动折叠。
改动:
- 新增 `src/fs-batch.ts`:把行上限放成**两半共用的零依赖模块**(`prefs-shared.ts`
的同一模式),宿主 `src/index.ts` 改为 re-export,客户端按同一常量分块,
两边不会再漂移。
- `src/client/FileTree.tsx` 的 `loadLevels`:把可见集按上限切块、并发请求,
并保留批量路由的**逐层错误粒度**——某一批失败只标记它自己携带的层,
不会再把其它批已经拿到的列表一起标红(原先单请求失败时会标记全部
wanted)。缓存/代际(generation)语义不变。
- 宿主上限保持不动(那是针对恶意超大批量的防线)。
测试:`tests/file-tree-batch-load.spec.tsx` 新增两例——71 个可见路径切成
64 + 7 两批且每个路径恰好出现一次;某一批失败时另一批的层仍正常渲染。
回退 FileTree 的分块后这两例当场红、原有 8 例仍绿(已实测)。
2026-09-30 01:56:11 +08:00
ZinChl
214bf451a0
fix(files): 修 v0.24.1「压缩并下载」必然失败——archive.status 缺 sessionId + ready 交接无护栏(#798)
...
同一条轮询链上的两处,都在 #782 新增的 archive 功能里:
1. `archiveStatus(id)` 只发 `{ id }`,而宿主 `archive.status` 对 id 与
sessionId 都 `requireString`(src/index.ts)→ 第一次轮询即 400
`missing or invalid "sessionId"`,`state === 'ready'` 永远到不了,
整条链只有 build 成功。同族的 `archive.build` 与下载 URL 都带 scope,
只有这一处漏了。改为 `archiveStatus(scope, id)` 走 `scopePayload`。
2. `saveArchive` 是 fire-and-forget,`settleArchive()` 只在完成回调里执行,
于是 ready 之后 250ms 轮询照跑:下载路由是消费式的(GET 服务后释放任务),
首个 GET 未完成时会并发第二次 `save`(双下载),已完成时下一次 `status`
404 → 已成功的下载旁边同时挂一条 zipFailed。改为 ready 时先
`setArchiveJobId(null)` 停轮询,并用 `archiveHandedOffRef` 保证恰好一次交接。
测试:新增 `tests/archive-client.spec.ts` 钉客户端**真实载荷形状**(此前的
用例要么整体 mock 掉本模块、要么只测宿主侧),并给 FileTree 加一条
「ready 恰好交接一次」用例。回退 api.ts 的两个载荷断言、回退 FileTree 的
交接护栏,对应用例分别当场红(已实测)。
2026-09-30 01:52:59 +08:00