Skip to content

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

Stabilize release gate tests.

Justin D'Souzab1a0dae18d4f
diff --git a/cli/beacon/cmd/endpoint_test.go b/cli/beacon/cmd/endpoint_test.go
index 36ae95db..dcd3bc6e 100644
--- a/cli/beacon/cmd/endpoint_test.go
+++ b/cli/beacon/cmd/endpoint_test.go
@@ -100,10 +100,12 @@ func TestRepairInstalledEndpointUserConfigConfiguresNativeAndHooks(t *testing.T)
oldOpts := endpointOpts
oldActiveConsoleUser := activeConsoleUser
oldRunHookRepairAsUser := runHookRepairAsUser
+ oldLoadConfigForUserRepair := loadConfigForUserRepair
t.Cleanup(func() {
endpointOpts = oldOpts
activeConsoleUser = oldActiveConsoleUser
runHookRepairAsUser = oldRunHookRepairAsUser
+ loadConfigForUserRepair = oldLoadConfigForUserRepair
})
home := t.TempDir()
@@ -120,6 +122,9 @@ func TestRepairInstalledEndpointUserConfigConfiguresNativeAndHooks(t *testing.T)
endpointOpts.logPath = logPath
endpointOpts.hookHarnesses = "claude,codex,cursor,gemini"
endpointOpts.hookLevel = "user"
+ loadConfigForUserRepair = func(userMode bool, logPath string) endpointconfig.Config {
+ return endpointconfig.Default(userMode, logPath)
+ }
activeConsoleUser = func() (consoleUserInfo, bool, error) {
return consoleUserInfo{Username: "alice", HomeDir: home}, true, nil
}
diff --git a/cli/beacon/cmd/endpoint_user_config.go b/cli/beacon/cmd/endpoint_user_config.go
index 598f9788..ad9b9f28 100644
--- a/cli/beacon/cmd/endpoint_user_config.go
+++ b/cli/beacon/cmd/endpoint_user_config.go
@@ -46,6 +46,8 @@ type userConfigTargets struct {
hooks []string
}
+var loadConfigForUserRepair = loadConfigForMode
+
func runEndpointUserConfigRepairInstalled(cmd *cobra.Command, args []string) error {
result, err := repairInstalledEndpointUserConfig()
if endpointOpts.jsonOutput {
@@ -66,7 +68,7 @@ func repairInstalledEndpointUserConfig() (endpointUserConfigRepairResult, error)
return endpointUserConfigRepairResult{SkippedReason: "no_active_console_user"}, nil
}
- cfg := loadConfigForMode(false, endpointOpts.logPath)
+ cfg := loadConfigForUserRepair(false, endpointOpts.logPath)
if cfg.LogPath == "" {
cfg.LogPath = writer.DefaultPath(false)
}
diff --git a/cli/beacon/internal/ci/session_test.go b/cli/beacon/internal/ci/session_test.go
index 97e2ff95..4202f2c2 100644
--- a/cli/beacon/internal/ci/session_test.go
+++ b/cli/beacon/internal/ci/session_test.go
@@ -93,8 +93,18 @@ func TestStartStopCollectorProcess(t *testing.T) {
if err := session.Start(context.Background(), nil, nil); err != nil {
t.Fatalf("Start returned error: %v", err)
}
+ stopped := false
+ t.Cleanup(func() {
+ if stopped {
+ return
+ }
+ ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
+ defer cancel()
+ _ = session.Stop(ctx)
+ })
var data []byte
- for i := 0; i < 20; i++ {
+ deadline := time.Now().Add(5 * time.Second)
+ for time.Now().Before(deadline) {
var err error
data, err = os.ReadFile(session.ConfigPath + ".env")
if err == nil && len(data) > 0 {
@@ -113,6 +123,7 @@ func TestStartStopCollectorProcess(t *testing.T) {
if err := session.Stop(ctx); err != nil {
t.Fatalf("Stop returned error: %v", err)
}
+ stopped = true
}
func TestStartDetachedWritesStateAndExports(t *testing.T) {