feat(dashboard): 补齐外置客户端桥接能力 - #621
Merged
Merged
Conversation
bootstrap() 之前是「建 EventSource → 等 onopen(10s 超时)→ 才拉快照」, 失败路径还 es.close()。SSE 经反代(nginx 默认 proxy_buffering on)或平台隧道 被缓冲时,快照根本不会去拉,页面停在空列表;close() 又掐掉了 EventSource 自带的重连,用户不手动刷新就再也回不来——把「丢实时更新」的降级放大成了全挂。 改成:首屏快照立刻拉,不等 onopen;改为在每次 open(含第一次)上做一次 reconcile。第一次也要 reconcile 是因为 new EventSource 不等于服务端监听已 建立,先于订阅生成的快照可能漏掉窗口期的事件——这正是原来等 open 想保证的 性质,用 reconcile 换个方式拿回来。失败时保留流不关,交给 EventSource 自己 重连,open 处理器负责恢复。代价是首屏多一轮快照请求。 顺带两处: - syncSubscriptions 的头像回填双向生效,bot 清空头像时不再残留旧图。 - 修正 session-presentation 的注释:idle/limited 边界的刷新是每会话每轮一次 git rev-parse(有并发上限兜底),不是 "low-frequency" 的后台轮询。
review PR #621 发现:window-size 从 latest 改成 largest 时(commit 3d6935f), 配套的 test/web-terminal-tmux-window-size.test.ts 被一并删掉,导致该行改动零 测试覆盖。补回该文件并对齐当前实现——断言 `largest`(共享观看场景下不让新 attach 的小窗口缩小所有客户端)+ `timeout: 3000`(tmux 控制 socket 卡住时不 阻塞 attach)。 pnpm build ✅ / 该测试单跑 1 passed ✅ Co-Authored-By: Claude <noreply@anthropic.com>
deepcoldy
approved these changes
Jul 27, 2026
deepcoldy
left a comment
Owner
There was a problem hiding this comment.
Reviewed in an isolated worktree off PR head. pnpm build ✅ and the PR's 11 dashboard/session/tmux test files (162 tests) all pass; PR is cleanly based on latest master with green CI.
Verified the security-sensitive surfaces:
- New
/api/asks/*routes are fail-closed: browser side gated bydecideDashboardAuthmanagement token (not on the public allow-list), aggregator→daemon hop signs the route-bound trusted-host HMAC. gitBranchis redacted from the public/api/sessions+/eventssurfaces (incl.session.updatepatches).- Git enrichment uses
execFile(no shell), with timeout + concurrency cap + positive/negative TTL cache; worktree/detached/non-repo boundaries all correct. - SSE first-paint reconcile buffers races and converges deletes on every open (newer-wins), covered by tests.
Follow-up pushed on top (e2e2b77): restored the test/web-terminal-tmux-window-size.test.ts that had been dropped when window-size changed latest→largest, so that line is covered again.
Note for the author: the PR description still says window-size=latest — the code is largest. Please sync the description.
This was referenced Jul 27, 2026
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.
背景
Desktop 与 Mobile 客户端已经拆到独立仓库维护,botmux daemon 需要提供稳定、可探测的 Dashboard/会话桥接契约,同时明确 Workflow 与 Web Terminal 的客户端边界。
改动内容
/__desktop/compat升级为 Dashboard Protocol v2,返回运行时机器身份、模块清单和细粒度 capability;Workflow 明确标记为不支持。/api/sessions的展示字段:按缓存补充机器人头像、Git 仓库名和分支,旧消费者可继续忽略新增字段。window-size=latest,避免共享窗口遗留手动尺寸导致终端无法自适应。影响面
验证
pnpm build✅pnpm test -- test/dashboard-sessions-ui.test.ts test/desktop/dashboard-client-shell.test.ts test/desktop/dashboard-compat.test.ts test/session-row-enrichment.test.ts test/web-terminal-tmux-window-size.test.ts✅ 5 files / 41 testsgit merge-tree --write-tree origin/master HEAD✅ 与最新master预合并无冲突pnpm testtest/v3-distillation-runner.test.ts受当前环境凭证/路由变量影响,test/vc-meeting-daemon-session.test.ts出现超时与远端路由断言失败。相关 Dashboard/Session/Tmux 回归均通过。