提交记录修改internal/workbench/cli_channel_test.go+14 −1看文件
| @@ -137,7 +137,20 @@ func TestImportedCLIUUIDIsIndependentOfPublicSessionID(t *testing.T) { | ||
| 137 | 137 | func TestArchivedCLIHistoryIsNotRediscovered(t *testing.T) { |
| 138 | 138 | s, id, project := metadataFixture(t) |
| 139 | 139 | 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.MkdirAll(bin, 0700); err != nil { | |
| 142 | 新增: t.Fatal(err) | |
| 143 | 新增: } | |
| 144 | 新增: // This archived history has no live CLI process. Keep the real discovery | |
| 145 | 新增: // helper and SSH path independent of a developer's installed Claude CLI. | |
| 146 | 新增: cli := "#!/bin/sh\n[ \"$#\" -eq 2 ] && [ \"$1\" = agents ] && [ \"$2\" = --json ] || exit 64\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")}) | |
| 141 | 154 | record, err := s.mobileCLI.record(s.profile, id) |
| 142 | 155 | if err != nil { |
| 143 | 156 | t.Fatal(err) |

