fix(dashboard): 修复 master build 红——ls 唤醒对齐通用远程后端守卫 - #957
Closed
deepcoldy wants to merge 1 commit into
Closed
Conversation
#912 在 dashboard-ipc-server.ts 的 `/api/sessions/:id/wake` 路由用了 `isRiffBackendSession(ds)` 但未 import 该符号(文件只 import 了 `isRemoteBackendSession`)→ tsc 报错 TS2552,pnpm build 恒挂,master CI build 一直红,挡住所有 PR。 修法不是补 import,而是对齐本仓既有约定:wake 与 restart/cd 一样是 "销毁本地 pane 再 fork 恢复"语义,远程后端(riff **和** mojo)的 lineage 不在本地 pane 里,都不该被 ls 唤醒 fork。#912 用 riff-only 谓词正是 `worker-remote-retirement-protocol` 守卫测试专门防的回归类(mojo 会从 riff-only 守卫溜过去)。改为通用 `isRemoteBackendSession`,错误码对齐 兄弟路由的 `remote_<verb>_unsupported` 命名(`remote_wake_unsupported`), 并补中英 i18n 文案 `cmd.wake.remote_unsupported`(与 restart/cd/takeover 同风格)。原 `riff_wake_unsupported` 错误码无任何外部消费方(CLI ls 客户端 只透传 body.error,不 switch),重命名安全。 影响面:daemon dashboard IPC 的 ls-wake 路由;只收紧(riff→riff+mojo), 不放宽;非远程(本地 pty/tmux)会话行为不变。 验证: - tsc --noEmit 干净;pnpm build 干净(此前恒红,现绿)。 - worker-remote-retirement-protocol 守卫测试转绿(12/12,此前该文件 1 红卡在 dashboard-ipc-server 的 riff-only 调用)。 - dashboard-ipc wake 测试新增用例:remote 后端会话 wake 返回 409 remote_wake_unsupported 且不 forkWorker;反向变异(去掉守卫)该用例 转红(200 to be 409)。 - i18n 相关 + dashboard-ipc 全量 445+154 绿。 Co-Authored-By: Claude <noreply@anthropic.com>
Owner
Author
|
关闭:master 3db351d(fix(daemon): /wake 守卫对齐 isRemoteBackendSession + 补测)已用同样的正解落地本 PR 的修复(/wake 改通用 isRemoteBackendSession + remote_wake_unsupported + picker fixture 补 0600),两处测试红已在 master 修绿。本 PR 冗余,关闭。 |
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.
改了什么
修复 master build 恒红:
#912(ls 自动唤醒休眠会话)在src/core/dashboard-ipc-server.ts的POST /api/sessions/:id/wake路由里调用了isRiffBackendSession(ds),但该文件只import了isRemoteBackendSession,漏了这个符号 →tsc报TS2552: Cannot find name 'isRiffBackendSession'→pnpm build恒挂。master CI 当前就是红的(
bd5d5b95a/101ffc67b的 CI 均 failure),挡住所有 PR 的绿。为什么这么修(不是补 import)
补上 import 能让它编译,但会留下一个语义回归:
wake与restart/cd同属"销毁本地 pane 再 fork 恢复"语义,而远程后端(riff 和 mojo)的 lineage 不在本地 pane 里,都不该被botmux ls唤醒 fork。用 riff-only 谓词正是test/worker-remote-retirement-protocol.test.ts守卫测试专门盯防的回归类——mojo 会从 riff-only 守卫溜过去(该测试注释:"a copied riff-only guard ... goes red here instead of waiting for a reviewer")。所以对齐本仓既有约定:
isRemoteBackendSession(ds)(与 restart 路由dashboard-ipc-server.ts:1223、cd 路由:1786一致)。remote_<verb>_unsupported命名 →remote_wake_unsupported(原riff_wake_unsupported无任何外部消费方:CLIls客户端cli.ts:5460只透传body.error,不 switch,重命名安全)。cmd.wake.remote_unsupported,与cmd.{restart,cd,takeover}.remote_unsupported同风格。影响面
测试验证
pnpm build干净(tsc + typecheck:scripts + dashboard bundle + audit);此前恒红,现绿。test/worker-remote-retirement-protocol.test.ts守卫测试转绿(12/12;此前该文件 1 红,正卡在 dashboard-ipc-server 的 riff-only 调用)。test/dashboard-ipc.test.ts新增用例:remote 后端(riff/mojo)会话 wake → 409remote_wake_unsupported且不forkWorker;反向变异(去掉该守卫)用例转红(expected 200 to be 409),确认有牙。🤖 Generated with Claude Code