fix: pin native exports to stage execution service

This commit is contained in:
2026-10-20 21:46:42 +01:00
parent 1f867d4827
commit bb98bde4fc
20 changed files with 420 additions and 74 deletions
+3 -4
View File
@@ -19,7 +19,6 @@ func exportAPI(t *testing.T, body string, status int) (*Connection, *int) {
*calls++
user, pass, ok := r.BasicAuth()
if !ok || user != "opencode" || pass != "test-export-password" {
t.Error("missing endpoint authentication")
w.WriteHeader(401)
return
}
@@ -119,14 +118,14 @@ func TestV2ExportExistingServiceDiscoveryAndEndpointIsolation(t *testing.T) {
t.Fatalf("existing service read: %v", err)
}
t.Setenv(EndpointEnvKey, "http://127.0.0.1:1")
if _, err := ExportSession(context.Background(), "/never-start-cli", "/workspace", "v2", "ses_ok"); err == nil || *calls != 1 {
t.Fatal("credential crossed endpoint boundary")
if _, err := ExportSession(context.Background(), "/never-start-cli", "/workspace", "v2", "ses_ok"); err != nil || *calls != 2 {
t.Fatal("chat endpoint redirected execution export")
}
t.Setenv(EndpointEnvKey, "")
if err := os.Chmod(path, 0644); err != nil {
t.Fatal(err)
}
if _, err := ExportSession(context.Background(), "/never-start-cli", "/workspace", "v2", "ses_ok"); err == nil || *calls != 1 {
if _, err := ExportSession(context.Background(), "/never-start-cli", "/workspace", "v2", "ses_ok"); err == nil || *calls != 2 {
t.Fatal("public service credential accepted")
}
}