跳到主要内容

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

提交记录
修改internal/cage/storage_test.go+5 −0看文件
@@ -5,7 +5,9 @@ import (
55 "context"
66 "os"
77 "path/filepath"
8新增: "runtime"
89 "strconv"
10新增: "strings"
911 "testing"
1012)
1113
@@ -200,6 +202,9 @@ func TestStorageAcrossMountedVolume(t *testing.T) {
200202 t.Fatal(err)
201203 }
202204 t.Cleanup(func() { os.RemoveAll(testDir) })
205新增: if runtime.GOOS == "windows" && strings.EqualFold(filepath.VolumeName(profile), filepath.VolumeName(testDir)) {
206新增: t.Fatal("CAGE_TEST_STORAGE_VOLUME must be on a different drive from the temporary profile")
207新增: }
203208 data := make([]byte, 2<<20)
204209 copy(data[len(data)-32:], []byte("second volume"))
205210 rel := filepath.Join("lima", "guest", "disk")
修改scripts/ci-windows-build.ps1+17 −5看文件
@@ -13,6 +13,8 @@ $certificates = @()
1313$qemuSource = $null
1414$savedPath = $env:PATH
1515$savedCertificate = $env:CAGE_WINDOWS_CERT_SHA1
16新增:$savedStorageVolume = $env:CAGE_TEST_STORAGE_VOLUME
17新增:$storageTestRoot = $null
1618try {
1719 $actual = (& git rev-parse HEAD).Trim()
1820 if ($LASTEXITCODE -ne 0 -or $actual -ne $env:CAGE_BUILD_REF) { throw 'Checkout differs from the requested commit.' }
@@ -66,13 +68,21 @@ try {
6668 '-GuestToolsDirectory', "$repository/_output/windows-amd64/app/resources/guest-os")
6769 }
6870 Invoke-BuildTool 'dotnet' @('run', '--project', 'desktop/windows.tests/Cage.Windows.Tests.csproj')
71新增: # RUNNER_TEMP and the checkout share D: on hosted runners. Use a
72新增: # unique system-drive directory, outside user data, for the other side.
73新增: if (-not $env:CAGE_TEST_STORAGE_VOLUME) {
74新增: $systemDrive = [IO.Path]::GetPathRoot($env:SystemRoot)
75新增: $testDrive = [IO.Path]::GetPathRoot((Get-WindowsWorkbenchTestBase))
76新增: if ($systemDrive -ne $testDrive) {
77新增: $storageTestRoot = (New-Item -ItemType Directory -Path (Join-Path $systemDrive ('cage-storage-volume-' + [guid]::NewGuid().ToString('N')))).FullName
78新增: $env:CAGE_TEST_STORAGE_VOLUME = $storageTestRoot
79新增: Write-Host "Storage migration tests use separate drives: $testDrive -> $systemDrive"
80新增: } else {
81新增: Write-Warning 'No second test volume is configured; the cross-volume storage test will be skipped.'
82新增: }
83新增: }
6984 Invoke-InIsolatedTestTemp {
7085 Invoke-BuildTool 'go' @('test', './internal/workbench', './internal/appupdate', './internal/host', './internal/managedproxy', './internal/env', './internal/paths', './internal/mounts')
71删除: # Exercise a second volume when the runner keeps its workspace and temp on different drives.
72删除: if ($env:GITHUB_WORKSPACE -and -not $env:CAGE_TEST_STORAGE_VOLUME -and
73删除: [IO.Path]::GetPathRoot($env:GITHUB_WORKSPACE) -ne [IO.Path]::GetPathRoot([IO.Path]::GetTempPath())) {
74删除: $env:CAGE_TEST_STORAGE_VOLUME = $env:GITHUB_WORKSPACE
75删除: }
7686 Invoke-BuildTool 'go' @('test', './internal/cage', '-run', 'Test(Storage|Gate|ProxyRevision|ConfigChange|JobStop|CONNECT|SOCKS|DNS|RejectHostLAN|Credentials|ProxyHostname|SafetyReport|Renew)')
7787 Invoke-BuildTool 'go' @('test', './internal/vm', '-run', 'Test(NetworkConfined|WindowsQEMUIdentity)')
7888 Invoke-BuildTool 'go' @('test', 'github.com/lima-vm/lima/v2/pkg/driver/qemu', '-run', 'Test(WindowsFirmwareArgument|WindowsPackagedFirmwareBeatsOldUserCopy|WHPXQEMU64Features|WindowsCPUResolution)$')
@@ -101,6 +111,8 @@ try {
101111 # Verified QEMU sources remain in the build cache; packaging copies them separately.
102112 $env:PATH = $savedPath
103113 $env:CAGE_WINDOWS_CERT_SHA1 = $savedCertificate
114新增: $env:CAGE_TEST_STORAGE_VOLUME = $savedStorageVolume
115新增: if ($storageTestRoot) { Remove-Item -LiteralPath $storageTestRoot -Recurse -Force -ErrorAction SilentlyContinue }
104116 Remove-Item Env:CAGE_ESIGNER_PASSWORD, Env:CAGE_ESIGNER_TOTP_SECRET -ErrorAction SilentlyContinue
105117 Pop-Location
106118}