跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

提交记录

隔离会话归档测试的 Claude CLI 依赖

为真实 SSH 和会话发现入口提供仅接受 agents --json 的临时 Claude 命令,并在临时登录配置中固定 PATH。主线与 PR 的 CI 均缺少该依赖,本机已安装 CLI 曾掩盖测试缺口。 独立 PATH 实验可复现旧测试失败。修复后归档、运行状态和 Python 协议测试连续三次通过 race 检查。

作者
Lee-xeo
时间
2026/11/09 23:20
提交
ff76706
上一个
c34f090
这个版本的全部文件
修改internal/workbench/cli_channel_test.go+14 −1看文件
@@ -137,7 +137,20 @@ func TestImportedCLIUUIDIsIndependentOfPublicSessionID(t *testing.T) {
137137func TestArchivedCLIHistoryIsNotRediscovered(t *testing.T) {
138138 s, id, project := metadataFixture(t)
139139 home, _ := filepath.EvalSymlinks(t.TempDir())
140删除: mobileTestSSH(t, s, home, []string{"HOME=" + home, "PATH=/usr/bin:/bin:/usr/local/bin", "CLAUDE_CONFIG_DIR=" + filepath.Join(home, ".claude")})
140新增: bin := filepath.Join(home, "bin")
141新增: if err := os.Mkdir(bin, 0700); err != nil {
142新增: t.Fatal(err)
143新增: }
144新增: // Discovery queries the CLI through the guest login shell. Keep that
145新增: // command local to the fixture while exercising the real discovery path.
146新增: const cli = "#!/bin/sh\n[ \"$#\" -eq 2 ] && [ \"$1\" = agents ] && [ \"$2\" = --json ] || exit 2\nprintf '[]\\n'\n"
147新增: if err := os.WriteFile(filepath.Join(bin, "claude"), []byte(cli), 0700); err != nil {
148新增: t.Fatal(err)
149新增: }
150新增: if err := os.WriteFile(filepath.Join(home, ".bash_profile"), []byte("export PATH="+shellescape.Quote(bin)+":/usr/bin:/bin\n"), 0600); err != nil {
151新增: t.Fatal(err)
152新增: }
153新增: mobileTestSSH(t, s, home, []string{"HOME=" + home, "PATH=" + bin + ":/usr/bin:/bin", "CLAUDE_CONFIG_DIR=" + filepath.Join(home, ".claude")})
141154 record, err := s.mobileCLI.record(s.profile, id)
142155 if err != nil {
143156 t.Fatal(err)