Skip to content

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

Merge the rest of the OpenClaw stack into the adapter branch

Claudee8562d40b405
diff --cc CLAUDE.md
index 490d0a97,a85d85ab..848cf9e1
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@@ -12,7 -12,7 +12,7 @@@ Beacon Endpoint Agent is a local-only e
- `packages/asymptote-sdk-js`: TypeScript SDK for cloud agent telemetry that exports Beacon-compatible OpenTelemetry spans.
- `browser-extension`: optional Chrome MV3 collector that relays Claude.ai and ChatGPT chat telemetry into the local pipeline as OTLP.
- `pkg/asymptoteobserve`: shared Go library — event schema, harness-name normalization, provenance markers, token usage, and the threat-rules engine. Imported by the CLI, the hook adapter, and the collector exporter, so a change here reaches all three.
- - `plugins`: TypeScript sources for the managed runtime plugins/extensions (`opencode-beacon`, `cline-beacon`, `pi-beacon`, `omp-beacon`, `prime-beacon`), each mirrored into an embedded copy under `cli/beacon/internal/endpoint/hooks/assets/`.
-- `plugins`: TypeScript sources for the managed runtime plugins/extensions (`opencode-beacon`, `cline-beacon`, `pi-beacon`, `omp-beacon`, `openclaw-beacon`), each mirrored into an embedded copy under `cli/beacon/internal/endpoint/hooks/assets/`.
++- `plugins`: TypeScript sources for the managed runtime plugins/extensions (`opencode-beacon`, `cline-beacon`, `pi-beacon`, `omp-beacon`, `openclaw-beacon`, `prime-beacon`), each mirrored into an embedded copy under `cli/beacon/internal/endpoint/hooks/assets/`.
- `rules` and `spec/threat-rules`: the open rule corpus and the Threat Rules format it conforms to.
- `beacon-sandbox`: harness that runs a real Claude Code session in a disposable sandbox and checks what Beacon captured. See `beacon-sandbox/AGENTS.md`.
- `packaging`: macOS, Linux, and Windows packaging and deployment assets.
@@@ -48,7 -47,8 +48,8 @@@ Supported runtime surfaces today
- goose (Block) telemetry over two paths that are collected together because neither is sufficient alone. The hook path is a Beacon-owned plugin: goose discovers plugins as the immediate subdirectories of `.agents/plugins` (user scope honours `GOOSE_PATH_ROOT`; project scope is always `<project>/.agents/plugins`) and loads `<plugin-root>/hooks/hooks.json` from each, so Beacon owns the directory `beacon-endpoint` rather than a file. Seven of goose's twelve events are subscribed to -- `SessionStart`, `UserPromptSubmit`, `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, `Stop`, `SessionEnd` -- covering session lifecycle, prompts, tool lifecycle, command lines, file creates and edits with diffs, and MCP tool calls. The OTLP path configures `otel_exporter_otlp_endpoint` in goose's own `config.yaml` and carries what no hook does: token usage including cache reads and writes, model and provider, response ids, finish reasons and agent reasoning, on OTel GenAI semconv `chat` and `execute_tool` spans the collector exporter already reads. The harness is `goose`; GooseAI spellings are deliberately unmapped in `NormalizeHarnessName` and unaccepted as targets, because that is a different company's inference service rather than this runtime. Four contract details are load-bearing. goose classifies a *blocking* hook's stdout, so `PreToolUse` and `Stop` must answer `{"decision":"allow"}` -- the `{}` every other runtime reads as no opinion is classified a failed hook, and on a rule configured `on_failure: block` it denies the tool call; the policy seam's deny is correspondingly `{"decision":"block"}`, because goose does not recognise "deny" and would read it as no verdict and allow. `developer` is registered with `unprefixed_tools`, so its tools arrive as bare `shell`, `write`, `edit`, `tree`, `read_image`, and MCP tools are identified only by their `<extension>__<tool>` prefix not naming a built-in extension -- there is no `mcp` in the name, no `mcp_*` argument and no result to inspect. `PostToolUseFailure` carries a payload identical to `PostToolUse`, so the `event` field is the only thing separating a write that landed from one that did not, and it is what the diff guard turns on. And goose exports OTLP over HTTP only, so it takes the collector's HTTP port where Claude Code, Codex and Gemini take gRPC; pointing it at 4317 fails silently. `BeforeShellExecution`, `AfterShellExecution`, `BeforeReadFile` and `AfterFileEdit` are deliberately not subscribed to -- each duplicates `PreToolUse`/`PostToolUse` for the same call and carries no `tool_call_id` -- and `PreToolUseResult` is deferred because it fires once per call to report an outcome that is almost always "allow". Not collected, because goose exposes none of it on a hook: tool output of any kind (so no command exit codes, no command output, no file-read contents), reported cost, and approval decisions -- goose does ask the operator through `ToolApprovalOperation`, exposes none of it, and its `PreToolUse` chain is a separate plugin-policy layer that runs after the operator's decision, so an approval derived from it would claim a decision precisely where Beacon cannot see one. `.agents/plugins` is the shared Open Plugins directory rather than goose's own namespace, so another host implementing that specification would also run these hooks and Beacon could not tell from the payload; that is a stated limitation with no fix on Beacon's side. **Only the adapter half of this is implemented.** `cli/beacon-hooks/cmd/goose.go` maps the payloads and `NormalizeHarnessName` pins the name, so a `hooks.json` that invokes `beacon-hooks --platform goose` is collected correctly today. There is no installer: `goose` is not an accepted `beacon endpoint hooks install --harness` target, there is no `cli/beacon/internal/endpoint/hooks/goose.go`, and no `harness.DiscoverGoose` configures `otel_exporter_otlp_endpoint` in goose's `config.yaml`. Both files must be written by hand. `docs/runtimes/goose.mdx` and the README runtime table both describe the install commands as if they shipped; they have not. Close that gap before treating goose as a supported install target.
- fx (vercel-labs/fx) telemetry read from the session store fx commits under `~/.fx/sessions/`, covering session start, prompts, tool calls, commands with exit codes and output, file reads/creates/edits with diffs, MCP tool calls, agent messages, history compaction, and per-turn token usage plus reported cost. fx exposes no third-party hook, plugin, or OTLP surface -- its lifecycle hooks are compiled into the binary -- so collection is a read of fx's own records, run by `beacon endpoint fx sync`. Every event carries `harness.collection_method=poll`; approvals are not synthesized (fx persists permission feedback text, not a per-call decision, matching the Cline and Pi posture) and no session-end event is invented, since fx sessions are resumable. Implementation lives in `cli/beacon/internal/fxsession` and `cli/beacon/cmd/endpoint_fx.go`.
- Claude Cowork admin-configured OpenTelemetry setup guidance and local validation.
- - Runtimes that ride the shared hook and OTLP paths without a contract worth writing down here: Antigravity CLI, Devin CLI, Devin Desktop, Factory Droid, Gemini CLI, GitHub Copilot CLI, Grok Build, Hermes Agent, OpenCode (a Beacon-managed plugin, `plugins/opencode-beacon`), Qwen Code, and VS Code. OpenClaw Gateway is OTLP setup guidance and status checking under `cli/beacon/internal/endpoint/integrations/openclaw`, the same shape as Cowork, rather than a harness. The bullets above are the runtimes with a reverse-engineered or otherwise surprising contract, not the full supported set — `harness.DiscoverAll` in `cli/beacon/internal/endpoint/harness` and the install switch in `cli/beacon/cmd/endpoint_hooks.go` are the authoritative lists.
+ - OpenClaw Gateway telemetry over two paths, collected together because neither is sufficient alone. The plugin path is a Beacon-managed plugin: OpenClaw discovers a plugin as the *directory* `beacon-endpoint` under an extensions root (user scope honours `OPENCLAW_STATE_DIR`; project scope is always `<workspace>/.openclaw/extensions`), holding three files -- a plain-JavaScript entry plus the `package.json` and `openclaw.plugin.json` that declare it, with the entry named under both `openclaw.extensions` and `openclaw.runtimeExtensions` so either host build reaches it. Ten of OpenClaw's forty-one typed hooks are registered, covering session lifecycle and resume, prompts, tool lifecycle, commands with exit code and output, file reads/creates/edits with diffs, `apply_patch` as one `file.modified` per changed path, MCP tool calls, compaction, subagent lifecycle, and token usage including cache reads and writes. The OTLP path is OpenClaw's own `diagnostics-otel` plugin, configured *inside OpenClaw* and only printed by `beacon endpoint integrations openclaw` (`cli/beacon/internal/endpoint/integrations/openclaw`); it carries gateway traces and metrics, and by OpenClaw's default carries no content at all. Both paths report the harness `openclaw_gateway`. Five contract details are load-bearing. OpenClaw registers `before_tool_call` **fail-closed**, so a handler that throws or exceeds its timeout blocks the tool call -- that handler therefore dispatches and returns synchronously with no promise to await, which costs event ordering and nothing else, since `gen_ai.tool.call.id` is the join. Conversation hooks, `llm_output` among them, are withheld from every non-bundled plugin until `plugins.entries.beacon-endpoint.hooks.allowConversationAccess` is set, so an otherwise perfect install collects everything except tokens and agent messages. Beacon reads OpenClaw's config and never writes it -- it is JSON *or JSON5*, and a Go round trip would strip an operator's comments out of the file configuring every chat channel they run -- so the installer prints advice instead, and only mentions `plugins.allow` when that key already exists, because introducing an allowlist would deny every other plugin. MCP tools are named `<server>__<tool>` with no `mcp` anywhere, so the separator is the only signal, as on goose. And `derivedPaths` arrives only on `before_tool_call`, so the plugin carries it forward by `toolCallId` -- without it an `apply_patch` is an opaque blob with no file rows. The prompt is `message_received`, the inbound chat message, not `llm_input`'s assembled prompt. Approval decisions are not exposed by OpenClaw's plugin hooks and are not synthesized, matching the Cline, Pi, goose, OpenHands and Kiro decision; the trap is that an `exec` result's `details.approvalReviewOutcome` reads like one and is a *model-backed* review, so it stays in `raw`. Not collected: reported cost (OpenClaw computes it from an operator-configured table rather than a provider report), and gateway lifecycle. Deliberately not registered: the prompt-injection, claim, gate and evaluate hooks, which would give Beacon power over the agent; `llm_input` and `agent_end`, which carry the whole conversation per call; and the two synchronous persistence hooks, which ignore promises. Implementation lives in `plugins/openclaw-beacon`, `cli/beacon-hooks/cmd/openclaw_event.go` and `cli/beacon/internal/endpoint/hooks/openclaw.go`.
-- Runtimes that ride the shared hook and OTLP paths without a contract worth writing down here: Antigravity CLI, Devin CLI, Devin Desktop, Factory Droid, Gemini CLI, GitHub Copilot CLI, Grok Build, Hermes Agent, OpenCode (a Beacon-managed plugin, `plugins/opencode-beacon`), Qwen Code, and VS Code. The bullets above are the runtimes with a reverse-engineered or otherwise surprising contract, not the full supported set — `harness.DiscoverAll` in `cli/beacon/internal/endpoint/harness` and the install switch in `cli/beacon/cmd/endpoint_hooks.go` are the authoritative lists. Prime Agent has a reserved harness name and a `plugin` collection method but no collection path yet.
++- Runtimes that ride the shared hook and OTLP paths without a contract worth writing down here: Antigravity CLI, Devin CLI, Devin Desktop, Factory Droid, Gemini CLI, GitHub Copilot CLI, Grok Build, Hermes Agent, OpenCode (a Beacon-managed plugin, `plugins/opencode-beacon`), Qwen Code, and VS Code. The bullets above are the runtimes with a reverse-engineered or otherwise surprising contract, not the full supported set — `harness.DiscoverAll` in `cli/beacon/internal/endpoint/harness` and the install switch in `cli/beacon/cmd/endpoint_hooks.go` are the authoritative lists.
- Browser chat telemetry through an optional Chrome MV3 extension (`browser-extension/`) covering claude.ai and chatgpt.com. A main-world interceptor tees the streamed response, a per-site adapter parses it into a normalized turn, and the service worker POSTs OTLP GenAI logs to the local collector on `127.0.0.1:4318`; the extension never writes files and never contacts a remote endpoint. `harness.name` resolves to `claude_web` or `chatgpt_web` (already handled by `NormalizeHarnessName` in `pkg/asymptoteobserve/harness.go`, where the browser cases must stay above the generic `claude` rule) and `harness.collection_method` is `otlp`. Scope is deliberately narrow: only those origins' chat streams, never other tabs or general browsing. Retention defaults to `full`, so prompt and response text is retained by default; this is documented rather than defaulted down, because browser chat telemetry without content has no investigative value. Treat the adapters as experimental, since both sites' stream formats are private and undocumented.
- `beaconjson` OpenTelemetry Collector exporter that converts OTLP logs, traces, metrics, and resource attributes into Beacon endpoint JSONL.
- Endpoint inventory (`inventory.heartbeat` / `inventory.snapshot` in `inventory_state.jsonl`) is written by a scheduled job, `com.beacon.endpoint.inventory` (`service.InventoryManager`, user LaunchAgent or system LaunchDaemon, `beacon-inventory.timer` on systemd), every six hours and once at load, on by default and reconciled by `lifecycle.ReconcileInventoryJob` on every install, repair and package upgrade (`beacon endpoint inventory install-daemon`). Agent hooks do not trigger inventory any more; the hook binary's `--cli` flag and `inventory-heartbeat` subcommand survive only as no-ops for hook commands written by older versions, and `beacon endpoint inventory heartbeat --trigger hook` is likewise retired. A system-mode run inventories the active console user's home and still writes the liveness heartbeat when nobody is logged in; the scheduled scan has no working directory, so project-scoped config is only in `beacon endpoint inventory`.
diff --cc cli/beacon/cmd/endpoint_diagnostics.go
index e8b61f41,4c52159f..66330c70
--- a/cli/beacon/cmd/endpoint_diagnostics.go
+++ b/cli/beacon/cmd/endpoint_diagnostics.go
@@@ -957,7 -957,7 +957,7 @@@ var userScopeOnlyHookTargets = map[stri
}
func allHookTargetsForLevel() []string {
- all := []string{"cursor", "codex", "vscode", "factory", "opencode", "openhands", "kiro", "cline", "pi", "omp", "prime", "grok", "qwen", "muse", "hermes", "devin-cli", "devin-desktop", "antigravity"}
- all := []string{"cursor", "codex", "vscode", "factory", "opencode", "openhands", "kiro", "cline", "pi", "omp", "openclaw", "grok", "qwen", "muse", "hermes", "devin-cli", "devin-desktop", "antigravity"}
++ all := []string{"cursor", "codex", "vscode", "factory", "opencode", "openhands", "kiro", "cline", "pi", "omp", "prime", "openclaw", "grok", "qwen", "muse", "hermes", "devin-cli", "devin-desktop", "antigravity"}
if endpointOpts.hookLevel != "project" {
return all
}
@@@ -1014,9 -1014,9 +1014,12 @@@ func hookStatusesWithConfig(targets []s
case "omp":
status := endpointhooks.OmpHookStatus(endpointhooks.OmpOptions{Level: endpointhooks.Level(endpointOpts.hookLevel), LogPath: cfg.LogPath, UserMode: cfg.UserMode})
statuses[name] = hookTargetResult{Target: name, Status: targetStatus(status.Installed), Installed: status.Installed, Message: status.Message, Path: status.ExtensionPath, Raw: status}
+ case "prime":
+ status := endpointhooks.PrimeHookStatus(endpointhooks.PrimeOptions{Level: endpointhooks.Level(endpointOpts.hookLevel), LogPath: cfg.LogPath, UserMode: cfg.UserMode})
+ statuses[name] = hookTargetResult{Target: name, Status: targetStatus(status.Installed), Installed: status.Installed, Message: status.Message, Path: status.ExtensionPath, Raw: status}
+ case "openclaw":
+ status := endpointhooks.OpenClawHookStatus(endpointhooks.OpenClawOptions{Level: endpointhooks.Level(endpointOpts.hookLevel), LogPath: cfg.LogPath, UserMode: cfg.UserMode})
+ statuses[name] = hookTargetResult{Target: name, Status: targetStatus(status.Installed), Installed: status.Installed, Message: status.Message, Path: status.PluginPath, Raw: status}
case "grok":
status := endpointhooks.GrokHookStatus(endpointhooks.GrokOptions{Level: endpointhooks.Level(endpointOpts.hookLevel), LogPath: cfg.LogPath, UserMode: cfg.UserMode})
statuses[name] = hookTargetResult{Target: name, Status: targetStatus(status.Installed), Installed: status.Installed, Message: status.Message, Path: status.HooksPath, Raw: status}
diff --cc cli/beacon/cmd/endpoint_hooks.go
index 40c872e6,c354fde0..9f0e87a4
--- a/cli/beacon/cmd/endpoint_hooks.go
+++ b/cli/beacon/cmd/endpoint_hooks.go
@@@ -170,16 -170,30 +170,40 @@@ func installEndpointHookTarget(name str
// checkout, and the operator's other Oh My Pi sessions stay uninstrumented.
fmt.Println("Project-level Oh My Pi extensions cover only this working directory; a user-level install follows the operator across checkouts.")
}
+ case "prime":
+ status, err := endpointhooks.InstallPrime(endpointhooks.PrimeOptions{
+ Level: endpointhooks.Level(endpointOpts.hookLevel),
+ LogPath: cfg.LogPath,
+ UserMode: cfg.UserMode,
+ })
+ if err != nil {
+ return err
+ }
+ fmt.Printf("Prime Agent extension installed: %s\n", status.ExtensionPath)
+ case "openclaw":
+ status, err := endpointhooks.InstallOpenClaw(endpointhooks.OpenClawOptions{
+ Level: endpointhooks.Level(endpointOpts.hookLevel),
+ LogPath: cfg.LogPath,
+ UserMode: cfg.UserMode,
+ })
+ if err != nil {
+ return err
+ }
+ fmt.Printf("OpenClaw plugin installed: %s\n", status.PluginPath)
+ if endpointhooks.Level(endpointOpts.hookLevel) == endpointhooks.LevelProject {
+ // OpenClaw reads a workspace plugin root relative to the gateway's working directory,
+ // which for a daemonized gateway is wherever the service manager started it rather
+ // than the checkout the operator is thinking of. A user-level install follows the
+ // gateway regardless, which is why it is the default.
+ fmt.Println("Project-level OpenClaw plugins are discovered relative to the gateway's workspace, not the directory you install from; a user-level install follows the gateway.")
+ }
+ // OpenClaw gates conversation hooks behind a config key Beacon does not write, and an
+ // allowlisted config has to name the plugin. Printed at install time because the symptom
+ // otherwise is partial telemetry that looks like working telemetry.
+ for _, advice := range status.ConfigAdvice {
+ fmt.Println(advice)
+ }
+ fmt.Println("Restart the gateway, or run `openclaw plugins reload beacon-endpoint`, for OpenClaw to pick the plugin up.")
case "grok":
status, err := endpointhooks.InstallGrok(endpointhooks.GrokOptions{
Level: endpointhooks.Level(endpointOpts.hookLevel),
@@@ -420,16 -434,16 +444,26 @@@ func uninstallEndpointHookTarget(name s
return err
}
fmt.Println(status.Message)
+ case "prime":
+ status, err := endpointhooks.UninstallPrime(endpointhooks.PrimeOptions{
+ Level: endpointhooks.Level(endpointOpts.hookLevel),
+ LogPath: cfg.LogPath,
+ UserMode: cfg.UserMode,
+ })
+ if err != nil {
+ return err
+ }
+ fmt.Println(status.Message)
+ case "openclaw":
+ status, err := endpointhooks.UninstallOpenClaw(endpointhooks.OpenClawOptions{
+ Level: endpointhooks.Level(endpointOpts.hookLevel),
+ LogPath: cfg.LogPath,
+ UserMode: cfg.UserMode,
+ })
+ if err != nil {
+ return err
+ }
+ fmt.Println(status.Message)
case "grok":
status, err := endpointhooks.UninstallGrok(endpointhooks.GrokOptions{
Level: endpointhooks.Level(endpointOpts.hookLevel),
@@@ -586,12 -600,12 +620,18 @@@ func runEndpointHooksStatus(cmd *cobra.
LogPath: cfg.LogPath,
UserMode: cfg.UserMode,
})
+ case "prime":
+ statuses["prime"] = endpointhooks.PrimeHookStatus(endpointhooks.PrimeOptions{
+ Level: endpointhooks.Level(endpointOpts.hookLevel),
+ LogPath: cfg.LogPath,
+ UserMode: cfg.UserMode,
+ })
+ case "openclaw":
+ statuses["openclaw"] = endpointhooks.OpenClawHookStatus(endpointhooks.OpenClawOptions{
+ Level: endpointhooks.Level(endpointOpts.hookLevel),
+ LogPath: cfg.LogPath,
+ UserMode: cfg.UserMode,
+ })
case "grok":
statuses["grok"] = endpointhooks.GrokHookStatus(endpointhooks.GrokOptions{
Level: endpointhooks.Level(endpointOpts.hookLevel),
@@@ -686,10 -700,16 +726,20 @@@
status := statuses["omp"].(endpointhooks.OmpStatus)
fmt.Printf("Oh My Pi extension: installed=%t path=%s\n", status.Installed, status.ExtensionPath)
fmt.Println(status.Message)
+ case "prime":
+ status := statuses["prime"].(endpointhooks.PrimeStatus)
+ fmt.Printf("Prime Agent extension: installed=%t path=%s\n", status.Installed, status.ExtensionPath)
+ fmt.Println(status.Message)
+ case "openclaw":
+ status := statuses["openclaw"].(endpointhooks.OpenClawStatus)
+ fmt.Printf("OpenClaw plugin: installed=%t path=%s\n", status.Installed, status.PluginPath)
+ fmt.Println(status.Message)
+ // An installed plugin with conversation access withheld collects everything except
+ // tokens and agent messages, which reads as working until somebody looks for a token
+ // count. Surfaced on every status check rather than only at install.
+ for _, advice := range status.ConfigAdvice {
+ fmt.Println(advice)
+ }
case "grok":
status := statuses["grok"].(endpointhooks.GrokStatus)
fmt.Printf("Grok hooks: installed=%t path=%s\n", status.Installed, status.HooksPath)
diff --cc cli/beacon/cmd/endpoint_hooks_repair.go
index 3e068210,76ee8274..be64fed3
--- a/cli/beacon/cmd/endpoint_hooks_repair.go
+++ b/cli/beacon/cmd/endpoint_hooks_repair.go
@@@ -148,7 -148,7 +148,7 @@@ func installedHookTargetsForUser(homeDi
}
func repairTargetOrder() []string {
- return []string{"claude", "codex", "cursor", "vscode", "factory", "opencode", "openhands", "kiro", "cline", "pi", "omp", "prime", "grok", "qwen", "muse", "hermes", "devin-cli", "devin-desktop", "antigravity"}
- return []string{"claude", "codex", "cursor", "vscode", "factory", "opencode", "openhands", "kiro", "cline", "pi", "omp", "openclaw", "grok", "qwen", "muse", "hermes", "devin-cli", "devin-desktop", "antigravity"}
++ return []string{"claude", "codex", "cursor", "vscode", "factory", "opencode", "openhands", "kiro", "cline", "pi", "omp", "prime", "openclaw", "grok", "qwen", "muse", "hermes", "devin-cli", "devin-desktop", "antigravity"}
}
// withUserHome runs fn as if it were executing inside another user's profile.
diff --cc cli/beacon/internal/endpoint/harness/harness.go
index c63d4473,45652b62..cd0e6ea8
--- a/cli/beacon/internal/endpoint/harness/harness.go
+++ b/cli/beacon/internal/endpoint/harness/harness.go
@@@ -59,7 -59,7 +59,8 @@@ func DiscoverAll() []Harness
DiscoverCline(),
DiscoverPi(),
DiscoverOmp(),
+ DiscoverOpenClaw(),
+ DiscoverPrime(),
DiscoverFx(),
DiscoverQwen(),
DiscoverHermes(),
diff --cc cli/beacon/internal/endpoint/inventory/inventory.go
index 99fa222e,dbc022f9..0821da8d
--- a/cli/beacon/internal/endpoint/inventory/inventory.go
+++ b/cli/beacon/internal/endpoint/inventory/inventory.go
@@@ -237,7 -237,7 +237,8 @@@ func candidates(home, wd string) []cand
items = append(items, clineCandidates(home, wd)...)
items = append(items, piCandidates(home, wd)...)
items = append(items, ompCandidates(home, wd)...)
+ items = append(items, openClawCandidates(home, wd)...)
+ items = append(items, primeCandidates(home, wd)...)
items = append(items, hermesCandidates(home)...)
items = append(items, devinCandidates(home, wd)...)
items = append(items, grokCandidates(home, wd)...)
@@@ -385,34 -385,36 +386,64 @@@ func ompCandidates(home, wd string) []c
return items
}
+ // openClawCandidates covers both OpenClaw plugin locations.
+ //
+ // The user path comes from the installer rather than being rebuilt here, for the reason
+ // ompCandidates gives: OPENCLAW_STATE_DIR moves it, and only the installer knows the rule. The
+ // project path is the literal OpenClaw joins onto its workspace, which has no override.
+ //
+ // The candidate is the plugin *entry*, not its directory, because the entry is what carries
+ // Beacon's marker -- the manifests beside it are byte-identical for every install and identify
+ // nothing.
+ func openClawCandidates(home, wd string) []candidate {
+ items := []candidate{}
+ if home != "" {
+ if path, err := hooks.OpenClawEntryPathForHome(home, hooks.LevelUser); err == nil {
+ items = append(items, candidate{
+ runtime: "openclaw_gateway",
+ path: path,
+ scope: ScopeUser, format: formatMetadataOnly, kind: KindPlugin,
+ })
+ }
+ }
+ if wd != "" {
+ items = append(items, candidate{
+ runtime: "openclaw_gateway",
+ path: filepath.Join(wd, ".openclaw", "extensions", "beacon-endpoint", "beacon.js"),
+ scope: ScopeProject, format: formatMetadataOnly, kind: KindPlugin,
+ })
+ }
+ return items
+ }
+
+// primeCandidates covers both Prime Agent extension locations.
+//
+// Like ompCandidates, the user path comes from the installer rather than being rebuilt here,
+// because it is not a fixed string: PRIME_AGENT_CODING_AGENT_DIR moves it, and only the installer
+// knows that rule. The project path keeps the `agent` segment the user path has -- Prime Agent
+// joins the same two-segment literal at both scopes, unlike Pi and Oh My Pi, whose project
+// directories drop it.
+func primeCandidates(home, wd string) []candidate {
+ items := []candidate{}
+ if home != "" {
+ if path, err := hooks.PrimeExtensionPathForHome(home, hooks.LevelUser); err == nil {
+ items = append(items, candidate{
+ runtime: "prime_agent",
+ path: path,
+ scope: ScopeUser, format: formatMetadataOnly, kind: KindPlugin,
+ })
+ }
+ }
+ if wd != "" {
+ items = append(items, candidate{
+ runtime: "prime_agent",
+ path: filepath.Join(wd, ".prime", "agent", "extensions", "beacon.ts"),
+ scope: ScopeProject, format: formatMetadataOnly, kind: KindPlugin,
+ })
+ }
+ return items
+}
+
func hermesCandidates(home string) []candidate {
return []candidate{{runtime: "hermes", path: filepath.Join(home, ".hermes", "config.yaml"), scope: ScopeUser, format: formatYAML, kind: KindNativeConfig}}
}
@@@ -885,11 -887,10 +916,15 @@@ func beaconManaged(item candidate, dat
// is attributed to the runtime that actually loads it rather than to whichever case ran first.
case "omp":
return strings.Contains(text, hooks.OmpManagedExtensionMarker)
+ // The plugin entry's marker, read from the installer's own constant for the reason the Pi case
+ // gives. The manifests beside it carry no marker because they are identical for every install.
+ case "openclaw_gateway":
+ return strings.Contains(text, hooks.OpenClawManagedPluginMarker)
+ // Third distinct marker in this family, matched separately for the same reason: a file found at
+ // any of the three paths is attributed to the runtime that actually loads it rather than to
+ // whichever case ran first.
+ case "prime_agent":
+ return strings.Contains(text, hooks.PrimeManagedExtensionMarker)
case "grok":
return strings.Contains(text, "beacon-managed-grok-hooks:v1")
// Matched on the hook command rather than on a marker, because Beacon merges into Qwen's own
diff --cc cli/beacon/internal/endpoint/inventory/inventory_test.go
index 207551dd,ed2de075..d393f241
--- a/cli/beacon/internal/endpoint/inventory/inventory_test.go
+++ b/cli/beacon/internal/endpoint/inventory/inventory_test.go
@@@ -353,11 -353,12 +353,17 @@@ func TestScanIncludesAllSupportedCurren
// project -- but under its own `.omp` root, because the two runtimes install separately.
{runtime: "omp", path: filepath.Join(home, ".omp", "agent", "extensions", "beacon.ts"), scope: ScopeUser, format: formatMetadataOnly, kind: KindPlugin},
{runtime: "omp", path: filepath.Join(work, ".omp", "extensions", "beacon.ts"), scope: ScopeProject, format: formatMetadataOnly, kind: KindPlugin},
+ // Prime Agent, the third pi-family runtime, under its own `.prime` root. Both scopes carry
+ // the `agent` segment: it joins the same two-segment literal at project scope where Pi and
+ // Oh My Pi drop it, so a path derived from either sibling would be wrong here.
+ {runtime: "prime_agent", path: filepath.Join(home, ".prime", "agent", "extensions", "beacon.ts"), scope: ScopeUser, format: formatMetadataOnly, kind: KindPlugin},
+ {runtime: "prime_agent", path: filepath.Join(work, ".prime", "agent", "extensions", "beacon.ts"), scope: ScopeProject, format: formatMetadataOnly, kind: KindPlugin},
+ // OpenClaw's candidate is the plugin entry rather than its directory, because the entry is
+ // what carries Beacon's marker -- the two manifests beside it are byte-identical for every
+ // install and identify nothing. Both scopes are reported: OpenClaw discovers a workspace
+ // plugin root and a global one, and a gateway can be running with either.
+ {runtime: "openclaw_gateway", path: filepath.Join(home, ".openclaw", "extensions", "beacon-endpoint", "beacon.js"), scope: ScopeUser, format: formatMetadataOnly, kind: KindPlugin},
+ {runtime: "openclaw_gateway", path: filepath.Join(work, ".openclaw", "extensions", "beacon-endpoint", "beacon.js"), scope: ScopeProject, format: formatMetadataOnly, kind: KindPlugin},
{runtime: "hermes", path: filepath.Join(home, ".hermes", "config.yaml"), scope: ScopeUser, format: formatYAML, kind: KindNativeConfig},
{runtime: "devin-cli", path: filepath.Join(home, ".config", "devin", "config.json"), scope: ScopeUser, format: formatJSON, kind: KindNativeConfig},
{runtime: "devin-cli", path: filepath.Join(work, ".devin", "hooks.v1.json"), scope: ScopeProject, format: formatJSON, kind: KindHookConfig},
diff --cc cli/beacon/internal/endpoint/lifecycle/lifecycle.go
index 04c60848,5a928186..141cf469
--- a/cli/beacon/internal/endpoint/lifecycle/lifecycle.go
+++ b/cli/beacon/internal/endpoint/lifecycle/lifecycle.go
@@@ -1048,8 -1048,13 +1048,15 @@@ func configureHarnesses(cfg endpointcon
return paths, fmt.Errorf("Pi telemetry is installed with `beacon endpoint hooks install --harness pi`, not endpoint install")
case "omp", "oh_my_pi", "oh-my-pi":
return paths, fmt.Errorf("Oh My Pi telemetry is installed with `beacon endpoint hooks install --harness omp`, not endpoint install")
+ case "prime", "prime_agent", "prime-agent":
+ return paths, fmt.Errorf("Prime Agent telemetry is installed with `beacon endpoint hooks install --harness prime`, not endpoint install")
+ // OpenClaw has an OTLP surface, and it is still not one `endpoint install` can configure:
+ // it lives in OpenClaw's own config behind its diagnostics-otel plugin, so Beacon prints
+ // the settings rather than writing them. The agent-activity path is the managed plugin.
+ // Both commands are named, because an operator who reached for --harness openclaw wants
+ // one of them and cannot tell from here which.
+ case "openclaw", "openclaw_gateway", "openclaw-gateway":
+ return paths, fmt.Errorf("OpenClaw agent telemetry is installed with `beacon endpoint hooks install --harness openclaw`, and its gateway OTLP export is set up with `beacon endpoint integrations openclaw print-config`, not endpoint install")
// Qwen Code has no OpenTelemetry export to point at the local collector, so `endpoint
// install --harness qwen` has nothing to configure. Saying so beats the generic
// "unsupported harness", which reads as "Beacon does not support Qwen Code" when the
diff --cc cli/beacon/internal/tokens/coverage.go
index a8a5ab82,b16b184c..c60456c4
--- a/cli/beacon/internal/tokens/coverage.go
+++ b/cli/beacon/internal/tokens/coverage.go
@@@ -67,15 -67,20 +67,21 @@@ var usageExpectation = map[string]struc
expect string
reason string
}{
- "claude_code": {ExpectReported, "OTLP token and cost telemetry"},
- "codex_cli": {ExpectReported, "per-turn usage trace; Codex emits no cost"},
- "codex_desktop": {ExpectReported, "per-turn usage trace; Codex emits no cost"},
- "claude_cowork": {ExpectReported, "OTLP token and cost telemetry"},
- "cline": {ExpectReported, "plugin reports usage once per task"},
- "opencode": {ExpectReported, "plugin reports usage per assistant message"},
- "pi_cli": {ExpectReported, "extension reports usage and cost"},
- "omp": {ExpectReported, "extension reports usage and cost"},
- "prime_agent": {ExpectReported, "extension reports usage and cost"},
+ "claude_code": {ExpectReported, "OTLP token and cost telemetry"},
+ "codex_cli": {ExpectReported, "per-turn usage trace; Codex emits no cost"},
+ "codex_desktop": {ExpectReported, "per-turn usage trace; Codex emits no cost"},
+ "claude_cowork": {ExpectReported, "OTLP token and cost telemetry"},
+ "cline": {ExpectReported, "plugin reports usage once per task"},
+ "opencode": {ExpectReported, "plugin reports usage per assistant message"},
+ "pi_cli": {ExpectReported, "extension reports usage and cost"},
+ "omp": {ExpectReported, "extension reports usage and cost"},
++ "prime_agent": {ExpectReported, "extension reports usage and cost"},
+ // Reported by the managed plugin's `llm_output` hook, which is the only OpenClaw surface that
+ // carries usage. It is a conversation hook, so OpenClaw withholds it from a non-bundled plugin
+ // until `plugins.entries.beacon-endpoint.hooks.allowConversationAccess` is set -- which is why
+ // an OpenClaw endpoint can be collecting everything else and reporting no tokens at all.
+ // `beacon endpoint hooks status --harness openclaw` is where that gap is surfaced.
+ "openclaw_gateway": {ExpectReported, "plugin reports usage per model response when conversation access is granted"},
"vercel_fx": {ExpectReported, "session store carries cumulative usage and cost"},
"asymptote_observe": {ExpectReported, "SDK spans carry semconv usage"},
diff --cc docs/cli/token-usage.mdx
index b20770b7,d7cb5716..a5cca997
--- a/docs/cli/token-usage.mdx
+++ b/docs/cli/token-usage.mdx
@@@ -44,8 -44,10 +44,11 @@@ Token coverage is not uniform, and the
| OpenCode | input, output, cache read, cache creation, reasoning | Reported (`cost_usd`) | Yes | Yes |
| Pi | input, output, cache read, cache creation, reasoning | Reported (`cost_usd`) | Yes | Yes |
| Oh My Pi | input, output, cache read, cache creation, reasoning | Reported (`cost_usd`) | Yes | Yes |
+| Prime Agent | input, output, cache read, cache creation, reasoning | Reported (`cost_usd`) | Yes | Yes |
| fx (Vercel Labs) | input, output, cache read, cache creation | Reported (`cost_usd`) | Yes | Yes |
+ | OpenClaw Gateway | input, output, cache read, cache creation | Not reported on the hook | Yes, per model response | Yes |
+
+ OpenClaw reports usage on its `llm_output` hook, which is a *conversation* hook -- OpenClaw withholds those from every non-bundled plugin until `plugins.entries.beacon-endpoint.hooks.allowConversationAccess` is set in its config. An OpenClaw endpoint collecting prompts, tools, commands and files while reporting no tokens at all is almost always that key, and `beacon endpoint hooks status --harness openclaw` says so. OpenClaw does compute a per-turn price, from an operator-configured cost table rather than from a provider report, so Asymptote does not record it as a reported cost. See [OpenClaw Gateway](/runtimes/openclaw-gateway).
Cline reports usage once per task rather than per model call, because Beacon's rollups sum `gen_ai.usage` across events and reporting at both granularities would count every token twice. fx reports cumulative totals, which Beacon differences into per-turn deltas for the same reason.