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-k-grok
Claude69f0b30f0c0b
diff --cc cli/beacon/internal/handoff/resume_test.goindex 661df398,d6b66db6..b8c6ee34--- a/cli/beacon/internal/handoff/resume_test.go+++ b/cli/beacon/internal/handoff/resume_test.go@@@ -25,7 -25,7 +25,8 @@@ func installed(names ...string) func(st}var allRuntimes = installed("claude", "codex", "opencode", "cline", "pi", "prime-agent", "droid",- "omp", "gemini", "qwen", "kiro-cli", "agy", "devin", "muse", "openhands", "goose", "grok")- "omp", "gemini", "qwen", "kiro-cli", "agy", "devin", "muse", "openhands", "goose", "copilot")++ "omp", "gemini", "qwen", "kiro-cli", "agy", "devin", "muse", "openhands", "goose", "copilot",++ "grok")// resumableSession is a session whose directory and session file both exist.func resumableSession(t *testing.T, harness, id string) Session {@@@ -83,7 -83,7 +84,8 @@@ func TestPlanResumeStartsANewSessionInE{HarnessPi, "pi", []string{"--"}},{HarnessPrime, "prime-agent", []string{"--"}},{HarnessFactory, "droid", nil},+ {HarnessCopilot, "copilot", []string{"-i"}},+ {HarnessGrok, "grok", []string{"--permission-mode", "default"}},{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 df3446f9,c2118681..7e08fc98--- a/cli/beacon/internal/handoff/runtimes.go+++ b/cli/beacon/internal/handoff/runtimes.go@@@ -7,8 -7,8 +7,9 @@@ import"github.com/asymptote-labs/agent-beacon/cli/beacon/internal/claudesession""github.com/asymptote-labs/agent-beacon/cli/beacon/internal/clinesession""github.com/asymptote-labs/agent-beacon/cli/beacon/internal/codexsession"+ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/copilotsession""github.com/asymptote-labs/agent-beacon/cli/beacon/internal/factorysession"+ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/groksession""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"@@@ -59,7 -56,7 +60,8 @@@ constHarnessPi = pisession.HarnessHarnessPrime = primesession.HarnessHarnessFactory = factorysession.Harness+ HarnessCopilot = copilotsession.Harness+ HarnessGrok = groksession.Harness// Runtimes Beacon starts but whose sessions it reads only from the runtime log.HarnessOhMyPi = "omp"@@@ -182,29 -179,24 +184,47 @@@ var runtimes = []RuntimeNewSession: func(prompt string) []string { return []string{prompt} },},},+ {+ Harness: HarnessCopilot,+ Label: "GitHub Copilot CLI",+ Aliases: []string{"copilot", "copilot-cli"},+ NewSource: func(dir string) Source { return &copilotSource{dir: dir} },+ Command: &runtimeCommand{+ Executable: "copilot",+ // --resume takes an optional value, so the id is bound to it with = rather than left to+ // be read as the next argument.+ Resume: func(s Session) ([]string, bool) { return []string{"--resume=" + s.ID}, true },+ // -i starts the interactive TUI and sends the prompt as its first message.+ NewSession: func(prompt string) []string { return []string{"-i", prompt} },+ // Copilot asks before each tool call unless COPILOT_ALLOW_ALL=true, which also trusts the+ // directory, or COPILOT_PLAN_THEN_AUTOPILOT, which starts in plan mode and carries the plan+ // out without waiting. A session Beacon starts never inherits either.+ Env: map[string]string{"COPILOT_ALLOW_ALL": "", "COPILOT_PLAN_THEN_AUTOPILOT": ""},+ },+ },+ {+ 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,+ },+ },// 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 bb40ee18,38bbe6d2..a5b35769--- a/docs/cli/handoff.mdx+++ b/docs/cli/handoff.mdx@@@ -26,11 -26,11 +26,12 @@@ Sessions come from each runtime's own l| Pi | `~/.pi/agent/sessions` (or under `PI_CODING_AGENT_DIR`) | `pi` || Prime Agent | `~/.prime/agent`, both `sessions` and `session-artifacts` (or `PRIME_AGENT_CODING_AGENT_DIR`) | `prime` || Factory Droid | `~/.factory/sessions` | `droid` |+ | GitHub Copilot CLI | `~/.copilot/session-state` | `copilot` |+| Grok Build | `~/.grok/sessions` | `grok` |-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.+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. 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.- `--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 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.-`--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.++`--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 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.### Runtimes Beacon starts but does not read@@@ -63,7 -63,7 +64,7 @@@ beacon handoff list --jso| Flag | Description ||------|-------------|- | `--harness` | Only this runtime: `claude`, `codex`, `opencode`, `cline`, `pi`, `prime`, `droid` or `grok`. |-| `--harness` | Only this runtime: `claude`, `codex`, `opencode`, `cline`, `pi`, `prime`, `droid` or `copilot`. |++| `--harness` | Only this runtime: `claude`, `codex`, `opencode`, `cline`, `pi`, `prime`, `droid`, `copilot` or `grok`. || `--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. |@@@ -131,7 -131,7 +132,8 @@@ There are two ways to resume| Pi | `pi --session <session file>` || Prime Agent | `prime-agent --resume <session file>` || Factory Droid | `droid --resume <id>` |+ | GitHub Copilot CLI | `copilot --resume=<id>` |+ | Grok Build | `grok --permission-mode default --resume <id>` |- **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:@@@ -144,7 -144,7 +146,8 @@@| Pi | `pi -- "<prompt>"` || Prime Agent | `prime-agent -- "<prompt>"` || Factory Droid | `droid "<prompt>"` |+ | GitHub Copilot CLI | `copilot -i "<prompt>"` |+ | Grok Build | `grok --permission-mode default "<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>"` |@@@ -163,8 -163,8 +166,10 @@@ Cline approves every tool call by defauThe same holds for every runtime Beacon starts. Oh My Pi and goose approve every tool call by default, so Beacon passes `--approval-mode=always-ask` to Oh My Pi and sets `GOOSE_MODE=approve` for goose. Where a CLI takes an approval mode, Beacon names the mode that asks (Gemini CLI, Qwen Code, Muse Code, and Devin CLI, whose `DEVIN_PERMISSION_MODE` could otherwise hold `dangerous`), so a user or project setting that approves everything does not carry over. Beacon never passes a flag that turns approvals off.+ GitHub Copilot CLI asks before each tool call unless `COPILOT_ALLOW_ALL=true` is set, which also trusts the directory, or `COPILOT_PLAN_THEN_AUTOPILOT` starts it in plan mode and carries the plan out without waiting. Beacon removes both from the environment it launches Copilot with (`--print` shows them under `env`), and never passes `--allow-all-tools` or `--yolo`. Copilot sessions are not tied to a directory, but Beacon still starts Copilot in the session's recorded directory.++Grok Build's configured permission mode can be always-approve. Beacon always passes `--permission-mode default`, the mode that asks before running tools, so a session Beacon starts or reopens never inherits always-approve from that config. You can still change the mode inside the Grok TUI. Grok looks a session id up under the directory it runs in, which is why the resume runs in the session's recorded directory. With `--cwd` naming another directory, a Grok session continues from a brief instead.+The runtime runs in this terminal, in the session's recorded directory. If that directory no longer exists, Beacon stops rather than starting somewhere else; pass `--cwd` to choose a directory. Beacon prints the plan and asks `Continue? [Y/n]` before launching. Without a terminal, it launches only with `--yes`. `beacon handoff resume` exits with the runtime's own exit code.| Flag | Description |@@@ -200,8 -200,8 +205,8 @@@ 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` 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` and `copilot 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` and `grok 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. 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.+ 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.The marker is a claim made in prompt text, not a verified identity: anyone can type it. `fidelity: observed` records that the marker was seen, not that `beacon handoff resume` wrote it. A native resume keeps the session's own id, so it needs no link.