The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu
Go agent-ai-cliagent-harnessesagent-securitybrowser-extensionciclaude-codecloudcodexcursordetection-engineeringjevknowledge-basememorymobile-device-managementobservabilitysecuritysecurity-information-and-event-managementsecurity-toolstelemetrytraces
Report a hook that could not be installed as a warning, not a failed install
shukieshah14a00b9835e0
diff --git a/cli/beacon/cmd/endpoint_install.go b/cli/beacon/cmd/endpoint_install.goindex 99255fe5..01c988a0 100644--- a/cli/beacon/cmd/endpoint_install.go+++ b/cli/beacon/cmd/endpoint_install.go@@ -5,6 +5,7 @@ import ("fmt""io""os"+ "strings""github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/dashboard""github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/harness"@@ -140,9 +141,7 @@ func runEndpointInstall(cmd *cobra.Command, args []string) error {fmt.Printf("Scheduled inventory job not installed: %s\n", result.InventoryJobDetail)}printLingerGap(cmd.ErrOrStderr(), result)- if err := installHookTargetsFromEndpointInstall(hookHarnesses); err != nil {- return fmt.Errorf("endpoint install completed, but hook installation failed: %w", err)- }+ installHookTargetsFromEndpointInstall(cmd.ErrOrStderr(), hookHarnesses)if connectAfterInstall {// The install is complete and stands on its own; a failed connect is reported// with the retry command rather than turning a working install into an error.@@ -294,9 +293,7 @@ func runEndpointRepair(cmd *cobra.Command, args []string) error {}fmt.Printf("Endpoint repaired. Manifest: %s\n", result.ManifestPath)printLingerGap(cmd.ErrOrStderr(), result)- if err := installHookTargetsFromEndpointInstall(hookHarnesses); err != nil {- return fmt.Errorf("endpoint repair completed, but hook installation failed: %w", err)- }+ installHookTargetsFromEndpointInstall(cmd.ErrOrStderr(), hookHarnesses)return nil}@@ -324,18 +321,31 @@ func printLingerGap(out io.Writer, result lifecycle.InstallResult) {}}-func installHookTargetsFromEndpointInstall(targets []string) error {+// installHookTargetsFromEndpointInstall installs the hook targets that ride an endpoint+// install or repair, and reports the ones it could not write as warnings on out.+//+// By the time this runs the collector, its config, the service unit, and the OTLP settings+// are all in place, so the endpoint works. A hook that could not be written, most often a+// runtime settings file with a shape the merge does not understand, is one command away+// from being retried, and it used to turn that complete install into a non-zero exit that+// read as a broken endpoint. Every target is still attempted, so one runtime's settings+// file cannot stop another runtime's hooks from being installed.+func installHookTargetsFromEndpointInstall(out io.Writer, targets []string) {if len(targets) == 0 {- return nil+ return}cfg := loadOrDefaultConfig()if endpointOpts.logPath != "" {cfg.LogPath = endpointOpts.logPath}+ var failed []stringfor _, target := range targets {if err := installEndpointHookTarget(target, cfg); err != nil {- return err+ failed = append(failed, target)+ fmt.Fprintf(out, "Warning: %s hooks were not installed: %v\n", target, err)}}- return nil+ if len(failed) > 0 {+ fmt.Fprintf(out, "The endpoint is installed without them. Retry with: beacon endpoint hooks install --harness %s\n", strings.Join(failed, ","))+ }}diff --git a/cli/beacon/cmd/endpoint_test.go b/cli/beacon/cmd/endpoint_test.goindex 313b5475..e0f6426b 100644--- a/cli/beacon/cmd/endpoint_test.go+++ b/cli/beacon/cmd/endpoint_test.go@@ -1,6 +1,7 @@package cmdimport (+ "bytes""context""encoding/json""errors"@@ -2316,3 +2317,41 @@ func TestSystemHeartbeatScopeIgnoresServiceAccountsAtTheConsole(t *testing.T) {}}}++// A hook that cannot be written must not turn a complete install into an error: the+// collector, config, service, and OTLP settings are already in place, and the retry is one+// command. Every other target is still attempted.+func TestEndpointInstallHookFailureIsAWarningAndOtherHooksStillInstall(t *testing.T) {+ home := t.TempDir()+ t.Setenv("HOME", home)+ old := endpointOpts+ t.Cleanup(func() { endpointOpts = old })+ endpointOpts.userMode = true+ endpointOpts.logPath = filepath.Join(home, "runtime.jsonl")+ endpointOpts.hookLevel = ""++ // A settings file whose hooks key is not an object cannot be merged into.+ claudeDir := filepath.Join(home, ".claude")+ if err := os.MkdirAll(claudeDir, 0o755); err != nil {+ t.Fatal(err)+ }+ if err := os.WriteFile(filepath.Join(claudeDir, "settings.json"), []byte(`{"hooks": "not-an-object"}`), 0o600); err != nil {+ t.Fatal(err)+ }++ var out bytes.Buffer+ installHookTargetsFromEndpointInstall(&out, []string{"claude", "codex"})++ if !strings.Contains(out.String(), "Warning: claude hooks were not installed") {+ t.Fatalf("expected a claude warning, got:\n%s", out.String())+ }+ if !strings.Contains(out.String(), "Retry with: beacon endpoint hooks install --harness claude") {+ t.Fatalf("expected a retry command naming only the failed target, got:\n%s", out.String())+ }+ if _, err := os.Stat(filepath.Join(home, ".codex", "hooks.json")); err != nil {+ t.Fatalf("codex hooks must still be installed after the claude failure: %v", err)+ }+ if data, _ := os.ReadFile(filepath.Join(claudeDir, "settings.json")); string(data) != `{"hooks": "not-an-object"}` {+ t.Fatalf("a settings file the merge cannot read must be left untouched, got %s", data)+ }+}diff --git a/docs/changelog/cli.mdx b/docs/changelog/cli.mdxindex e6741091..3718b54e 100644--- a/docs/changelog/cli.mdx+++ b/docs/changelog/cli.mdx@@ -62,6 +62,11 @@ Stay up to date with the latest changes to the Agent Beacon CLI.previously recorded thinner Claude sessions than every other supported runtime. Packageinstalls already refreshed these hooks for the console user; this brings Homebrew andtarball installs in line. `beacon endpoint hooks uninstall --harness claude` removes them.+- **Hook install failures no longer fail the install** · When `endpoint install` or+ `endpoint repair` cannot write a runtime's hooks, it prints a warning and the+ `beacon endpoint hooks install --harness …` command to retry, and still attempts every+ other hook target. The collector, config, service, and OTLP settings are already in place+ at that point, so the endpoint is installed rather than reported broken.### v1.3.17 · September 21, 2026diff --git a/docs/cli/endpoint-install.mdx b/docs/cli/endpoint-install.mdxindex a93c2b1d..3a264400 100644--- a/docs/cli/endpoint-install.mdx+++ b/docs/cli/endpoint-install.mdx@@ -13,7 +13,7 @@ The service is a launchd job on macOS and a systemd unit on Linux. Where neitherbeacon endpoint install```-By default, Beacon configures Claude Code and Codex CLI telemetry for local or customer-controlled runtime JSONL logs. Gemini CLI and VS Code Copilot telemetry are opt-in with the `gemini` and `vscode` harnesses. The `claude` harness writes both Claude Code's OpenTelemetry settings and its user-level hooks, because the OTLP export alone carries no session start or end, file activity, or subagent lifecycle; `beacon endpoint hooks uninstall --harness claude` removes the hooks again, and `beacon endpoint hooks install --harness claude --level project` adds project-level ones. Codex uses OTLP logs plus one selective turn trace for tokens, and its required SessionStart hook adds local OS-user context. Beacon applies redaction, sanitization, truncation, and event-size limits before writing supported content fields. GitHub Copilot CLI and Factory Droid OTLP are managed through their launch environments, so Beacon validates their telemetry state but does not mutate shell profiles during install.+By default, Beacon configures Claude Code and Codex CLI telemetry for local or customer-controlled runtime JSONL logs. Gemini CLI and VS Code Copilot telemetry are opt-in with the `gemini` and `vscode` harnesses. The `claude` harness writes both Claude Code's OpenTelemetry settings and its user-level hooks, because the OTLP export alone carries no session start or end, file activity, or subagent lifecycle; `beacon endpoint hooks uninstall --harness claude` removes the hooks again, and `beacon endpoint hooks install --harness claude --level project` adds project-level ones. A hook that cannot be written, for example into a settings file whose `hooks` key is not an object, is reported as a warning with the retry command; the endpoint itself is installed and `endpoint install` still exits 0. Codex uses OTLP logs plus one selective turn trace for tokens, and its required SessionStart hook adds local OS-user context. Beacon applies redaction, sanitization, truncation, and event-size limits before writing supported content fields. GitHub Copilot CLI and Factory Droid OTLP are managed through their launch environments, so Beacon validates their telemetry state but does not mutate shell profiles during install.## Flags