Skip to content

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

handoff: add GitHub Copilot CLI

Claude68a8f587eee5
diff --git a/cli/beacon/internal/copilotsession/handoff_test.go b/cli/beacon/internal/copilotsession/handoff_test.go
new file mode 100644
index 00000000..db11180f
--- /dev/null
+++ b/cli/beacon/internal/copilotsession/handoff_test.go
@@ -0,0 +1,53 @@
+package copilotsession
+
+import (
+ "testing"
+
+ "github.com/asymptote-labs/agent-beacon/pkg/asymptoteobserve"
+)
+
+func TestMapSessionRecordsAHandoffLink(t *testing.T) {
+ ref := SessionRef{ID: "new-1", Path: "/tmp/session-state/new-1/events.jsonl", Meta: &WorkspaceMeta{ID: "new-1", CWD: "/work"}}
+ prompt := "Continue the work.\n\n" + asymptoteobserve.HandoffMarker("claude_code", "src-1")
+ records := []Record{
+ {Line: 1, Type: "session.start", Data: map[string]interface{}{"sessionId": "new-1", "context": map[string]interface{}{"cwd": "/work"}}},
+ {Line: 2, Type: "user.message", Data: map[string]interface{}{"content": prompt, "transformedContent": "<context>\n" + prompt}},
+ {Line: 3, Type: "user.message", Data: map[string]interface{}{"content": "no marker here"}},
+ }
+ mapped := MapSession(ref, records, MapOptions{})
+ var links []MappedEvent
+ for _, m := range mapped {
+ if m.Event.Event.Action == "session.handoff" {
+ links = append(links, m)
+ }
+ }
+ if len(links) != 1 {
+ t.Fatalf("links = %d, want 1: %+v", len(links), mapped)
+ }
+ link := links[0]
+ if link.SourceLine != 2 || link.Event.Handoff == nil || link.Event.Handoff.SourceHarness != "claude_code" || link.Event.Handoff.SourceSessionID != "src-1" {
+ t.Fatalf("link = %+v handoff=%+v", link, link.Event.Handoff)
+ }
+ if link.Event.Session == nil || link.Event.Session.ID != "new-1" || link.Event.Session.WorkingDirectory != "/work" {
+ t.Fatalf("link session = %+v", link.Event.Session)
+ }
+ if link.Event.Harness.Name != Harness || link.Event.Harness.CollectionMethod != "poll" || link.Event.Event.Fidelity != "observed" {
+ t.Fatalf("link provenance = %+v %+v", link.Event.Harness, link.Event.Event)
+ }
+ if link.Event.Prompt != nil || link.Event.Content != nil || link.Event.GenAI != nil || link.Event.Raw != nil {
+ t.Fatalf("the link must not repeat the prompt: %+v", link.Event)
+ }
+ ids := map[string]bool{}
+ for _, m := range mapped {
+ if ids[m.Event.Event.ID] {
+ t.Fatalf("duplicate event id %s", m.Event.Event.ID)
+ }
+ ids[m.Event.Event.ID] = true
+ }
+ again := MapSession(ref, records, MapOptions{})
+ for i := range mapped {
+ if again[i].Event.Event.ID != mapped[i].Event.Event.ID {
+ t.Fatal("event ids must be deterministic, so a second sync never duplicates the link")
+ }
+ }
+}
diff --git a/cli/beacon/internal/copilotsession/mapper.go b/cli/beacon/internal/copilotsession/mapper.go
index e836479f..6e8e536d 100644
--- a/cli/beacon/internal/copilotsession/mapper.go
+++ b/cli/beacon/internal/copilotsession/mapper.go
@@ -236,6 +236,11 @@ func (m *mapper) emitPrompt(record Record) {
})
ev.Raw = m.raw(record, nil)
m.append(record, "prompt.submitted", ev)
+ if info, ok := asymptoteobserve.ParseHandoffMarker(text); ok {
+ link := m.base(record, "session.handoff", "session", schema.SeverityInfo, "Session continued from a "+info.SourceHarness+" session")
+ link.Handoff = &info
+ m.append(record, "prompt.submitted.handoff", link)
+ }
}
func (m *mapper) emitAssistant(record Record) {
diff --git a/cli/beacon/internal/handoff/copilot.go b/cli/beacon/internal/handoff/copilot.go
new file mode 100644
index 00000000..38506664
--- /dev/null
+++ b/cli/beacon/internal/handoff/copilot.go
@@ -0,0 +1,123 @@
+package handoff
+
+import (
+ "encoding/json"
+ "strings"
+
+ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/copilotsession"
+ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/schema"
+)
+
+// GitHub Copilot CLI keeps each session in its own directory under session-state: an events.jsonl
+// log, and a workspace.yaml naming the session, where it ran and its git branch.
+
+type copilotSource struct{ dir string }
+
+func (s *copilotSource) Harness() string { return HarnessCopilot }
+
+// store reads dir as Copilot's own directory, as `beacon endpoint copilot sync --copilot-dir` does.
+func (s *copilotSource) store() (*copilotsession.Store, error) { return copilotsession.NewStore(s.dir) }
+
+func (s *copilotSource) List() ([]Session, error) {
+ store, err := s.store()
+ if err != nil {
+ return nil, err
+ }
+ if !store.Exists() {
+ return nil, nil
+ }
+ refs, err := store.List()
+ if err != nil {
+ return nil, err
+ }
+ sessions := make([]Session, 0, len(refs))
+ for _, ref := range refs {
+ var meta copilotsession.WorkspaceMeta
+ if ref.Meta != nil {
+ meta = *ref.Meta
+ }
+ title := meta.Name
+ directory := firstNonEmpty(meta.CWD, meta.GitRoot)
+ branch := meta.Branch
+ if strings.TrimSpace(title) == "" || strings.TrimSpace(directory) == "" || strings.TrimSpace(branch) == "" {
+ // workspace.yaml is written alongside the log and can be missing or not yet named; the
+ // log's head records the first prompt and the session's starting context.
+ head := readCopilotHead(ref.Path)
+ title = firstNonEmpty(title, head.FirstPrompt)
+ directory = firstNonEmpty(directory, head.CWD)
+ branch = firstNonEmpty(branch, head.Branch)
+ }
+ sessions = append(sessions, Session{
+ Harness: HarnessCopilot,
+ ID: ref.ID,
+ Title: oneLine(title),
+ Directory: strings.TrimSpace(directory),
+ Branch: strings.TrimSpace(branch),
+ SourcePath: ref.Path,
+ UpdatedAt: unixMS(ref.ModTimeUnixMS),
+ })
+ }
+ return sessions, nil
+}
+
+func (s *copilotSource) Events(session Session) ([]schema.Event, error) {
+ store, err := s.store()
+ if err != nil {
+ return nil, err
+ }
+ refs, err := store.List()
+ if err != nil {
+ return nil, err
+ }
+ for _, ref := range refs {
+ if ref.ID != session.ID || ref.Path != session.SourcePath {
+ continue
+ }
+ records, _, err := store.Read(ref)
+ if err != nil {
+ return nil, err
+ }
+ mapped := copilotsession.MapSession(ref, records, copilotsession.MapOptions{})
+ events := make([]schema.Event, 0, len(mapped))
+ for _, m := range mapped {
+ events = append(events, m.Event)
+ }
+ return events, nil
+ }
+ return nil, errSessionGone(session)
+}
+
+type copilotHead struct {
+ CWD string
+ Branch string
+ FirstPrompt string
+}
+
+// readCopilotHead reads the session's starting context and first prompt from the start of its log.
+func readCopilotHead(path string) copilotHead {
+ var head copilotHead
+ scanHead(path, func(line []byte) bool {
+ var record struct {
+ Type string `json:"type"`
+ Data struct {
+ Content string `json:"content"`
+ Context struct {
+ CWD string `json:"cwd"`
+ Branch string `json:"branch"`
+ } `json:"context"`
+ } `json:"data"`
+ }
+ if json.Unmarshal(line, &record) != nil {
+ return false
+ }
+ switch record.Type {
+ case "session.start":
+ head.CWD = firstNonEmpty(head.CWD, record.Data.Context.CWD)
+ head.Branch = firstNonEmpty(head.Branch, record.Data.Context.Branch)
+ case "user.message":
+ head.FirstPrompt = firstNonEmpty(head.FirstPrompt, record.Data.Content)
+ }
+ return head.FirstPrompt != ""
+ })
+ return head
+}
diff --git a/cli/beacon/internal/handoff/copilot_test.go b/cli/beacon/internal/handoff/copilot_test.go
new file mode 100644
index 00000000..b79133c5
--- /dev/null
+++ b/cli/beacon/internal/handoff/copilot_test.go
@@ -0,0 +1,145 @@
+package handoff
+
+import (
+ "errors"
+ "os"
+ "path/filepath"
+ "reflect"
+ "strings"
+ "testing"
+ "time"
+
+ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/testenv"
+)
+
+var (
+ copilotNamedUpdated = time.Date(2026, 9, 24, 11, 0, 0, 0, time.UTC)
+ copilotUnnamedUpdated = time.Date(2026, 9, 24, 12, 0, 0, 0, time.UTC)
+)
+
+// copilotFixture lays down a Copilot directory in the layout the CLI writes: one directory per
+// session under session-state, holding workspace.yaml and events.jsonl. The second session has no
+// workspace.yaml yet, so its listing comes from the log's head.
+func copilotFixture(t *testing.T) (StoreDirs, string, string) {
+ t.Helper()
+ testenv.SetHome(t, t.TempDir())
+ isolateRuntimeEnv(t)
+ dirs := StoreDirs{HarnessCopilot: filepath.Join(t.TempDir(), ".copilot")}
+
+ named := filepath.Join(dirs[HarnessCopilot], "session-state", "0cb916db-26aa-40f2-86b5-1ba81b225fd2")
+ writeFixture(t, filepath.Join(named, "workspace.yaml"), strings.Join([]string{
+ "id: 0cb916db-26aa-40f2-86b5-1ba81b225fd2",
+ "cwd: /work/api",
+ "git_root: /work/api",
+ "repository: acme/api",
+ "branch: feat/copilot",
+ "name: Fix the\n flaky test",
+ "summary_count: 0",
+ "",
+ }, "\n"))
+ namedPath := filepath.Join(named, "events.jsonl")
+ writeFixture(t, namedPath,
+ jsonLine(t, map[string]interface{}{"id": "s1", "type": "session.start", "data": map[string]interface{}{
+ "sessionId": "0cb916db-26aa-40f2-86b5-1ba81b225fd2", "context": map[string]interface{}{"cwd": "/work/api", "branch": "feat/copilot"},
+ }})+
+ jsonLine(t, map[string]interface{}{"id": "u1", "type": "user.message", "data": map[string]interface{}{"content": "the payments test is flaky"}})+
+ jsonLine(t, map[string]interface{}{"id": "a1", "type": "assistant.message", "data": map[string]interface{}{"content": "Looking."}}))
+ setModTime(t, namedPath, copilotNamedUpdated)
+
+ unnamedPath := filepath.Join(dirs[HarnessCopilot], "session-state", "7f3e2a10-0000-4000-8000-000000000001", "events.jsonl")
+ writeFixture(t, unnamedPath,
+ jsonLine(t, map[string]interface{}{"id": "s1", "type": "session.start", "data": map[string]interface{}{
+ "sessionId": "7f3e2a10-0000-4000-8000-000000000001", "context": map[string]interface{}{"cwd": "/work/web", "branch": "main"},
+ }})+
+ jsonLine(t, map[string]interface{}{"id": "u1", "type": "user.message", "data": map[string]interface{}{"content": " add a\ndark mode "}}))
+ setModTime(t, unnamedPath, copilotUnnamedUpdated)
+ return dirs, namedPath, unnamedPath
+}
+
+func TestListReadsCopilotSessions(t *testing.T) {
+ dirs, namedPath, unnamedPath := copilotFixture(t)
+ sessions, err := List(DefaultSources(dirs), Filter{Harness: HarnessCopilot})
+ if err != nil {
+ t.Fatalf("List: %v", err)
+ }
+ want := []Session{
+ {Harness: HarnessCopilot, ID: "7f3e2a10-0000-4000-8000-000000000001", Title: "add a dark mode", Directory: "/work/web", Branch: "main", SourcePath: unnamedPath, UpdatedAt: copilotUnnamedUpdated},
+ {Harness: HarnessCopilot, ID: "0cb916db-26aa-40f2-86b5-1ba81b225fd2", Title: "Fix the flaky test", Directory: "/work/api", Branch: "feat/copilot", SourcePath: namedPath, UpdatedAt: copilotNamedUpdated},
+ }
+ if !reflect.DeepEqual(sessions, want) {
+ t.Fatalf("sessions = %+v\nwant %+v", sessions, want)
+ }
+}
+
+func TestListWithoutACopilotStore(t *testing.T) {
+ testenv.SetHome(t, t.TempDir())
+ sessions, err := (&copilotSource{dir: filepath.Join(t.TempDir(), "missing")}).List()
+ if err != nil || sessions != nil {
+ t.Fatalf("List = %v, %v; want nothing and no error", sessions, err)
+ }
+}
+
+func TestCopilotSessionBuildsABrief(t *testing.T) {
+ dirs, _, _ := copilotFixture(t)
+ sources := DefaultSources(dirs)
+ // A unique prefix finds the session too.
+ session, err := Find(sources, HarnessCopilot, "0cb916db")
+ if err != nil {
+ t.Fatalf("Find: %v", err)
+ }
+ events, err := Events(sources, session)
+ if err != nil {
+ t.Fatalf("Events: %v", err)
+ }
+ brief := BuildBrief(session, events, FromSessionStore, time.Now())
+ if brief.Prompts != 1 || !strings.Contains(brief.FirstRequest, "payments test is flaky") {
+ t.Fatalf("brief prompts=%d first=%q", brief.Prompts, brief.FirstRequest)
+ }
+ if !strings.Contains(brief.Render(), "GitHub Copilot CLI") {
+ t.Fatalf("the brief should name GitHub Copilot CLI:\n%s", brief.Render())
+ }
+}
+
+func TestCopilotSessionGoneFromItsStore(t *testing.T) {
+ dirs, namedPath, _ := copilotFixture(t)
+ session, err := Find(DefaultSources(dirs), HarnessCopilot, "0cb916db-26aa-40f2-86b5-1ba81b225fd2")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if err := os.RemoveAll(filepath.Dir(namedPath)); err != nil {
+ t.Fatal(err)
+ }
+ if _, err := Events(DefaultSources(dirs), session); !errors.Is(err, ErrNotFound) {
+ t.Fatalf("Events = %v, want ErrNotFound", err)
+ }
+}
+
+func TestPlanResumeReopensACopilotSession(t *testing.T) {
+ session := resumableSession(t, HarnessCopilot, "0cb916db-26aa")
+ plan, err := PlanResume(session, PlanOptions{LookPath: installed("copilot")})
+ if err != nil {
+ t.Fatalf("PlanResume: %v", err)
+ }
+ if plan.Mode != ModeNative || plan.Executable != "/bin/copilot" || !reflect.DeepEqual(plan.Args, []string{"--resume=0cb916db-26aa"}) {
+ t.Fatalf("plan = %+v", plan)
+ }
+ // Copilot's approvals stay on whatever the calling shell exports.
+ wantEnv := map[string]string{"COPILOT_ALLOW_ALL": "", "COPILOT_PLAN_THEN_AUTOPILOT": ""}
+ if !reflect.DeepEqual(plan.Env, wantEnv) {
+ t.Fatalf("env = %v, want %v", plan.Env, wantEnv)
+ }
+
+ gone := session
+ gone.SourcePath = filepath.Join(t.TempDir(), "missing", "events.jsonl")
+ brief := filepath.Join(t.TempDir(), "brief.md")
+ plan, err = PlanResume(gone, PlanOptions{BriefPath: brief, LookPath: installed("copilot")})
+ if err != nil {
+ t.Fatalf("PlanResume: %v", err)
+ }
+ if plan.Mode != ModeNewSession || plan.Reason != ReasonSessionGone || !reflect.DeepEqual(plan.Args, []string{"-i", NewSessionPrompt(gone, brief)}) {
+ t.Fatalf("plan = %+v", plan)
+ }
+ if !reflect.DeepEqual(plan.Env, wantEnv) {
+ t.Fatalf("new-session env = %v, want %v", plan.Env, wantEnv)
+ }
+}
diff --git a/cli/beacon/internal/handoff/resume_test.go b/cli/beacon/internal/handoff/resume_test.go
index 54ed8c2d..4eafbaa0 100644
--- a/cli/beacon/internal/handoff/resume_test.go
+++ b/cli/beacon/internal/handoff/resume_test.go
@@ -24,7 +24,7 @@ func installed(names ...string) func(string) (string, error) {
}
}
-var allRuntimes = installed("claude", "codex", "opencode", "cline", "pi", "prime-agent")
+var allRuntimes = installed("claude", "codex", "opencode", "cline", "pi", "prime-agent", "copilot")
// resumableSession is a session whose directory and session file both exist.
func resumableSession(t *testing.T, harness, id string) Session {
@@ -80,6 +80,7 @@ func TestPlanResumeStartsANewSessionInEachRuntime(t *testing.T) {
{HarnessCline, "cline", []string{"--tui", "--auto-approve", "false"}},
{HarnessPi, "pi", []string{"--"}},
{HarnessPrime, "prime-agent", []string{"--"}},
+ {HarnessCopilot, "copilot", []string{"-i"}},
} {
t.Run(tc.target, func(t *testing.T) {
source := HarnessCodex
diff --git a/cli/beacon/internal/handoff/runtimes.go b/cli/beacon/internal/handoff/runtimes.go
index 76162102..c02c042b 100644
--- a/cli/beacon/internal/handoff/runtimes.go
+++ b/cli/beacon/internal/handoff/runtimes.go
@@ -7,6 +7,7 @@ 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/opencodesession"
"github.com/asymptote-labs/agent-beacon/cli/beacon/internal/pisession"
"github.com/asymptote-labs/agent-beacon/cli/beacon/internal/primesession"
@@ -53,6 +54,7 @@ const (
HarnessCline = clinesession.Harness
HarnessPi = pisession.Harness
HarnessPrime = primesession.Harness
+ HarnessCopilot = copilotsession.Harness
)
// runtimes lists every runtime handoff supports, in display order.
@@ -149,6 +151,24 @@ var runtimes = []Runtime{
NewSession: 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": ""},
+ },
+ },
}
// Harnesses lists the runtimes handoff supports, in display order.
diff --git a/docs/cli/handoff.mdx b/docs/cli/handoff.mdx
index 4b458e2b..701747f9 100644
--- a/docs/cli/handoff.mdx
+++ b/docs/cli/handoff.mdx
@@ -25,10 +25,11 @@ Sessions come from each runtime's own local session store, not from Beacon's run
| Cline | `~/.cline/data` | `cline` |
| 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` |
+| GitHub Copilot CLI | `~/.copilot/session-state` | `copilot` |
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.
-`--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.
+`--store-dir <runtime>=<path>` takes the location in the table: for Pi its sessions directory, as `beacon endpoint pi sync --sessions-dir` does, for Prime Agent the agent directory holding both of its roots, and for GitHub Copilot CLI the `~/.copilot` directory that holds `session-state`, as `beacon endpoint copilot sync --copilot-dir` does.
## `beacon handoff list`
@@ -110,6 +111,7 @@ There are two ways to resume:
| Cline | `cline --tui --auto-approve false --id <id>` |
| Pi | `pi --session <session file>` |
| Prime Agent | `prime-agent --resume <session file>` |
+ | GitHub Copilot CLI | `copilot --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:
@@ -121,6 +123,7 @@ There are two ways to resume:
| Cline | `cline --tui --auto-approve false "<prompt>"` |
| Pi | `pi -- "<prompt>"` |
| Prime Agent | `prime-agent -- "<prompt>"` |
+ | GitHub Copilot CLI | `copilot -i "<prompt>"` |
The prompt names the brief by its path and asks the agent to read it, then confirm the task before changing anything. The brief is never inlined into the command line, because a command line is visible to every local user through the process table. The prompt ends with a handoff marker (see below).
@@ -128,11 +131,13 @@ Claude Code, Cline and Prime Agent subagent sessions, and Cline's older task his
Cline approves every tool call by default. Beacon always passes `--auto-approve false`, so a session Beacon starts never gets auto-approval on Beacon's say-so. You can still turn it on inside the Cline TUI.
+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.
+
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 |
|------|-------------|
-| `--agent` | Runtime to continue in: `claude`, `codex`, `opencode`, `cline`, `pi` or `prime`. Defaults to the session's own runtime. |
+| `--agent` | Runtime to continue in: `claude`, `codex`, `opencode`, `cline`, `pi`, `prime` or `copilot`. Defaults to the session's own runtime. |
| `--new` | Start a new session from a brief even when the session could be reopened. |
| `--cwd` | Directory to start the runtime in. |
| `--print` | Show the plan and command without writing a brief or launching anything. |
@@ -163,8 +168,8 @@ The link event keeps the new session's id, workspace and harness, and leaves the
Two paths record the link:
- **Live hooks.** The prompt hook for Claude Code and the Cline and OpenCode plugins record it as the prompt is sent (`harness.collection_method: hook`).
-- **Session-store sync.** `beacon endpoint claude sync`, `codex sync`, `opencode sync`, `cline sync`, `pi sync` and `prime 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` and `copilot 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.