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
Document OpenHands support
Claude876fb01c6417
diff --git a/CLAUDE.md b/CLAUDE.mdindex 37bf5e33..ae538d8c 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -37,6 +37,7 @@ Supported runtime surfaces today:- Pi hook telemetry through a Beacon-managed local extension (`~/.pi/agent/extensions/beacon.ts`, or `.pi/extensions/beacon.ts` at project level) covering session lifecycle, prompts, tool lifecycle and results, commands including operator `!` commands, file reads/creates/edits with the unified patch, agent reasoning from assistant thinking parts, and token usage/cost. The extension subscribes to seven Pi event types and ignores the streaming and provider internals. Approval decisions are not exposed by Pi's extension API -- its `tool_call` handler can block, but that is an extension deciding rather than an operator being asked -- and are not synthesized, matching the Cline decision.- Oh My Pi (`omp`) hook telemetry through a Beacon-managed local extension (`~/.omp/agent/extensions/beacon.ts`, or `.omp/extensions/beacon.ts` at project level) covering session lifecycle, prompts, tool lifecycle and results, operator approval decisions, commands including operator `!` and `$` Python commands, file reads/creates/edits with the unified patch, MCP tool activity, agent reasoning, and token usage/cost. Oh My Pi is a fork of pi-mono and kept Pi's event payload shapes, so the two share one mapper (`cli/beacon-hooks/cmd/pi_family.go`) but never share identity: separate harness names, separate extension markers, separate install directories. Unlike Pi and Cline it does expose real operator approval decisions (`tool_approval_requested`/`tool_approval_resolved`), so those are recorded as `observed` approvals rather than withheld -- Beacon still never synthesizes one from a blocking `tool_call` handler. Those events carry no tool arguments, so the extension remembers each `tool_call`'s input by `toolCallId` and attaches it to the approval; without it the approval rules, which all match on `command.command` or `file.path`, could not read Oh My Pi approvals at all. The user-level install path honors `PI_CODING_AGENT_DIR` and `PI_CONFIG_DIR`; the project path is always `.omp/extensions`. `mcp_notification` is deliberately not subscribed to.- Muse Code (Meta) hook telemetry through a Beacon-owned managed hooks file (`$XDG_CONFIG_HOME/muse/beacon-endpoint-hooks.json`, else `~/.config/muse/...`) that Muse's own `settings.json` points at with the `managed_hooks_path` key. Covers session start, prompts, tool lifecycle, operator approval decisions from `PermissionRequest`, subagent start/stop, context compaction, commands, and file activity. Muse Spark is the model and Muse Code is the agent: the harness is `muse_code`, and Muse Spark spellings are deliberately unmapped in `NormalizeHarnessName` so a model id cannot masquerade as the runtime. `PreLLMCall`/`PostLLMCall` are deliberately not subscribed to -- both carry the full `messages` array and tool schemas on every model call, and `PostLLMCall` fires per response chunk. Not collected, because Muse exposes none of it on a hook: token usage/cost, a session-end event, and subagent-to-parent correlation. Muse publishes no hook API, so the contract is reverse-engineered from a shipped build and a bad hooks file is rejected in total silence -- which is why the installer's emitted shape and the payload readers are both pinned by tests. Implementation lives in `cli/beacon/internal/endpoint/hooks/muse.go` and the `muse` platform branches in `cli/beacon-hooks/cmd`.+- OpenHands (All Hands) hook telemetry through the runtime's own `.openhands/hooks.json`, which Beacon merges its six commands into rather than owning. Covers session start and end, prompts, pre-tool and post-tool activity, commands with exit code and output, file reads and edits, MCP tool calls, and failed tools. The harness is `openhands`; OpenHands LM spellings are deliberately unmapped in `NormalizeHarnessName` so a model id cannot masquerade as the runtime. OpenHands rides the shared hook subcommands rather than getting a mapper of its own, because its six events line up one for one with them; the runtime-specific readers live in `cli/beacon-hooks/cmd/openhands.go` and the installer in `cli/beacon/internal/endpoint/hooks/openhands.go`. File diffs come from the observation's `old_content`/`new_content` rather than from the edit instruction, so they describe what landed on disk; one `apply_patch` call becomes one `file.modified` per changed file. Approval decisions are not exposed by OpenHands' hooks and are not synthesized, matching the Cline, Pi and fx decision. Not collected, because OpenHands exposes none of it on a hook: token usage and cost, a per-call tool id, and assistant response text. The verbatim payload is deliberately not retained under `raw`: its only unhoused field is `metadata`, which is empty on five of six events and constant on the sixth. `hooks.json` has a closed schema that rejects silently -- unknown top-level keys are fatal, a legacy `{"hooks": {...}}` wrapper replaces the whole document, and naming one event in both snake_case and PascalCase takes the file down -- so the installer refuses a file that already breaks one of those, and both the emitted shape and the payload readers are pinned by tests. Both scopes are real, but project scope is the one every host reads: the loader takes the first hooks file it finds rather than merging, and the agent server behind the CLI and the GUI reads only the project file.- 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.- 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.diff --git a/README.md b/README.mdindex 9d633866..55caf5de 100644--- a/README.md+++ b/README.md@@ -104,6 +104,7 @@ to compare it with the managed path.| [Oh My Pi](https://docs.asymptotelabs.ai/runtimes/oh-my-pi) | Managed extension hooks | Session lifecycle, prompts, tool lifecycle and results, approval decisions with the session's approval mode, commands including operator `!` and `$`, file reads/writes/edits with diffs, MCP activity, agent reasoning, and token usage/cost || [OpenClaw Gateway](https://docs.asymptotelabs.ai/cli/supported-runtimes-openclaw-gateway) | Gateway-configured OTLP/HTTP | OTLP logs, traces, and metrics from the Gateway diagnostics plugin || [OpenCode](https://docs.asymptotelabs.ai/cli/supported-runtimes-opencode) | Managed plugin hooks | Prompts, assistant output and reasoning, model usage/cost, tool lifecycle and results, commands, file/web/MCP activity, approvals, and session errors |+| [OpenHands](https://docs.asymptotelabs.ai/runtimes/openhands) | Native hooks merged into the repository's own `.openhands/hooks.json` | Session start and end, prompt, pre-tool, post-tool, failed tool, command with exit code and output, file read/modify with exact before/after diffs, and MCP tool calls. No approval decisions or token usage, because OpenHands exposes neither on a hook || [Pi](https://docs.asymptotelabs.ai/runtimes/pi) | Managed extension hooks | Session lifecycle, prompts, tool lifecycle and results, commands including operator `!`, file reads/writes/edits with diffs, agent reasoning, and token usage/cost || [Prime Agent](https://docs.asymptotelabs.ai/runtimes/prime-agent) | Managed extension hooks | Session lifecycle, prompts, tool lifecycle and results, commands including operator `!`, file reads/writes/edits with diffs, agent reasoning, and token usage/cost || [Qwen Code](https://docs.asymptotelabs.ai/runtimes/qwen-code) | Native hooks | Session, prompt, pre-tool, post-tool, failed tool, permission request/approval, subagent, stop, session end, command, and file |diff --git a/cli/beacon/README.md b/cli/beacon/README.mdindex 94c7b074..80b925ab 100644--- a/cli/beacon/README.md+++ b/cli/beacon/README.md@@ -545,6 +545,9 @@ contract, what leaves the machine, and revocation../beacon endpoint hooks install --harness muse./beacon endpoint hooks status --harness muse+./beacon endpoint hooks install --harness openhands --level project+./beacon endpoint hooks status --harness openhands --level project+./beacon endpoint hooks install --harness hermes./beacon endpoint hooks status --harness hermes@@ -602,6 +605,19 @@ uninstall clears the key only while it still names Beacon's file. User scopeonly -- Muse's project `.muse/hooks.json` is ignored by the shipping build, so aproject install would report success and collect nothing.+The OpenHands integration merges Beacon's six hook commands into the+`.openhands/hooks.json` the runtime already reads, at `<repo>/.openhands/hooks.json`+for project-level installs or `$OH_PERSISTENCE_DIR`/`~/.openhands/hooks.json` for+user-level ones. Hooks you already have are preserved, including their matchers,+timeouts, and fields Beacon has no model for. Project scope is the one every host+reads: OpenHands takes the first hooks file it finds rather than merging the two,+so a repository file shadows the user-level one entirely, and the agent server+behind the CLI and the GUI never consults the user-level file at all. The file has+a closed schema that fails silently -- an unknown top-level key, a second spelling+of one event, or a top-level event added beside a legacy `{"hooks": {...}}` wrapper+all end with hooks not running and no error -- so install refuses a file that+already breaks one of those rather than reporting a success that collects nothing.+The Hermes Agent integration writes shell-hook entries into`~/.hermes/config.yaml`. Hermes prompts for first-use consent for each`(event, command)` pair; for non-interactive gateway, cron, or CI runs, setdiff --git a/docs/docs.json b/docs/docs.jsonindex b0be1209..85ad6e68 100644--- a/docs/docs.json+++ b/docs/docs.json@@ -151,6 +151,7 @@"runtimes/muse-code","runtimes/oh-my-pi","runtimes/opencode",+ "runtimes/openhands","runtimes/pi","runtimes/prime-agent","runtimes/qwen-code",diff --git a/docs/runtimes/index.mdx b/docs/runtimes/index.mdxindex cbe5b988..af336c1d 100644--- a/docs/runtimes/index.mdx+++ b/docs/runtimes/index.mdx@@ -35,6 +35,7 @@ These integrations are grouped by where the agent runs and how telemetry is coll| [Muse Code](/runtimes/muse-code) | Native hooks through a managed hooks file | Session start, prompt, pre-tool, post-tool, permission request, subagent, context compaction, stop, command, and file telemetry || [Oh My Pi](/runtimes/oh-my-pi) | Managed extension hooks | Session lifecycle, prompts, tool lifecycle, operator approval decisions, commands including operator `!` and `$` commands, file reads and edits with the unified patch, MCP tool activity, agent reasoning, and token usage || [OpenCode](/runtimes/opencode) | Managed plugin hooks | Chat messages, session events, command execution, permission activity, diffs, and errors |+| [OpenHands](/runtimes/openhands) | Native hooks merged into the repository's own `.openhands/hooks.json` | Session start and end, prompts, pre-tool and post-tool activity, commands with exit codes and output, file reads and edits with exact before/after diffs, MCP tool calls, and failed tools. No approval decisions or token usage, because OpenHands exposes neither on a hook || [Pi](/runtimes/pi) | Managed extension hooks | Session lifecycle, prompts, tool lifecycle, commands including operator `!` commands, file reads and edits with the unified patch, agent reasoning, and token usage || [Prime Agent](/runtimes/prime-agent) | Not yet collected | Harness identity only. Prime Agent is recognized as its own runtime and its collection method is defined, but no managed extension ships yet, so no events are collected || [Qwen Code](/runtimes/qwen-code) | Native hooks | Session, prompt, pre-tool, post-tool, failed tool, permission request, subagent, stop, session-end, command, and file telemetry |@@ -113,7 +114,7 @@ MDM assets, meaning Jamf Pro Extension Attributes, Fleet osquery queries, and Ri| Factory Droid | Configure launch environment with `OTEL_TELEMETRY_ENDPOINT=http://127.0.0.1:4318`. Asymptote discovers the runtime and validates the endpoint but does not edit shell profiles or launch environments. || OpenClaw Gateway | Configure OTLP in OpenClaw. Use [`beacon endpoint integrations openclaw`](/cli/openclaw) to print local Gateway settings and validate events. |-Install hooks separately in the logged-in user's context when you need richer hook telemetry or inventory heartbeat triggers. This applies to Antigravity CLI, Claude Code, Cline, Codex CLI inventory hooks, Cursor, Devin CLI, Devin Desktop, Factory Droid, Grok Build, Hermes Agent, Muse Code, Oh My Pi, OpenCode, Pi, Qwen Code, and the optional VS Code hooks. fx is the exception with no hooks to install: schedule [`beacon endpoint fx sync`](/cli/endpoint-fx) instead.+Install hooks separately in the logged-in user's context when you need richer hook telemetry or inventory heartbeat triggers. This applies to Antigravity CLI, Claude Code, Cline, Codex CLI inventory hooks, Cursor, Devin CLI, Devin Desktop, Factory Droid, Grok Build, Hermes Agent, Muse Code, Oh My Pi, OpenCode, OpenHands, Pi, Qwen Code, and the optional VS Code hooks. fx is the exception with no hooks to install: schedule [`beacon endpoint fx sync`](/cli/endpoint-fx) instead.If a system collector is running while the CLI is reading the default per-user log, `beacon endpoint status` and the local dashboard surface a runtime-log source warning so you can tell where OTLP events are being written.diff --git a/docs/runtimes/integration-model.mdx b/docs/runtimes/integration-model.mdxindex ccda066b..85359b99 100644--- a/docs/runtimes/integration-model.mdx+++ b/docs/runtimes/integration-model.mdx@@ -25,6 +25,7 @@ Beacon supports multiple [runtime surfaces](/concepts/core-concepts#runtime-surf| [Oh My Pi](/runtimes/oh-my-pi) | Looks for the `omp` executable, treating the resolved agent directory as an extra signal for the same reason as Pi, then checks for Beacon's managed extension at `~/.omp/agent/extensions/beacon.ts` || [fx (Vercel Labs)](/runtimes/vercel-fx) | Looks for the `fx` executable, treating `~/.fx` as an extra signal, then reports how much of the session store under `~/.fx/sessions` a sweep has actually collected. There is no managed file to check, so collection progress is the only honest evidence telemetry is flowing || [Muse Code](/runtimes/muse-code) | Checks Muse's config directory (`$XDG_CONFIG_HOME/muse`, else `~/.config/muse`) for Beacon's managed hooks file and for the `managed_hooks_path` key in Muse's own `settings.json`. Both are reported, because either one alone is a broken install that Muse says nothing about |+| [OpenHands](/runtimes/openhands) | Checks `<repo>/.openhands/hooks.json` and the user-level file (`$OH_PERSISTENCE_DIR`, else `~/.openhands`) for Beacon's hook commands. Both scopes are reported, because OpenHands reads the first file it finds rather than merging them, so a repository file shadows the user one entirely || [Qwen Code](/runtimes/qwen-code) | Looks for the `qwen` executable, treating `~/.qwen` as an extra signal because an npm or version-manager install is often off the inherited `PATH`, then checks `~/.qwen/settings.json` for Beacon's `--platform qwen` hook entries || [Devin CLI](/runtimes/devin) | Looks for the `devin` executable, `~/.config/devin`, or `./.devin`, then checks Beacon hook configuration || [Devin Desktop](/runtimes/devin-desktop) | Checks Cascade/Windsurf hook configuration at `~/.codeium/windsurf/hooks.json` or `./.windsurf/hooks.json` |@@ -47,7 +48,7 @@ During install, Beacon configures the runtime surfaces it can safely manage:| [Factory Droid](/runtimes/factory-droid) | Droid's OTLP endpoint remains under its launch environment, commonly managed through MDM or another customer-owned policy. || [OpenClaw Gateway](/runtimes/openclaw-gateway) | Configure OpenClaw with the `diagnostics-otel` plugin. Beacon prints local OTLP/HTTP setup guidance and validates observed events. || [fx (Vercel Labs)](/runtimes/vercel-fx) | Nothing is installed or configured. fx has no hook file, plugin directory, or OTLP endpoint, so collection is an action: run or schedule [`beacon endpoint fx sync`](/cli/endpoint-fx). |-| Hook-based runtimes | [Antigravity CLI](/runtimes/antigravity-cli), [Claude Code](/runtimes/claude-code), [Cline](/runtimes/cline), [Cursor](/runtimes/cursor), [Devin CLI](/runtimes/devin), [Devin Desktop](/runtimes/devin-desktop), [Factory](/runtimes/factory-droid), [Grok Build](/runtimes/grok-build), [Hermes Agent](/runtimes/hermes-agent), [Muse Code](/runtimes/muse-code), [Oh My Pi](/runtimes/oh-my-pi), [OpenCode](/runtimes/opencode), [Pi](/runtimes/pi), and [Qwen Code](/runtimes/qwen-code) hooks and managed plugins are installed separately with [`beacon endpoint hooks`](/cli/hooks), because hooks are per-user or per-project runtime configuration rather than base collector service configuration. |+| Hook-based runtimes | [Antigravity CLI](/runtimes/antigravity-cli), [Claude Code](/runtimes/claude-code), [Cline](/runtimes/cline), [Cursor](/runtimes/cursor), [Devin CLI](/runtimes/devin), [Devin Desktop](/runtimes/devin-desktop), [Factory](/runtimes/factory-droid), [Grok Build](/runtimes/grok-build), [Hermes Agent](/runtimes/hermes-agent), [Muse Code](/runtimes/muse-code), [Oh My Pi](/runtimes/oh-my-pi), [OpenCode](/runtimes/opencode), [OpenHands](/runtimes/openhands), [Pi](/runtimes/pi), and [Qwen Code](/runtimes/qwen-code) hooks and managed plugins are installed separately with [`beacon endpoint hooks`](/cli/hooks), because hooks are per-user or per-project runtime configuration rather than base collector service configuration. |## Integration paths@@ -68,6 +69,7 @@ During install, Beacon configures the runtime surfaces it can safely manage:| [Prime Agent](/runtimes/prime-agent) | Not yet collected | Another pi-mono fork with the same extension API. Harness identity and the plugin collection method ship today; the managed extension, discovery probe, and install target do not, so no Prime Agent events are collected yet. || [fx (Vercel Labs)](/runtimes/vercel-fx) | Poll of fx's own session store | fx exposes no third-party observation surface: its lifecycle hooks are compiled into the binary, it has no OpenTelemetry export, and its plugin story is MCP. Beacon reads the append-only session records under `~/.fx/sessions` and marks every event `harness.collection_method=poll`, so a consumer knows nothing on this path could have been intercepted. || [Muse Code](/runtimes/muse-code) | Native hook payloads through `beacon-hooks` | Beacon writes a managed hooks file it owns outright and points Muse's own `settings.json` at it with the `managed_hooks_path` key, then maps session, prompt, tool, command, file, approval, subagent, and compaction events into endpoint events. Muse ships an OTLP export that cannot be pointed at a local collector, so hooks are the only collection path. |+| [OpenHands](/runtimes/openhands) | Native hook payloads through `beacon-hooks` | Beacon merges its six commands into the `.openhands/hooks.json` the runtime already reads, preserving hooks you wrote, then maps session, prompt, tool, command, file, and MCP events into endpoint events. File edits carry an exact diff, because OpenHands reports the file's content before and after rather than the edit instruction. || [Qwen Code](/runtimes/qwen-code) | Native hook payloads through `beacon-hooks` | Beacon merges a managed hook block into Qwen's own `settings.json` and maps session, prompt, tool, command, file, failed-tool, approval, and subagent events into endpoint events. Qwen Code is a Gemini CLI fork without Gemini's OTLP export, so hooks are the only collection path. || [Devin CLI](/runtimes/devin) | Native hook payloads through `beacon-hooks` | Hooks emit session, prompt, pre-tool, post-tool, permission request, stop, session-end, approval, and file telemetry where Devin CLI exposes payloads. || [Devin Desktop](/runtimes/devin-desktop) | Cascade/Windsurf hook payloads through `beacon-hooks` | Hooks emit prompt, command, MCP tool, file read, and file write telemetry where Devin Desktop exposes Cascade/Windsurf payloads. |@@ -79,7 +81,7 @@ During install, Beacon configures the runtime surfaces it can safely manage:## Hook telemetry-Antigravity CLI, Claude Code, Cline, Cursor, Devin CLI, Devin Desktop, Factory, Grok Build, Hermes Agent, Muse Code, Oh My Pi, OpenCode, Pi, Qwen Code, and optional VS Code hooks cover activity that is better represented as runtime events than generic OTLP spans.+Antigravity CLI, Claude Code, Cline, Cursor, Devin CLI, Devin Desktop, Factory, Grok Build, Hermes Agent, Muse Code, Oh My Pi, OpenCode, OpenHands, Pi, Qwen Code, and optional VS Code hooks cover activity that is better represented as runtime events than generic OTLP spans.| Runtime | Hook telemetry ||---------|----------------|@@ -97,6 +99,7 @@ Antigravity CLI, Claude Code, Cline, Cursor, Devin CLI, Devin Desktop, Factory,| [Pi](/runtimes/pi) | Session lifecycle, prompt submission, tool invocation and results, command execution including operator `!` commands, file reads, creates, and edits with the unified patch, agent reasoning from assistant thinking parts, and token usage and cost. Approval decisions are not exposed by Pi's extension API and are not synthesized. || [Oh My Pi](/runtimes/oh-my-pi) | Everything Pi reports, plus real operator approval decisions carrying the command or file being decided on, the session's approval mode, and the tool call id. Commands include operator `!` shell and `$` Python prefixes, and MCP tool activity is resolved from Oh My Pi's `mcp__<server>_<tool>` naming. || [Muse Code](/runtimes/muse-code) | Session start, prompt submission, pre-tool and post-tool activity, permission requests, subagent start and stop, context compaction, stop events, command execution, and file activity. Hook timeouts are second values. User scope only: Muse's project `.muse/hooks.json` is ignored by the shipping build. |+| [OpenHands](/runtimes/openhands) | Session start and end, prompt submission, pre-tool and post-tool activity, stop events, command execution with exit code and output, and file activity with exact before/after diffs. Hook timeouts are second values. Both scopes work, but project scope is the one every host reads: OpenHands takes the first hooks file it finds, and its agent server never consults the user-level one. || [Qwen Code](/runtimes/qwen-code) | Session lifecycle, prompt submission, pre-tool and post-tool activity, post-tool failures, permission requests, subagent start and stop, stop events, session-end events, command execution, and file activity where payloads are available. Hook timeouts are millisecond values, and project-level hooks require a trusted folder in Qwen. |Hook events include metadata such as file path, operation, language, diff hash, and diff byte count. Raw diffs are subject to Beacon's redaction, sanitization, truncation, and event-size limits before writing.diff --git a/docs/runtimes/openhands.mdx b/docs/runtimes/openhands.mdxnew file mode 100644index 00000000..5d890dfc--- /dev/null+++ b/docs/runtimes/openhands.mdx@@ -0,0 +1,208 @@+---+title: "OpenHands"+description: "Asymptote support details for OpenHands endpoint telemetry"+---++## Runtime overview++Asymptote supports OpenHands — the open-source coding agent from All Hands — through its native [hooks](https://docs.openhands.dev/openhands/usage/customization/hooks), sent to `beacon-hooks`.++```bash+beacon endpoint hooks install --harness openhands --level project+```++`--harness open-hands` is also accepted.++OpenHands runs the same agent in three places — Cloud, the CLI, and the local GUI — and all three read hooks from the same `.openhands/hooks.json`. There is one integration rather than three.++<Note>+**OpenHands LM is the model family; OpenHands is the agent.** Asymptote hooks the agent, so the harness name is `openhands`. OpenHands LM spellings are deliberately **not** accepted as harness aliases and are **not** mapped to the harness name: every one of those model ids begins with the same word the harness does, so a substring rule would file any event carrying one under the agent, and a reader could not tell that from a real session.+</Note>++## Prerequisites++Before enabling OpenHands telemetry, make sure:++- OpenHands is installed and available as the `openhands` executable, or you are running the SDK directly.+- `beacon endpoint install` has run so shared endpoint config and runtime log paths exist.+- OpenHands is restarted after hook install or removal so new conversations load the updated registration.++## Collection path++OpenHands registers hooks in **one JSON file that you also own**, so Asymptote merges its commands into it rather than writing a file of its own. Hooks you already have are preserved exactly, including their matchers, timeouts, and any fields Asymptote has no model for.++| Scope | File | Read by |+|-------|------|---------|+| Project | `<repo>/.openhands/hooks.json` | Cloud, the CLI, the local GUI, and the SDK |+| User | `~/.openhands/hooks.json` | The SDK's own loader only |++`$OH_PERSISTENCE_DIR` replaces `~/.openhands` when it is set, matching how OpenHands resolves the directory itself. Sandboxed and containerized setups use it to move state onto a volume.++<Warning>+**Project scope is the one that works everywhere.** OpenHands reads the **first** hooks file it finds rather than merging the two, so a repository with its own `.openhands/hooks.json` shadows the user-level file entirely. The agent server behind the CLI and the GUI does not consult the user file at all. Install at `--level project` inside each repository you want covered; a user-scope install is right for someone driving the SDK directly and silently inert for everyone else.+</Warning>++`beacon endpoint inventory` reports both scopes, so a user-level install shadowed by a repository file is visible as that rather than as a working one.++### Registered events++OpenHands exposes six lifecycle events and Asymptote registers all six. Nothing is left out — this is the runtime's whole hook surface.++| OpenHands event | Adapter subcommand | Matcher | Timeout |+|-----------------|--------------------|---------|---------|+| `session_start` | `session-start` | `*` | 10 s |+| `user_prompt_submit` | `prompt-submit` | `*` | 30 s |+| `pre_tool_use` | `pre-tool` | `*` | 10 s |+| `post_tool_use` | `post-tool` | `*` | 10 s |+| `stop` | `stop` | `*` | 45 s |+| `session_end` | `session-end` | `*` | 45 s |++<Warning>+**OpenHands hook timeouts are seconds, not milliseconds.** The same `timeout` field is milliseconds on [Qwen Code](/runtimes/qwen-code), in a hooks file that looks similar. OpenHands' own default is 60 seconds; Asymptote writes explicit lower values, because 60 seconds is a long time to hold an agent turn for a hook that finishes in milliseconds. These are ceilings on a hang, not budgets.+</Warning>++Hooks are registered synchronously rather than with `"async": true`. An async hook is fire-and-forget with its stdout discarded, which would make the [policy seam](#approvals-and-enforcement) unable to deny on the one event that can block.++### The file format fails silently++`hooks.json` has a closed schema, and every way of getting it wrong ends with hooks silently not running rather than with an error you see. Asymptote's installer is shaped around that, and each of these is covered by a test:++- **The top level is the event map itself, and unknown keys are fatal.** One unrecognized top-level key fails validation and the whole file loads as nothing. That is why Asymptote writes no marker key here, unlike the files it owns on other runtimes: an install is recognized by the hook command it contains.+- **A legacy `{"hooks": {...}}` wrapper is accepted, and the loader unwraps it by replacing the whole document.** Adding a top-level event beside an existing wrapper therefore does not merge — it discards the added hooks. Asymptote writes **inside** the wrapper when it finds one.+- **Event names may be snake_case or Claude Code's PascalCase, and naming one event both ways is fatal to the entire file.** Asymptote writes under whichever spelling the file already uses for an event and never introduces a second one, so a `hooks.json` shared with Claude Code keeps its PascalCase names.++A file that already breaks one of these is **refused** with an error naming the problem, rather than written into. Asymptote cannot fix it, and installing would report success while OpenHands went on loading nothing.++### The hook environment++OpenHands runs hook commands through a shell with the conversation's working directory as the cwd, and exports `OPENHANDS_EVENT_TYPE`, `OPENHANDS_TOOL_NAME`, `OPENHANDS_PROJECT_DIR`, and `OPENHANDS_SESSION_ID`.++Asymptote passes the endpoint log and config locations to `beacon-hooks` as `--log` and `--config` flags rather than through the environment, so a hook finds them wherever it runs. `OPENHANDS_PROJECT_DIR` is read as a fallback for the workspace path, because the payload's `working_dir` is optional and null when the SDK was given no working directory.++## Discovery and status++```bash title="Show OpenHands hook status"+beacon endpoint hooks status --harness openhands --level project+```++OpenHands reports as the `openhands` harness with capability `hooks`, and every event carries `harness.collection_method=hook`: the events, the payload shapes, and the `hooks.json` contract are all the vendor's, and Asymptote ships no plugin source of its own for this runtime.++## Install or configuration support++`beacon endpoint install` prepares shared endpoint config and runtime log paths. OpenHands hooks are installed separately, because they live in a repository or a user config directory rather than in collector service configuration:++```bash+beacon endpoint hooks install --harness openhands --level project # inside the repository+beacon endpoint hooks status --harness openhands --level project+beacon endpoint hooks uninstall --harness openhands --level project+```++Commit `.openhands/hooks.json` if you want the hooks to apply to everyone working in the repository, the same way the OpenHands documentation describes for hooks you write yourself.++Re-running the install replaces Asymptote's own hooks rather than adding a second copy, so a repair does not end with the binary firing twice per event. Uninstall removes what Asymptote added and nothing else; a file that still holds your own hooks is rewritten without Asymptote's, and a file left with nothing in it is removed rather than left behind as an empty stub.++## Telemetry coverage++| Area | Support |+|------|---------|+| Runtime discovery | Supported through `.openhands/hooks.json` at both scopes |+| Harness attribution | Supported. `openhands`, `open_hands`, `open-hands`, `open hands`, `openhands_cli`, `openhands-cli`, `openhands cli`, `openhands_agent`, `openhands-agent`, `openhands agent`, and `openhands.dev` normalize to `openhands` |+| Hook install, status, uninstall, and repair | Supported |+| Session lifecycle | Supported. `session.started` and `session.ended` from `session_start` and `session_end`, plus `tool.completed` from `stop` |+| Prompts | Supported. `prompt.submitted` from `user_prompt_submit`, read from the payload's `message` field |+| Tool use | Supported for pre-tool and post-tool activity |+| Commands | Supported. `command.executed` with the command, its exit code, and its output |+| File activity | Supported. `file.read` and `file.modified` with paths, operations, and exact diffs |+| MCP activity | Supported on post-tool, recognized from the tool result. See [Known gaps](#known-gaps) for pre-tool |+| Failed tools | Supported. `tool.failed` at high severity when the tool result reports an error |+| Approval decisions | Not collected. See [Known gaps](#known-gaps) |+| Token usage and cost | Not collected. See [Known gaps](#known-gaps) |+| Tool call identity | Not collected. See [Known gaps](#known-gaps) |+| Local JSONL and dashboard | Supported |+| MDM deployment | Supported for the endpoint agent. OpenHands hooks are installed per repository or in the logged-in user's context |++### Tool taxonomy++OpenHands sends the Claude Code payload *shape* but its own tool names, and one of them cannot be classified by name at all:++| Tool | Recorded as |+|------|-------------|+| `terminal` | `command.executed`, with `command.exit_code` and `command.output` |+| `file_editor`, `planning_file_editor` | `file.read` for `command=view`; `file.modified` for `create`, `str_replace`, `insert`, and `undo_edit` |+| `apply_patch` | One `file.modified` per file the patch committed |+| `read_file`, `list_directory`, `glob`, `grep` | `file.read` |+| `write_file`, `edit` | `file.modified` |+| MCP tools | `mcp.tool_invoked`, recognized from the tool result |+| `think`, `finish`, `task_tracker`, the browser set, and everything else | `tool.invoked` |++`file_editor` is the reason this table exists. It multiplexes five operations onto one tool name and selects between them with a `command` argument, so a classifier that only sees the name is wrong on one of `view`/`str_replace` whichever way it answers — and that is misclassification rather than absence, which is the worse failure: the event is there, the action is wrong, and nothing looks broken. A `file_editor` call whose `command` did not arrive is recorded as `tool.invoked`, which says a tool ran and nothing about what it did to the file.++### Diffs come from the file, not from the request++Every other runtime's diff is reconstructed from what the model *asked* for — an `old_string`/`new_string` pair, a patch body, a full-file write — and the reconstruction is only as right as the assumption that the tool did exactly what it was told.++OpenHands reports the file's whole content before and after on the observation, so nothing has to be inferred. An insert at line 40 and a single-occurrence replace both come back as the same two strings and produce a diff that matches what is on disk. An `apply_patch` that applied with fuzz records what landed, not what was requested.++Diffs are captured for the file types Asymptote scans, subject to the usual retention, redaction, and size controls. An edit to a file outside that set is still recorded as `file.modified` with its path — it simply carries no diff.++A failed edit is never recorded as an edit. The editor reports a failed `str_replace` with the same tool name and the same arguments as a successful one, so without that guard a diff would be built from a write that never landed and the log would assert a file changed when it did not.++## Approvals and enforcement++**Asymptote records no approval decisions for OpenHands, and does not synthesize any.** OpenHands exposes no approval hook: `pre_tool_use` announces a tool call the agent is about to make, not a question anybody was asked, and its own confirmation mode is not surfaced to hooks. Recording an `approval.allowed` from it would put an operator decision in the log that no operator made — the same call already settled for [Cline](/runtimes/cline), [Pi](/runtimes/pi), and [fx](/runtimes/vercel-fx).++Asymptote's `pre_tool_use` hook answers with an empty object. OpenHands reads `decision`, `reason`, `additionalContext`, and `continue` from a hook's stdout; a speculative `allow` carries none of those and is inert today, but the raw string is shown in the conversation as a decision Asymptote did not make, and would begin taking effect if OpenHands ever read that key.++Enforcement stays behind the optional, off-by-default policy provider seam (`BEACON_POLICY_PROVIDER`), which is inert unless it names an executable and fails open on any error. OpenHands is one of the runtimes where a provider deny does take effect: `pre_tool_use` can block, and Asymptote answers a deny with `{"decision": "deny", "reason": "..."}`. The reason is sent because OpenHands surfaces it in the conversation as the explanation for the block and hands it to the agent as the tool's failure — without it, the operator and the model both see a call refused with no account of why.++## Data handling++OpenHands content is handled like every other runtime. Prompts, tool arguments, commands, command output, paths, and diffs are retained in local or customer-controlled logs, with local secret redaction and per-string limits applied before writing, and a hash and byte count on each content-bearing event. Events over the 64 KiB limit drop raw and retained content, preserve stable metadata, and set `field_truncated`.++Unlike [Qwen Code](/runtimes/qwen-code) and [Muse Code](/runtimes/muse-code), Asymptote does **not** preserve the verbatim OpenHands payload under a `raw` key. The payload's only field with no schema home is `metadata`, which is empty on five of the six events and carries a constant `reason` on `stop`. Keeping the payload would cost the whole `tool_input` and `tool_response` on every event — file contents included, twice over on an edit — to preserve a value that never varies.++Image parts in a tool result are skipped rather than described: they carry base64 data URLs, often megabytes of them, and writing one into an event field would be worse than recording nothing.++## Known gaps++- **No approval decisions.** OpenHands has no approval or permission hook, and Asymptote does not synthesize one from `pre_tool_use`. Approval rules and dashboards will show nothing for this runtime.+- **No token usage or cost.** None of the six hook payloads carries token counts or cost, and OpenHands exposes no other hook that would. OpenHands activity therefore does not appear in `beacon token-usage` reports or the dashboard token view.+- **No tool call identity.** The hook payload carries no per-call identifier, so `gen_ai.tool.call.id` is absent and a pre-tool event cannot be joined to its post-tool event by id. The `HookEvent` model has no field for it; the id exists on the conversation's action event, which hooks are not given.+- **MCP calls are only identifiable after the fact.** OpenHands calls an MCP tool by whatever name its server gave it, with no prefix and no `mcp_*` argument, so the only thing that says a call went to an MCP server is the result it came back with. A `pre_tool_use` event for an MCP tool is recorded under the action its name implies. The MCP server name is not exposed on the result at all, so `mcp.server` is empty.+- **No transcript path.** Conversation state lives in the OpenHands persistence directory and no payload field points at it, so nothing on this path reads it.+- **No compaction or subagent events.** OpenHands emits neither on a hook. Its `Stop` hook is a turn boundary, not a session end; the session-end event is separate and Asymptote registers both.+- **A user-scope install is shadowed by a repository's own hooks file, and invisible to the agent server.** See the warning under [Collection path](#collection-path). This is OpenHands' loader behaviour, not something Asymptote can work around.+- **Assistant response text is not collected.** No hook payload carries it.++## Deployment notes++Hooks are loaded when a conversation starts, so an install taken while OpenHands is running takes effect on the next conversation. Restart OpenHands, or start a new conversation, after installing or removing hooks.++Confirm status, then generate one OpenHands event and check the log:++```bash+beacon endpoint hooks status --harness openhands --level project+beacon endpoint doctor --system+grep '"name":"openhands"' ~/.beacon/endpoint/logs/runtime.jsonl | tail -3+```++If OpenHands telemetry is missing:++- Confirm you installed at the scope the runtime reads. The CLI, the GUI, and Cloud read only `<repo>/.openhands/hooks.json`.+- Confirm no *other* `.openhands/hooks.json` is shadowing the one you installed. OpenHands takes the first it finds and does not merge.+- Confirm the file contains commands with `--platform openhands`.+- Check `$OH_PERSISTENCE_DIR`: if it is set, the user-scope file is under that directory, not `~/.openhands`.+- Confirm hook timeouts are second values, not milliseconds.+- In the CLI, run `/skills` to see the skills, hooks, and MCPs loaded for the current session.+- Start a new conversation so the updated registration is loaded.++## Related++<Columns cols={2}>+ <Card title="Supported agent harnesses" icon="list-check" href="/runtimes">+ Return to the runtime support overview.+ </Card>+ <Card title="Agent harness integration model" icon="plug" href="/runtimes/integration-model">+ See how Asymptote discovers and configures each runtime.+ </Card>+</Columns>