Skip to content

The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu

fix

Justin D'Souza73b7ab696f8c
diff --git a/cli/beacon-hooks/internal/cloudshuttle/shuttle.go b/cli/beacon-hooks/internal/cloudshuttle/shuttle.go
index 3f6ab622..18abb22f 100644
--- a/cli/beacon-hooks/internal/cloudshuttle/shuttle.go
+++ b/cli/beacon-hooks/internal/cloudshuttle/shuttle.go
@@ -516,9 +516,6 @@ func cloudUploadFromEnv() string {
case uploadGCS:
return uploadGCS
}
- if strings.TrimSpace(os.Getenv("BEACON_CLOUD_S3_BUCKET")) != "" {
- return uploadS3
- }
return uploadGCS
}
diff --git a/cli/beacon-hooks/internal/cloudshuttle/shuttle_test.go b/cli/beacon-hooks/internal/cloudshuttle/shuttle_test.go
index 03af7da8..d7064994 100644
--- a/cli/beacon-hooks/internal/cloudshuttle/shuttle_test.go
+++ b/cli/beacon-hooks/internal/cloudshuttle/shuttle_test.go
@@ -166,6 +166,22 @@ func TestConfigFromEnvSelectsS3(t *testing.T) {
}
}
+func TestConfigFromEnvDefaultsToGCSWhenS3BucketIsAlsoSet(t *testing.T) {
+ t.Setenv("BEACON_CLOUD_UPLOAD", "")
+ t.Setenv("BEACON_CLOUD_GCS_BUCKET", "gcs-bucket")
+ t.Setenv("BEACON_CLOUD_GCS_PREFIX", "gcs-prefix")
+ t.Setenv("BEACON_CLOUD_GCS_CREDENTIALS_B64", "gcs-credentials")
+ t.Setenv("BEACON_CLOUD_S3_BUCKET", "s3-bucket")
+
+ cfg := ConfigFromEnv()
+ if cfg.Upload != uploadGCS {
+ t.Fatalf("Upload = %q, want %q", cfg.Upload, uploadGCS)
+ }
+ if cfg.Bucket != "gcs-bucket" || cfg.Prefix != "gcs-prefix" || cfg.CredentialsB64 != "gcs-credentials" {
+ t.Fatalf("unexpected GCS config: %#v", cfg)
+ }
+}
+
func TestUploadSendsJSONLToS3(t *testing.T) {
var uploadedPath, uploadedAuth, uploadedDate, uploadedHash, uploadedToken, uploadedType, uploadedBody string
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {