Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
74 lines
1.8 KiB
Go
74 lines
1.8 KiB
Go
package runtimeprep
|
|
|
|
import (
|
|
"runtime"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestCodexConfigWithTuttiWindowsSandboxPinsUnelevated(t *testing.T) {
|
|
if runtime.GOOS != "windows" {
|
|
t.Skip("Windows session config policy")
|
|
}
|
|
|
|
got, changed := codexConfigWithTuttiWindowsSandbox(`model = "gpt-5.6-luna"
|
|
|
|
[windows]
|
|
sandbox = "elevated"
|
|
|
|
[tutti]
|
|
conversationDetailMode = "coding"
|
|
`)
|
|
if !changed {
|
|
t.Fatal("changed = false, want true")
|
|
}
|
|
if want := `sandbox = "unelevated"`; !containsConfigLine(got, want) {
|
|
t.Fatalf("config missing %q:\n%s", want, got)
|
|
}
|
|
if containsConfigLine(got, `sandbox = "elevated"`) {
|
|
t.Fatalf("config retained elevated sandbox:\n%s", got)
|
|
}
|
|
}
|
|
|
|
func TestCodexConfigWithTuttiWindowsSandboxAddsSection(t *testing.T) {
|
|
if runtime.GOOS != "windows" {
|
|
t.Skip("Windows session config policy")
|
|
}
|
|
|
|
got, changed := codexConfigWithTuttiWindowsSandbox("model = \"gpt-5.6-luna\"\n")
|
|
if !changed {
|
|
t.Fatal("changed = false, want true")
|
|
}
|
|
if want := "[windows]\nsandbox = \"unelevated\""; !containsConfigBlock(got, want) {
|
|
t.Fatalf("config missing Windows sandbox block %q:\n%s", want, got)
|
|
}
|
|
}
|
|
|
|
func TestCodexConfigWithTuttiWindowsSandboxIsIdempotent(t *testing.T) {
|
|
if runtime.GOOS != "windows" {
|
|
t.Skip("Windows session config policy")
|
|
}
|
|
|
|
content := "[windows]\nsandbox = \"unelevated\"\n"
|
|
got, changed := codexConfigWithTuttiWindowsSandbox(content)
|
|
if changed {
|
|
t.Fatal("changed = true, want false")
|
|
}
|
|
if got != content {
|
|
t.Fatalf("content changed:\ngot:\n%s\nwant:\n%s", got, content)
|
|
}
|
|
}
|
|
|
|
func containsConfigLine(content, line string) bool {
|
|
for _, candidate := range strings.Split(strings.ReplaceAll(content, "\r\n", "\n"), "\n") {
|
|
if candidate == line {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
func containsConfigBlock(content, block string) bool {
|
|
return strings.Contains(content, block)
|
|
}
|