Skip to content

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

Merge remote-tracking branch 'origin/main' into claude/quirky-davinci-5d0yj0

Claude79ca0af84264
diff --cc CLAUDE.md
index 2a856e9b,f9cf9368..550a3f45
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@@ -46,10 -46,9 +46,10 @@@ Supported runtime surfaces today
- OpenCode uses the managed plugin for live capture and approvals, plus `beacon endpoint opencode sync` for current SQLite and legacy file-store backfill. Poll events are marked `harness.collection_method=poll`, cannot hold or deny tools, and must not synthesize approvals from persisted tool results.
- Muse Code uses a Beacon-owned hooks file referenced by Muse `settings.json` via `managed_hooks_path`. Muse Spark is the model, not the runtime; do not normalize Spark spellings to `muse_code`. `PreLLMCall`/`PostLLMCall` stay unsubscribed because they carry full message arrays/tool schemas and chunked responses.
- OpenHands hooks are merged into the runtime's own `.openhands/hooks.json`. Project scope is the practical default because the loader takes the first hooks file and the CLI/GUI agent server reads the repository file. Approvals, token usage/cost, per-call tool ids, and assistant response text are not exposed or synthesized.
+- Kimi Code registers in the `[[hooks]]` array of the runtime's own `$KIMI_CODE_HOME/config.toml` (default `~/.kimi-code`), the same file that holds `[providers.<name>].api_key`. Beacon appends its block and never re-serializes the document, and every write is parsed back and compared against the intended result before it replaces the file. Detection and removal go by the hook command rather than by Beacon's comment, because Kimi Code's legacy `kimi-cli` migration re-serializes config.toml and drops every comment. There is no project scope: Kimi Code reads one user-level config file. Thirteen of its twenty events are registered; `SessionHeartbeat` is deliberately left out because its sixty-second timer runs only when a hook is configured for it, and `Interrupt` because Beacon's closing action asserts the agent finished. Kimi Code reports real operator approval decisions over `PermissionRequest`/`PermissionResult`, so `PreToolUse` must not also synthesize one. Beacon writes nothing to stdout on this runtime, because `UserPromptSubmit` stdout is appended to the model's context; the policy seam denies with exit code 2 and is inert in the permission-request phase, which Kimi Code does not allow blocking. No token usage is exposed on any hook payload.
- Kiro uses one Beacon-owned hook file under `.kiro/hooks` or `$KIRO_HOME`/`~/.kiro/hooks`. Its hook stdout is added to agent context on `SessionStart` and `UserPromptSubmit`, so Beacon writes nothing to stdout on Kiro; blocking is exit code 2 with the reason on stderr. Approvals are not exposed or synthesized.
- goose currently has only the adapter: `cli/beacon-hooks/cmd/goose.go` can map a manually written `hooks.json` that invokes `beacon-hooks --platform goose`, but there is no `beacon endpoint hooks install --harness goose`, no `DiscoverGoose`, and no automatic OTLP configuration. Keep README/docs from implying goose is generally installable until those pieces exist. goose uses HTTP OTLP (4318), its blocking hook stdout must be `{"decision":"allow"}` or `{"decision":"block"}`, and it exposes no approval decisions or tool output.
- - DeepSeek Harness (`dsh`) is installed through two user-level files: `$DSH_HOME/beacon-endpoint-hooks.json` and a row in `$DSH_HOME/cordis.patch.yml`; there is no project scope. It rides the Claude-shaped envelope, but `run_code` remains `tool.invoked` because nested commands fire their own hooks.
+ - DeepSeek Harness (`dsh`) is installed through two user-level files: `$DSH_HOME/beacon-endpoint-hooks.json` and a row in `$DSH_HOME/cordis.patch.yml`; there is no project scope. It also installs a Beacon-owned local skill at `$DSH_HOME/skills/beacon-endpoint/SKILL.md` and supports native session backfill from `$DSH_HOME/sessions` through `beacon endpoint dsh sync`, which fills assistant text/reasoning, tool failures, and token usage that the hook bridge does not expose. It rides the Claude-shaped envelope on the hook path, but `run_code` remains `tool.invoked` because nested commands fire their own hooks.
- 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.
- OpenClaw Gateway uses a Beacon-managed plugin directory plus OpenClaw's own diagnostics OTLP guidance (`beacon endpoint integrations openclaw`). The plugin's `before_tool_call` hook is fail-closed, so the handler dispatches synchronously and returns without awaiting. Conversation hooks, including `llm_output`, require `plugins.entries.beacon-endpoint.hooks.allowConversationAccess`; without it, token and agent-message coverage is partial. Beacon reads OpenClaw JSON/JSON5 config for advice but does not rewrite it.
diff --cc cli/beacon/internal/endpoint/harness/harness.go
index c2e85837,68b2c4f2..9a6845c1
--- a/cli/beacon/internal/endpoint/harness/harness.go
+++ b/cli/beacon/internal/endpoint/harness/harness.go
@@@ -64,8 -64,8 +64,9 @@@ func DiscoverAll() []Harness
DiscoverPrime(),
DiscoverOmo(),
DiscoverFx(),
+ DiscoverDsh(),
DiscoverQwen(),
+ DiscoverKimi(),
DiscoverHermes(),
DiscoverFactory(),
DiscoverVSCode(),
diff --cc cli/beacon/internal/tokens/coverage.go
index ae81d8e8,a2d1ad08..f64475cb
--- a/cli/beacon/internal/tokens/coverage.go
+++ b/cli/beacon/internal/tokens/coverage.go
@@@ -113,18 -114,6 +114,17 @@@ var usageExpectation = map[string]struc
"chatgpt_web": {ExpectNone, "the chat stream reports no token counts"},
"openhands": {ExpectNone, "hook payloads carry no token counts"},
"kiro": {ExpectNone, "hook payloads carry no token counts"},
- // The bridge builds each hook payload from a fixed base plus per-event fields, and no usage
- // count is among them on any of the seven events it supports. dsh does record usage -- in its
- // own session log -- but nothing in the hook surface exposes it, so a DeepSeek Harness session
- // reporting no tokens is correct rather than silent.
- "deepseek_harness": {ExpectNone, "the hook bridge's payloads carry no token counts"},
+ // Kimi Code assembles each hook payload from a fixed envelope plus per-event fields, and no
+ // usage count is among them on any of the twenty events it exposes. The runtime does count
+ // tokens -- the TUI shows context occupancy, and PreCompact carries a `token_count` for the
+ // history it is about to summarize -- but neither is per-call spend, so promoting either into
+ // gen_ai.usage would make a level look like an additive total. A Kimi Code session reporting
+ // no tokens is therefore correct rather than silent.
++ //
++ // Unlike DeepSeek Harness above, which moved to ExpectReported once it gained a session
++ // backfill, there is no poll path here to read usage from: Beacon collects Kimi Code through
++ // hooks only, and the runtime's own session store is not read.
+ "kimi_code": {ExpectNone, "hook payloads carry no token counts; PreCompact reports context only"},
}
// InstalledConfig is the part of a config-scanner row that install detection reads.
diff --cc docs/runtimes/index.mdx
index dc6c66e0,ee60e90c..463866c1
--- a/docs/runtimes/index.mdx
+++ b/docs/runtimes/index.mdx
@@@ -31,10 -31,9 +31,10 @@@ These integrations are grouped by wher
| [Factory Droid](/runtimes/factory-droid) | OTLP HTTP, optional hooks, and poll of `~/.factory/sessions` through `beacon endpoint factory sync` | OTLP/hooks: session, prompt, write/edit/create tool use, stop, session-end, and available OTLP telemetry. Poll: historical session records committed by Factory |
| [fx (Vercel Labs)](/runtimes/vercel-fx) | Poll of fx's own session records under `~/.fx/sessions` through `beacon endpoint fx sync` | Session start, prompts, tool calls, commands with exit codes and output, file reads and edits with diffs, MCP tool calls, agent messages, history compaction, and token usage and cost. No approval or session-end telemetry, because fx persists neither |
| [Gemini CLI](/runtimes/gemini-cli) | Opt-in local OTLP | Prompts, tool calls, MCP activity, file operations, and approval-related events emitted through OTLP |
- | [GitHub Copilot CLI](/runtimes/github-copilot-cli) | MDM-managed OTLP HTTP | Prompt, session, tool, and approval-like activity emitted through Copilot CLI spans |
+ | [GitHub Copilot CLI](/runtimes/github-copilot-cli) | MDM-managed OTLP HTTP plus poll of `~/.copilot/session-state` through `beacon endpoint copilot sync` | OTLP: prompt, session, tool, and approval-like activity emitted through Copilot CLI spans. Poll: assistant text, complete tool results, commands, files, and token usage from committed session records |
| [goose](/runtimes/goose) | Adapter only today: manually written plugin hooks in `.agents/plugins/`, plus manually configured local OTLP export over HTTP | Hooks: session start and end, prompts, pre-tool and post-tool activity, failed tools, command lines, file creates and edits with diffs, and MCP tool calls. OTLP adds token usage, model and provider, response ids, and agent reasoning. No automatic installer/discovery yet, no tool output of any kind on the hook path, and no approval decisions because goose exposes none of those on a hook |
| [Grok Build](/runtimes/grok-build) | Native hooks plus optional poll of `~/.grok/sessions` through `beacon endpoint grok sync` | Hooks: session, prompt, pre-tool, post-tool, failed tool, stop, session-end, command, and file telemetry. Poll: historical committed sessions, tool activity, commands, file activity, and compaction where persisted |
+| [Kimi Code](/runtimes/kimi-code) | Native hooks appended to the `[[hooks]]` array of Kimi Code's own `$KIMI_CODE_HOME/config.toml` | Session start and end, prompts, pre-tool and post-tool activity, failed tools, real operator approval decisions, commands with output and exit code, file reads and edits with diffs, MCP tool calls, subagents, and context compaction. No token usage or agent message text, because Kimi Code exposes neither on a hook |
| [Kiro](/runtimes/kiro) | Native hooks through a Beacon-owned file in `.kiro/hooks/` | Session start, prompts, pre-tool and post-tool activity, commands with output, file reads and edits, MCP tool calls, failed tools, and the agent's final response. No approval decisions or token usage, because Kiro exposes neither on a hook |
| [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 |