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
Merge remote-tracking branch 'origin/main' into claude/gallant-curie-cqv4rr-l-openclaw
Claude6d2f56832b8e
diff --cc cli/beacon/internal/handoff/resume_test.goindex 31069b52,756280a0..c79bd8f1--- a/cli/beacon/internal/handoff/resume_test.go+++ b/cli/beacon/internal/handoff/resume_test.go@@@ -26,7 -26,7 +26,7 @@@ func installed(names ...string) func(stvar allRuntimes = installed("claude", "codex", "opencode", "cline", "pi", "prime-agent", "droid","omp", "gemini", "qwen", "kiro-cli", "agy", "devin", "muse", "openhands", "goose", "copilot",- "hermes", "fx", "openclaw")- "hermes", "fx", "grok")++ "hermes", "fx", "grok", "openclaw")// resumableSession is a session whose directory and session file both exist.func resumableSession(t *testing.T, harness, id string) Session {@@@ -85,8 -85,7 +85,9 @@@ func TestPlanResumeStartsANewSessionInE{HarnessPrime, "prime-agent", []string{"--"}},{HarnessFactory, "droid", nil},{HarnessCopilot, "copilot", []string{"-i"}},+ {HarnessGrok, "grok", []string{"--permission-mode", "default"}},+ // {key} stands for the fresh Gateway session key the prompt derives.+ {HarnessOpenClaw, "openclaw", []string{"tui", "--session", "{key}", "--message"}},{HarnessOhMyPi, "omp", []string{"--approval-mode=always-ask"}},{HarnessGemini, "gemini", []string{"--approval-mode", "default", "--prompt-interactive"}},{HarnessQwen, "qwen", []string{"--approval-mode", "default", "--prompt-interactive"}},diff --cc cli/beacon/internal/handoff/runtimes.goindex 6bde81ac,47b288a7..70c69c4f--- a/cli/beacon/internal/handoff/runtimes.go+++ b/cli/beacon/internal/handoff/runtimes.go@@@ -11,8 -11,8 +11,9 @@@ import"github.com/asymptote-labs/agent-beacon/cli/beacon/internal/dshsession""github.com/asymptote-labs/agent-beacon/cli/beacon/internal/factorysession""github.com/asymptote-labs/agent-beacon/cli/beacon/internal/fxsession"+ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/groksession""github.com/asymptote-labs/agent-beacon/cli/beacon/internal/hermessession"+ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/openclawsession""github.com/asymptote-labs/agent-beacon/cli/beacon/internal/opencodesession""github.com/asymptote-labs/agent-beacon/cli/beacon/internal/pisession""github.com/asymptote-labs/agent-beacon/cli/beacon/internal/primesession"@@@ -67,7 -67,7 +68,8 @@@ constHarnessHermes = hermessession.HarnessHarnessDSH = dshsession.HarnessHarnessFx = fxsession.Harness+ HarnessGrok = groksession.Harness+ HarnessOpenClaw = openclawsession.Harness// Runtimes Beacon starts but whose sessions it reads only from the runtime log.HarnessOhMyPi = "omp"@@@ -257,27 -257,29 +259,50 @@@ var runtimes = []Runtime// one-shot), so it reopens its own sessions but cannot pick one up from a brief.},},+ {+ Harness: HarnessGrok,+ Label: "Grok Build",+ Aliases: []string{"grok-build"},+ NewSource: func(dir string) Source { return &grokSource{dir: dir} },+ // Grok's configured permission mode can be always-approve. A session Beacon starts or+ // reopens runs in the mode that asks, whatever the config says; the user can still change+ // the mode inside the TUI.+ Command: &runtimeCommand{+ Executable: "grok",+ Resume: func(s Session) ([]string, bool) {+ // A subagent is a child of the session that spawned it, not one a person reopens.+ if s.Subagent {+ return nil, false+ }+ // Grok looks a session up under the directory it runs in, which is the session's own.+ return []string{"--permission-mode", "default", "--resume", s.ID}, true+ },+ NewSession: func(prompt string) []string { return []string{"--permission-mode", "default", prompt} },+ // Grok looks a session id up under the directory it is started in.+ ResumesInSessionDir: true,+ },+ },+ {+ Harness: HarnessOpenClaw,+ Label: "OpenClaw Gateway",+ Aliases: []string{"openclaw", "openclaw-gateway"},+ NewSource: func(dir string) Source { return &openClawSource{dir: dir} },+ // The TUI is a client of the Gateway: it needs the Gateway running, and a conversation lives+ // on the Gateway under its session key, not its transcript id. --deliver stays off, so+ // replies are not sent out through the Gateway's chat channels.+ Command: &runtimeCommand{+ Executable: "openclaw",+ Resume: func(s Session) ([]string, bool) {+ if s.Key == "" {+ return nil, false+ }+ return []string{"tui", "--session", s.Key}, true+ },+ NewSession: func(prompt string) []string {+ return []string{"tui", "--session", openClawNewSessionKey(prompt), "--message", prompt}+ },+ },+ },// The runtimes below keep no session store Beacon reads. Their sessions come from Beacon's// runtime log, so they always continue from a brief; each can also be the runtime anotherdiff --cc docs/cli/handoff.mdxindex dfc088e3,ea95eb5a..0810ff2b--- a/docs/cli/handoff.mdx+++ b/docs/cli/handoff.mdx@@@ -30,13 -30,11 +30,14 @@@ Sessions come from each runtime's own l| Hermes Agent | `~/.hermes/state.db` | `hermes` || DeepSeek Harness | `~/.dsh/sessions` (or under `DSH_HOME`) | `dsh` || fx | `~/.fx/sessions` | `fx` |+ | Grok Build | `~/.grok/sessions` | `grok` |+| OpenClaw Gateway | `~/.openclaw/agents/<agent>/sessions` for every agent (or under `OPENCLAW_STATE_DIR`) | `openclaw` |- When a Codex thread has more than one rollout file, `beacon handoff` lists it once, under its newest file. Cline can hold the same task both as a CLI session and in its older task history; the CLI session is the copy that is listed. Cline kanban cards are not sessions and are not listed. Prime Agent subagent transcripts, under `session-artifacts`, are listed as subagents of the session that started them. Hermes Agent delegate subagents are listed as subagents of the session that spawned them. When Hermes compresses a long conversation it continues it in a new session; each of those sessions is listed, and reopening any of them reopens the latest. A DeepSeek Harness session that DSH spawned for delegated work is listed as a subagent of the session that started it; a fork of a session is listed as a session of its own. OpenClaw transcript ids are unique only within one agent. When two agents hold the same id, both are listed, and `export` and `resume` report the id as ambiguous rather than pick one.-When a Codex thread has more than one rollout file, `beacon handoff` lists it once, under its newest file. Cline can hold the same task both as a CLI session and in its older task history; the CLI session is the copy that is listed. Cline kanban cards are not sessions and are not listed. Prime Agent subagent transcripts, under `session-artifacts`, are listed as subagents of the session that started them. Hermes Agent delegate subagents are listed as subagents of the session that spawned them. When Hermes compresses a long conversation it continues it in a new session; each of those sessions is listed, and reopening any of them reopens the latest. A DeepSeek Harness session that DSH spawned for delegated work is listed as a subagent of the session that started it; a fork of a session is listed as a session of its own. Grok Build keeps its subagents' child sessions in the same tree as other sessions; those whose `summary.json` has a subagent `session_kind` are listed as subagents.++When a Codex thread has more than one rollout file, `beacon handoff` lists it once, under its newest file. Cline can hold the same task both as a CLI session and in its older task history; the CLI session is the copy that is listed. Cline kanban cards are not sessions and are not listed. Prime Agent subagent transcripts, under `session-artifacts`, are listed as subagents of the session that started them. Hermes Agent delegate subagents are listed as subagents of the session that spawned them. When Hermes compresses a long conversation it continues it in a new session; each of those sessions is listed, and reopening any of them reopens the latest. A DeepSeek Harness session that DSH spawned for delegated work is listed as a subagent of the session that started it; a fork of a session is listed as a session of its own. Grok Build keeps its subagents' child sessions in the same tree as other sessions; those whose `summary.json` has a subagent `session_kind` are listed as subagents. OpenClaw transcript ids are unique only within one agent. When two agents hold the same id, both are listed, and `export` and `resume` report the id as ambiguous rather than pick one.-`--store-dir <runtime>=<path>` takes the location in the table: for Pi its sessions directory, as `beacon endpoint pi sync --sessions-dir` does, and for Prime Agent the agent directory holding both of its roots. For Factory Droid it is the sessions directory, as `beacon endpoint factory sync --sessions-dir` does. For GitHub Copilot CLI it is the `~/.copilot` directory that holds `session-state`, as `beacon endpoint copilot sync --copilot-dir` does. For Hermes Agent it is the `state.db` file, as `beacon endpoint hermes sync --db` does. For DeepSeek Harness it is its `DSH_HOME`, as `beacon endpoint dsh sync --dsh-home` does. For fx it is its sessions directory, as `beacon endpoint fx sync --sessions-dir` does. For Grok Build it is its sessions directory, as `beacon endpoint grok sync --sessions-dir` does. Like that sync, `beacon handoff` does not read `GROK_HOME`; pass `--store-dir grok=$GROK_HOME/sessions` when it is set.+OpenClaw Gateway sessions are read from the JSONL transcripts and the `sessions.json` index in each agent's `sessions` directory, as `beacon endpoint openclaw sessions sync` reads them. Recent OpenClaw releases keep live sessions in a per-agent SQLite database and treat that directory as legacy, so sessions that exist only in the database are not listed.+- `--store-dir <runtime>=<path>` takes the location in the table: for Pi its sessions directory, as `beacon endpoint pi sync --sessions-dir` does, and for Prime Agent the agent directory holding both of its roots. For Factory Droid it is the sessions directory, as `beacon endpoint factory sync --sessions-dir` does. For GitHub Copilot CLI it is the `~/.copilot` directory that holds `session-state`, as `beacon endpoint copilot sync --copilot-dir` does. For Hermes Agent it is the `state.db` file, as `beacon endpoint hermes sync --db` does. For DeepSeek Harness it is its `DSH_HOME`, as `beacon endpoint dsh sync --dsh-home` does. For fx it is its sessions directory, as `beacon endpoint fx sync --sessions-dir` does. For OpenClaw Gateway it is its state directory, as `beacon endpoint openclaw sessions sync --openclaw-dir` does.++`--store-dir <runtime>=<path>` takes the location in the table: for Pi its sessions directory, as `beacon endpoint pi sync --sessions-dir` does, and for Prime Agent the agent directory holding both of its roots. For Factory Droid it is the sessions directory, as `beacon endpoint factory sync --sessions-dir` does. For GitHub Copilot CLI it is the `~/.copilot` directory that holds `session-state`, as `beacon endpoint copilot sync --copilot-dir` does. For Hermes Agent it is the `state.db` file, as `beacon endpoint hermes sync --db` does. For DeepSeek Harness it is its `DSH_HOME`, as `beacon endpoint dsh sync --dsh-home` does. For fx it is its sessions directory, as `beacon endpoint fx sync --sessions-dir` does. For Grok Build it is its sessions directory, as `beacon endpoint grok sync --sessions-dir` does. Like that sync, `beacon handoff` does not read `GROK_HOME`; pass `--store-dir grok=$GROK_HOME/sessions` when it is set. For OpenClaw Gateway it is its state directory, as `beacon endpoint openclaw sessions sync --openclaw-dir` does.fx records no session title, so an fx session is listed under its first prompt, and its directory is the workspace fx last bound it to.@@@ -71,7 -69,7 +72,7 @@@ beacon handoff list --jso| Flag | Description ||------|-------------|- | `--harness` | Only this runtime: `claude`, `codex`, `opencode`, `cline`, `pi`, `prime`, `droid`, `copilot`, `hermes`, `dsh`, `fx` or `openclaw`. |-| `--harness` | Only this runtime: `claude`, `codex`, `opencode`, `cline`, `pi`, `prime`, `droid`, `copilot`, `hermes`, `dsh`, `fx` or `grok`. |++| `--harness` | Only this runtime: `claude`, `codex`, `opencode`, `cline`, `pi`, `prime`, `droid`, `copilot`, `hermes`, `dsh`, `fx`, `grok` or `openclaw`. || `--here` | Only sessions that ran in the current directory or below it. || `--dir` | Only sessions that ran in this directory or below it. || `--subagents` | Include subagent sessions. They are hidden by default, because resuming one resumes a fragment of its parent's task. |@@@ -142,7 -140,7 +143,8 @@@ There are two ways to resume| GitHub Copilot CLI | `copilot --resume=<id>` || Hermes Agent | `hermes --resume <id>` || fx | `fx --resume <id>`, in the session's workspace |+ | Grok Build | `grok --permission-mode default --resume <id>` |+ | OpenClaw Gateway | `openclaw tui --session <session key>` |- **Start a new session from a brief.** Otherwise, or with `--agent` naming another runtime or with `--new`, Beacon writes a brief (see `export`) and starts a new session. The first message of that session points at the brief:@@@ -156,7 -154,7 +158,8 @@@| Prime Agent | `prime-agent -- "<prompt>"` || Factory Droid | `droid "<prompt>"` || GitHub Copilot CLI | `copilot -i "<prompt>"` |+ | Grok Build | `grok --permission-mode default "<prompt>"` |+ | OpenClaw Gateway | `openclaw tui --session beacon-handoff-<hash> --message "<prompt>"` || Oh My Pi | `omp --approval-mode=always-ask "<prompt>"` || Gemini CLI | `gemini --approval-mode default --prompt-interactive "<prompt>"` || Qwen Code | `qwen --approval-mode default --prompt-interactive "<prompt>"` |@@@ -222,7 -222,7 +229,7 @@@ The link event keeps the new session'sTwo paths record the link:- **Live hooks and plugins.** Every runtime whose prompts Beacon captures as they are sent records it: the shared prompt hook (Claude Code, Cursor, Factory Droid, Qwen Code, Kiro, Kimi Code, Devin, Muse Code, OpenHands, Grok Build, DeepSeek Harness, Hermes Agent, VS Code), Antigravity (including the prompt it recovers from its transcript when the prompt hook does not fire), the Cline, OpenCode and OpenClaw plugins, and the Pi, Oh My Pi, Prime Agent and Senpi extensions (`harness.collection_method` `hook` or `plugin`).- - **Session-store sync.** `beacon endpoint claude sync`, `codex sync`, `opencode sync`, `cline sync`, `pi sync`, `prime sync`, `factory sync`, `copilot sync`, `hermes sync`, `dsh sync`, `fx sync` and `openclaw sessions sync` record it when they read the prompt back from the runtime's store (`harness.collection_method: poll`).-- **Session-store sync.** `beacon endpoint claude sync`, `codex sync`, `opencode sync`, `cline sync`, `pi sync`, `prime sync`, `factory sync`, `copilot sync`, `hermes sync`, `dsh sync`, `fx sync` and `grok sync` record it when they read the prompt back from the runtime's store (`harness.collection_method: poll`).++- **Session-store sync.** `beacon endpoint claude sync`, `codex sync`, `opencode sync`, `cline sync`, `pi sync`, `prime sync`, `factory sync`, `copilot sync`, `hermes sync`, `dsh sync`, `fx sync`, `grok sync` and `openclaw sessions sync` record it when they read the prompt back from the runtime's store (`harness.collection_method: poll`).Codex CLI prompts reach Beacon over OTLP and through `beacon endpoint codex sync`, not a prompt hook, so a session continued in Codex is linked by the sync. The same holds for GitHub Copilot CLI, whose live path is OTLP: `beacon endpoint copilot sync` records the link. For a runtime that also has a prompt hook or plugin, a sync can record the same link the hook already did; the two carry different `collection_method` values, as every other event those runtimes report through both paths does. A sync's link has a deterministic `event.id`, so syncing again never duplicates it.