Repository navigation
feat(dashboard): 沙盒切换确认、会话沙盒提示与独立 config.toml 重新同步 - #2544
Merged
Merged
Conversation
- 切到白名单隔离 / scratch 前弹确认,取消不保存;切回关闭不弹 - 沙盒模式「oncall 分享」更名为「白名单隔离」,说明写明只对新会话生效、不影响谁能对话 - 飞书会话卡:会话冻结为白名单隔离 / scratch 时多一行沙盒说明;未开沙盒的卡片逐字节不变 - 会话列表 / 看板卡:冻结沙盒与 bot 当前配置不一致时显示徽标 - 零注入不支持时按原因(CLI / 后端 / scratch / zmx)给出说明 - 开了沙盒的 bot 在动态单卡设置旁提示不生效 - Skill 更新成功后提示运行中的会话需 /restart 或新开会话 - 独立 CODEX_HOME 的 Codex bot 显示 config.toml 路径,可从宿主重新同步(先备份为 config.toml.bak-<时间>,均 0600) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
同一 Bot 的会话共用 CLI 数据目录与会话库,白名单隔离并不隔开同一 Bot 的其它会话。 Co-Authored-By: Claude Opus 5.5 <[email protected]>
deepcoldy
requested review from
47seek,
LucasIcarus,
xiaoxueSunn and
xiongz-c
as code owners
October 29, 2026 18:49
Co-Authored-By: Claude Opus 5.5 <[email protected]>
botUsesIsolatedCodexHome 此前只看 cliId/sandbox/readIsolation/codexAuthSync/wrapperCli, 与 worker 的 willRedirectCliData 在两类配置上分叉,导致 Dashboard 亮出错误路径、 「从宿主重新同步」回 200「已同步」但新会话根本不读该文件: - riff / remote-runner / 可证远端 mojo:本地无 Codex 进程,resolveLocalSandboxMode 收敛为 off,sandbox 驱动的 BOT_HOME 重定向不发生(riff+isolated 的 force 路径虽 provision BOT_HOME,远端进程也不读)。改用与 worker 同源的 localSandboxApplies 判定,mojo 用静态 mojo 块 + 顶层 wrapperCli/env 构造 remote 证明(loader-hook env 存在时只可能判成「本地」,方向安全)。 - codexInstancePool.enabled:新普通会话绑定 pool/default 实例自有 CODEX_HOME (worker legacyHomePolicy=false),直接排除。 CodexIsolatedConfigInfo 的刷新依赖补 backendType;补 10 个远端/实例池 it.each 用例。 变异复验:去远端豁免 4 红、去 pool 排除 1 红。 Co-Authored-By: Claude Code <[email protected]>
上一提交(80bd7fc49)的远端豁免建立在未配对的 backendType 上,方向反了: worker-pool 在每次 spawn 前先 resolvePairedSpawnBackendType,本地 CLI(codex) 若配置成远端后端 id(riff/mojo/remote-runner)会配对回落 daemon 默认(或 pty), 仍然是本地 Codex、BOT_HOME 重定向照常发生。因此对 codex 而言 backendType 结构性 不影响答案,整段 localSandboxApplies/mojoRemoteProof 远端判定是死代码,还把 2c68b7c 本来正确的 riff/remote-runner/mojo 配置改成假阴性(区块消失 + resync 409)。 同时池判据从 enabled===true 改为「池存在即排除」:newSessionCodexInstanceState 是 if(!pool) return {},enabled:false 只停止随机分配、仍给新会话 source:'default' 绑定(docs 推荐用法),worker legacyHomePolicy 仍为 false,BOT_HOME 副本无人读。 - 删 backendType/mojo/env 入参与 mojoRemoteProof、codexInstancePoolEnabled,净减代码 - CodexIsolatedConfigInfo effect 去掉 backendType 依赖 - 测试按 resolvePairedBackendId 真实口径重写:本地 CLI 配远端 id(含塞进完整 cfg 的 backendType)仍为 true;池存在(含 enabled:false)为 false - 变异双引擎咬红:池退回只认 enabled→2 fail;加回 riff 假阴性→1 fail Co-Authored-By: Claude Code <[email protected]>
This was referenced Oct 29, 2026
added 2 commits
October 30, 2026 08:08
双审通过后 master 新进 7 个 PR;与本 PR 改动的 3 个同文件(dashboard-ipc-server / worker-pool / worker)经 merge-tree 检测零冲突,区域互不重叠。同步以在最新主干上跑 CI。
added 2 commits
October 30, 2026 14:57
#2552「会话控制页精简为看板+表格、下线团队协作页」与本 PR 同在 sessions-page.tsx 产生真实内容冲突,手工解决,保留双方意图: - 取 #2552 重构后的页面为基础(BoardCard 已拆出为 sessions-kanban.tsx 的 SessionsKanbanView,新增 Drawer 详情)。 - 本 PR 的沙盒漂移徽标 SandboxDriftChip 抽到新叶子组件 session-sandbox-drift-chip.tsx(只依赖 ./ui 的 t,避免 sessions-page ↔ sessions-kanban 循环 import),并恢复到 #2552 中与原两处等价的落点: 会话表格 status 列、kanban 卡片头徽标行(旧 BoardCard 的直接等价物)。 Drawer 详情抽屉是 #2552 新增 UI 面,按最小/不夹带原则本 PR 不主动加入。 - i18n 自动合并:#2552 的 groups.* 与本 PR 的 sandboxDrift 等 key 并存无冲突。 - 测试 dashboard-sandbox-hints-ui 的组件 import 改指新叶子文件。 - 合成树 tsc 0、build 0、vitest 8 文件 148(含 #2552 的 kanban 三测)、bun 30。
a247797 之后 master 进 #2547/#2577/#2580/#2563/#2540。3 文件 4 块冲突人工合成: - dashboard-ipc-server.ts:import 两边都留(本 PR 的 existsSync 与 #2540 的 sandbox-network-policy import),不重复 readFileSync。 - bot-defaults-page.tsx:保留 #2540 改的 export function SandboxSection,本 PR 的 CodexIsolatedConfigInfo 同存;networkUnsupported 调用逻辑已随 master 自动取三分支。 - i18n.ts(zh/en 真语义冲突): networkRequirements 合成双方意图「需 Linux 本地 PTY 后端 + 白名单隔离沙箱」; 删掉本 PR 仍引用的旧 networkUnsupported 单 key,采用 #2540 的 networkUnsupportedPlatform/Backend/Mode 三新 key,并把其中 oncall 文案 (Mode、networkPolicyBlocksChange)按本 PR 改名同步为白名单隔离/allowlist-isolation。 zh/en 各 3959 key 完全对称、无重复。 - 补落点回归 test/session-sandbox-drift-placement.test.ts(新增):钉 SandboxDriftChip 在会话表格 status 列与看板卡片头两个主视图都接上(#2552 拆分后 易在解冲突时丢失);SessionsTableBase 改 export 供断言。删任一落点双用例分别咬红。
本 PR 给 SandboxSection 切沙盒模式加了前置 confirm();#2540 的 dashboard-network-policy-section「配了策略切模式要有人话提示」用例点击 sandbox-mode-scratch 时既没 mock confirm 也没有确认框 DOM,await 永不 resolve、PUT 发不出去,data-sandbox-status 为空而失败(master 9b55441 单跑该文件 7/7,合入本 PR 后 1 红)。 补 confirm→true mock(与 dashboard-sandbox-hints-ui 同一写法):测试关心的是 「用户确认后策略拦截的 400 报错」,产品行为不变(确认后仍发 PUT 并显示 networkPolicyBlocksChange)。反向验证 confirm→false 时该用例红,证明取消 确实不发 PUT、mock 不是无脑放行。 Co-Authored-By: Claude Code <[email protected]>
37e8079(含 #2540 确认框 mock 的 P1 修复)之后 master 进 #2546/#2556。 - bot-payload.ts 同位置两个纯加法冲突,两字段都保留:本 PR 的 readIsolation 与 #2546 的 sandboxPathsForbiddenReadWrite(相邻不同字段,无语义冲突)。 - i18n/worker/dashboard-ipc-server/bot-defaults-page 自动合并;#2546/#2556 新增 i18n 文案无 oncall 残留,zh/en 各 3960 key 对称无重复。 - #2556 引入 @base-ui/react 依赖(package.json/bun.lock),worktree 独立 node_modules 已 bun install --frozen-lockfile(@base-ui/[email protected])。 合并树验证(按 G7 含 master 侧被改文件测试):tsc 0、build 0;vitest 161 文件 3338(dashboard 全前缀含 network-policy P1 用例 + #2546 sandbox-path-guard/-normalize + bot-config-store + #2556 base-ui 回归);bun codex-isolated-config 30、 sandbox-path-guard 11、sandbox-paths-normalize 11。
Owner
Author
|
合码回执:已合入 master |
This was referenced Oct 30, 2026
This was referenced Oct 30, 2026
|
@deepcoldy 合入 master 后的 Midscene E2E 失败:Feishu live Midscene 失败。 这次运行覆盖 89a9cea…22d1c8d0b(20 个提交),同批合入的还有 #2546 #2556 #2589 #2591 #2545 #2538 #2595 #2596 #2597 #2581 #2539 #2598 #2515 #2536 #2575 #2366 #2606 #2593 #2603,失败不一定由本 PR 引起。
|
This was referenced Oct 30, 2026
|
🚀 Released in v3.56.0 |
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.
背景
Botmux 交流群的用户反馈(看板 #97 / #93 / #94):Dashboard 上点一下就切成了 scratch,用户完全不知道自己开了沙盒;改了沙盒以为立刻生效;零注入、动态单卡在沙盒下不可用但界面不说为什么;Codex 独立
config.toml只复制一次,宿主改了不跟;「oncall 分享」这个名字让人以为和 Oncall 值班 / 谁能对话有关。改了什么
session.*golden 用例守着)。zeroPromptInjectionUnsupportedReason()返回cli_unsupported / backend_unsupported / scratch_unsupported_for_cli / zmx_unsupported_for_antigravity,原supportsZeroPromptInjection()改为它的薄包装,调用方不动;界面按原因说明要改哪一项。readIsolation)时,卡片区块的动态单卡设置旁直接标「本 bot 已开沙盒,动态单卡不生效」。config.toml仍只复制一次。Codex bot 用独立 CODEX_HOME 时,Codex 认证区块显示「本 bot 使用独立 config.toml:<路径>」和「从宿主重新同步」按钮:先确认;daemon 把现有文件备份成config.toml.bak-<时间>再用宿主~/.codex/config.toml覆盖,两者都是 0600,拒绝被换成符号链接的目标;宿主文件不存在返回 404,bot 没用独立 CODEX_HOME 返回 409。新接口GET /api/bot-codex-config、POST /api/bot-codex-config/resync(daemon 侧requireBoundBot,dashboard 照现有方式代理)。只对新会话生效。bots.json取值oncall不变。顺带把原帮助里「读不到其它会话」改准为「读不到其它 Bot 的数据」:同一 Bot 的会话共用 CLI 数据目录与会话库。截图(合成数据渲染真实组件)
截图之后把确认框里「读不到其它会话的数据」改成了「读不到其它 Bot 的数据」,其余文案与截图一致。
影响面
config.toml,不读文件内容,不碰宿主文件。BOTMUX_SANDBOX覆盖不在其中(与 Dashboard 现有沙盒展示口径一致)。core/zero-prompt-support.ts(纯重构,布尔结果不变)、core/dashboard-rows.ts(多一个可选字段)、im/lark/card-builder.ts(多一个可选参数,8 个调用点传入)。验证
bun run build(含 tsc)通过。bot-defaults-save、card-builder*(含 wire golden)、codex-auth-sync、codex-isolated-config(新)、dashboard-daemon-proxy-routes、dashboard-i18n*、dashboard-sandbox-hints-ui(新)、prompt-injection、sandbox-mode、session-sandbox-hints(新)、zero-prompt-*→ 15 files / 930 passed。变异验证(每条单独改回):
session.*golden 红readIsolation🤖 Generated with Claude Code