Skip to content

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

Skip Muse in the project-level --all hook sweep

Claudea5cd60e82c67
diff --git a/cli/beacon/cmd/endpoint_diagnostics.go b/cli/beacon/cmd/endpoint_diagnostics.go
index f7ef908c..c2a559d3 100644
--- a/cli/beacon/cmd/endpoint_diagnostics.go
+++ b/cli/beacon/cmd/endpoint_diagnostics.go
@@ -875,6 +875,18 @@ func hookTargets() ([]string, error) {
return canonicalHookTargets(splitCSV(endpointOpts.hookHarnesses))
}
+// userScopeOnlyHookTargets are the targets whose installers refuse LevelProject outright, because
+// the runtime registers hooks only from a user-level config: Hermes has no project config at all,
+// and Muse's project .muse/hooks.json is ignored by the shipping build.
+//
+// They are filtered out of the project-level --all list rather than left in to fail. Install and
+// uninstall both return on the first target error, so one refusing target does not just report
+// itself -- it aborts the sweep and silently skips every target after it in the list.
+var userScopeOnlyHookTargets = map[string]bool{
+ "hermes": true,
+ "muse": true,
+}
+
func allHookTargetsForLevel() []string {
all := []string{"cursor", "codex", "vscode", "factory", "opencode", "cline", "pi", "omp", "grok", "qwen", "muse", "hermes", "devin-cli", "devin-desktop", "antigravity"}
if endpointOpts.hookLevel != "project" {
@@ -882,7 +894,7 @@ func allHookTargetsForLevel() []string {
}
filtered := all[:0:0]
for _, t := range all {
- if t == "hermes" {
+ if userScopeOnlyHookTargets[t] {
continue
}
filtered = append(filtered, t)
diff --git a/cli/beacon/cmd/muse_target_test.go b/cli/beacon/cmd/muse_target_test.go
index 249c0727..24c46905 100644
--- a/cli/beacon/cmd/muse_target_test.go
+++ b/cli/beacon/cmd/muse_target_test.go
@@ -115,3 +115,47 @@ func TestMuseSparkIsNotAHarnessAlias(t *testing.T) {
})
}
}
+
+// The project-level --all sweep must not carry a target whose installer refuses project scope.
+//
+// Install and uninstall both return on the first target error, so leaving such a target in the
+// list does not merely fail that one row -- it aborts the sweep and silently skips every target
+// ordered after it. Muse is the second target with this property after Hermes, and it sits ahead
+// of devin-cli, devin-desktop and antigravity in the list, so a regression here costs those three
+// their install with no message naming them.
+func TestAllHookTargetsForLevelSkipsUserScopeOnlyTargetsAtProjectLevel(t *testing.T) {
+ origLevel := endpointOpts.hookLevel
+ t.Cleanup(func() { endpointOpts.hookLevel = origLevel })
+
+ endpointOpts.hookLevel = "user"
+ user := allHookTargetsForLevel()
+ for name := range userScopeOnlyHookTargets {
+ if !containsTarget(user, name) {
+ t.Fatalf("user-level --all dropped %q; it is user scope only, so it belongs there:\n%v", name, user)
+ }
+ }
+
+ endpointOpts.hookLevel = "project"
+ project := allHookTargetsForLevel()
+ for name := range userScopeOnlyHookTargets {
+ if containsTarget(project, name) {
+ t.Fatalf("project-level --all still carries %q, whose installer refuses project scope:\n%v", name, project)
+ }
+ }
+
+ // The targets ordered after muse and hermes are the ones a first-error abort would swallow.
+ for _, name := range []string{"devin-cli", "devin-desktop", "antigravity"} {
+ if !containsTarget(project, name) {
+ t.Fatalf("project-level --all is missing %q:\n%v", name, project)
+ }
+ }
+}
+
+func containsTarget(targets []string, name string) bool {
+ for _, t := range targets {
+ if t == name {
+ return true
+ }
+ }
+ return false
+}