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
handoff: add fx
Claudede53e217558a
diff --git a/cli/beacon/internal/fxsession/handoff_test.go b/cli/beacon/internal/fxsession/handoff_test.gonew file mode 100644index 00000000..a8742f95--- /dev/null+++ b/cli/beacon/internal/fxsession/handoff_test.go@@ -0,0 +1,68 @@+package fxsession++import (+ "encoding/json"+ "testing"++ "github.com/asymptote-labs/agent-beacon/pkg/asymptoteobserve"+)++func promptTurnLine(t *testing.T, seq int, prompt string) string {+ t.Helper()+ text, err := json.Marshal(prompt)+ if err != nil {+ t.Fatal(err)+ }+ payload := `{"conversation_language":"en","total_input_tokens":0,"total_output_tokens":0,"work_id":"w",` ++ `"turn":{"kind":"assistant","user":{"text":` + string(text) + `,"images":[]},"assistant":"On it.","execution":null}}`+ return frame(seq, 1770000000000+int64(seq)*1000, KindHistoryTurnCommitted, payload)+}++func TestMapSessionRecordsAHandoffLink(t *testing.T) {+ ref := SessionRef{ID: testSessionID, Manifest: &Manifest{ID: testSessionID, WorkspaceRoot: "/work"}}+ prompt := "Continue the work.\n\n" + asymptoteobserve.HandoffMarker("claude_code", "src-1")+ var events []Event+ for i, line := range []string{promptTurnLine(t, 1, prompt), promptTurnLine(t, 2, "no marker here")} {+ event, err := DecodeEnvelope([]byte(line))+ if err != nil {+ t.Fatalf("line %d: %v", i, err)+ }+ events = append(events, *event)+ }+ mapped := MapSession(ref, events, 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.SourceSeq != 1 || 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 != testSessionID || 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.GenAI.Input != 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, events, 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/fxsession/mapper.go b/cli/beacon/internal/fxsession/mapper.goindex ffe11656..80a8c471 100644--- a/cli/beacon/internal/fxsession/mapper.go+++ b/cli/beacon/internal/fxsession/mapper.go@@ -330,6 +330,12 @@ func (m *mapper) emitPrompt(event *Event, text string, images []UserImage) {ev.Raw = mergeRaw(ev.Raw, map[string]interface{}{"images": paths})}m.append(event, fmt.Sprintf("turn.%d.prompt", m.turnIndex), ev)+ if info, ok := asymptoteobserve.ParseHandoffMarker(text); ok {+ link := m.base(event, "session.handoff", "session", schema.SeverityInfo, schema.FidelityObserved, "Session continued from a "+info.SourceHarness+" session")+ link.Timestamp = ev.Timestamp+ link.Handoff = &info+ m.append(event, fmt.Sprintf("turn.%d.handoff", m.turnIndex), link)+ }}func (m *mapper) emitAssistantMessage(event *Event, text string) {diff --git a/cli/beacon/internal/handoff/fx.go b/cli/beacon/internal/handoff/fx.gonew file mode 100644index 00000000..ec909439--- /dev/null+++ b/cli/beacon/internal/handoff/fx.go@@ -0,0 +1,106 @@+package handoff++import (+ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/schema"+ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/fxsession"+)++// fx keeps one directory per session: an append-only events.jsonl and a session.json manifest that+// names the workspace the session is bound to now. fx records no title and no git branch.++type fxSource struct{ dir string }++func (s *fxSource) Harness() string { return HarnessFx }++// store reads dir as fx's sessions directory, as `beacon endpoint fx sync --sessions-dir` does.+func (s *fxSource) store() (*fxsession.Store, error) { return fxsession.NewStore(s.dir) }++func (s *fxSource) 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 {+ head := readFxHead(ref.EventsLog)+ session := Session{+ Harness: HarnessFx,+ ID: ref.ID,+ Title: oneLine(head.FirstPrompt),+ Directory: head.Workspace,+ SourcePath: ref.EventsLog,+ UpdatedAt: unixMS(ref.ModTimeUnixMS),+ }+ // The manifest is fx's own projection of the session. Its workspace follows a session that+ // was rebound to another directory, which the log's first event does not.+ if m := ref.Manifest; m != nil {+ if dir := firstNonEmpty(m.WorkspaceRoot, m.OriginWorkspaceRoot); dir != "" {+ session.Directory = dir+ }+ if m.UpdatedAtMS > 0 {+ session.UpdatedAt = unixMS(m.UpdatedAtMS)+ }+ }+ sessions = append(sessions, session)+ }+ return sessions, nil+}++func (s *fxSource) 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.EventsLog != session.SourcePath {+ continue+ }+ entries, _, err := store.Read(ref)+ if err != nil {+ return nil, err+ }+ mapped := fxsession.MapSession(ref, entries, fxsession.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 fxHead struct {+ Workspace string+ FirstPrompt string+}++// readFxHead reads where an fx session started and its first prompt from the start of its events+// log. fx commits a whole turn, prompt included, as one line, so the first prompt is near the top.+func readFxHead(path string) fxHead {+ var head fxHead+ scanHead(path, func(line []byte) bool {+ event, err := fxsession.DecodeEnvelope(line)+ if err != nil {+ return false+ }+ if started := event.SessionStarted; started != nil && head.Workspace == "" {+ head.Workspace = firstNonEmpty(started.WorkspaceRoot.String(), started.OriginWorkspaceRoot.String())+ }+ if turn := event.TurnCommitted; turn != nil && turn.Turn.User != nil {+ head.FirstPrompt = turn.Turn.User.Text.String()+ }+ return head.FirstPrompt != ""+ })+ return head+}diff --git a/cli/beacon/internal/handoff/fx_test.go b/cli/beacon/internal/handoff/fx_test.gonew file mode 100644index 00000000..1cb4f4bf--- /dev/null+++ b/cli/beacon/internal/handoff/fx_test.go@@ -0,0 +1,177 @@+package handoff++import (+ "errors"+ "fmt"+ "path/filepath"+ "reflect"+ "strings"+ "testing"+ "time"++ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/testenv"+)++var fxUpdated = time.Date(2026, 9, 24, 11, 0, 0, 0, time.UTC)++const (+ fxSessionA = "1770000000000-1770000000000000000-a1b2c3d4e5f60718"+ fxSessionB = "1770000500000-1770000500000000000-0f1e2d3c4b5a6978"+)++// fxFrame is one events.jsonl line in fx's envelope, fields in fx's own order.+func fxFrame(seq int, kind, payload string) string {+ return fmt.Sprintf(`{"schema_version":1,"log_generation":"1f4b2c8e6d3a5a7c9b613f0d5e8c2a14","seq":%d,"event_id":"%032x","timestamp_ms":%d,"kind":%q,"payload":%s}`+"\n",+ seq, seq, 1770000000000+int64(seq)*1000, kind, payload)+}++func fxStartedFrame(id, workspace string) string {+ return fxFrame(1, "session_started", fmt.Sprintf(`{"id":%q,"created_at_ms":1770000000000,"origin_workspace_root":%q,"workspace_root":%q,"conversation_language":"en","preferences":null,"usage":null}`, id, workspace, workspace))+}++func fxTurnFrame(seq int, prompt, reply string) string {+ return fxFrame(seq, "history_turn_committed", fmt.Sprintf(`{"conversation_language":"en","total_input_tokens":0,"total_output_tokens":0,"work_id":"w",`++ `"turn":{"kind":"assistant","user":{"text":%q,"images":[]},"assistant":%q,"execution":null}}`, prompt, reply))+}++// fxFixture lays down an fx sessions directory: one session whose manifest records that it was+// rebound to another workspace, and one fx has only just created, with no manifest yet.+func fxFixture(t *testing.T) (StoreDirs, string, string) {+ t.Helper()+ testenv.SetHome(t, t.TempDir())+ isolateRuntimeEnv(t)+ sessions := filepath.Join(t.TempDir(), "fx-sessions")+ dirs := StoreDirs{HarnessFx: sessions}++ logA := filepath.Join(sessions, fxSessionA, "events.jsonl")+ writeFixture(t, logA, fxStartedFrame(fxSessionA, "/work/old")++ fxTurnFrame(2, " add a\nhealth endpoint ", "Added GET /healthz.")++ fxTurnFrame(3, "now run the tests", "They pass."))+ writeFixture(t, filepath.Join(sessions, fxSessionA, "session.json"), fmt.Sprintf(+ `{"schema_version":3,"storage_format":"event_log_v1","id":%q,"log_generation":"1f4b2c8e6d3a5a7c9b613f0d5e8c2a14",`++ `"created_at_ms":1770000000000,"updated_at_ms":%d,"origin_workspace_root":"/work/old","workspace_root":"/work/api",`++ `"conversation_language":"en","history_len":2,"total_input_tokens":0,"total_output_tokens":0,"last_event_seq":3,"event_log_bytes":0,"preferences":null}`,+ fxSessionA, fxUpdated.UnixMilli()))++ logB := filepath.Join(sessions, fxSessionB, "events.jsonl")+ writeFixture(t, logB, fxStartedFrame(fxSessionB, "/work/web")+fxTurnFrame(2, "fix the login form", "Fixed."))+ setModTime(t, logB, fxUpdated.Add(-time.Hour))+ return dirs, logA, logB+}++func TestListReadsFxSessions(t *testing.T) {+ dirs, logA, logB := fxFixture(t)+ sessions, err := List(DefaultSources(dirs), Filter{Harness: HarnessFx})+ if err != nil {+ t.Fatalf("List: %v", err)+ }+ want := []Session{+ // The manifest's workspace wins over where the session started.+ {Harness: HarnessFx, ID: fxSessionA, Title: "add a health endpoint", Directory: "/work/api", SourcePath: logA, UpdatedAt: fxUpdated},+ // Without a manifest, the session_started event names the workspace and the log's mtime the update.+ {Harness: HarnessFx, ID: fxSessionB, Title: "fix the login form", Directory: "/work/web", SourcePath: logB, UpdatedAt: fxUpdated.Add(-time.Hour)},+ }+ if !reflect.DeepEqual(sessions, want) {+ t.Fatalf("sessions = %+v\nwant %+v", sessions, want)+ }+}++func TestFxStoreMissingListsNothing(t *testing.T) {+ testenv.SetHome(t, t.TempDir())+ sessions, err := (&fxSource{dir: filepath.Join(t.TempDir(), "absent")}).List()+ if err != nil || sessions != nil {+ t.Fatalf("List = %v, %v; want nil, nil", sessions, err)+ }+ // The default store is under HOME, which here has none.+ sessions, err = (&fxSource{}).List()+ if err != nil || sessions != nil {+ t.Fatalf("default List = %v, %v; want nil, nil", sessions, err)+ }+}++func TestFxSessionBuildsABrief(t *testing.T) {+ dirs, _, _ := fxFixture(t)+ sources := DefaultSources(dirs)+ // A unique prefix finds the session too.+ session, err := Find(sources, HarnessFx, fxSessionA[:20])+ if err != nil {+ t.Fatalf("Find: %v", err)+ }+ if session.ID != fxSessionA {+ t.Fatalf("Find = %s, want %s", session.ID, fxSessionA)+ }+ events, err := Events(sources, session)+ if err != nil {+ t.Fatalf("Events: %v", err)+ }+ brief := BuildBrief(session, events, FromSessionStore, time.Now())+ if brief.Prompts != 2 || !strings.Contains(brief.FirstRequest, "health endpoint") {+ t.Fatalf("brief prompts=%d first=%q", brief.Prompts, brief.FirstRequest)+ }+ rendered := brief.Render()+ if !strings.Contains(rendered, "They pass.") || !strings.Contains(rendered, RuntimeLabel(HarnessFx)) {+ t.Fatalf("brief is missing the last reply or the runtime:\n%s", rendered)+ }+}++func TestFxSessionGoneFromItsStore(t *testing.T) {+ dirs, logA, _ := fxFixture(t)+ for _, session := range []Session{+ {Harness: HarnessFx, ID: fxSessionA, SourcePath: logA + ".moved"},+ {Harness: HarnessFx, ID: "1770000900000-gone", SourcePath: logA},+ } {+ if _, err := Events(DefaultSources(dirs), session); !errors.Is(err, ErrNotFound) {+ t.Fatalf("Events(%s) = %v, want ErrNotFound", session.ID, err)+ }+ }+}++func TestPlanResumeReopensAnFxSessionInItsWorkspace(t *testing.T) {+ session := resumableSession(t, HarnessFx, fxSessionA)+ plan, err := PlanResume(session, PlanOptions{LookPath: installed("fx")})+ if err != nil {+ t.Fatalf("PlanResume: %v", err)+ }+ // fx scopes sessions to a workspace, so it must start in the session's.+ if plan.Mode != ModeNative || plan.Executable != "/bin/fx" || !reflect.DeepEqual(plan.Args, []string{"--resume", fxSessionA}) || plan.Dir != session.Directory {+ t.Fatalf("plan = %+v", plan)+ }+}++func TestPlanResumeRefusesToStartANewFxSession(t *testing.T) {+ brief := filepath.Join(t.TempDir(), "brief.md")+ fxSession := resumableSession(t, HarnessFx, fxSessionA)+ gone := fxSession+ gone.SourcePath = filepath.Join(t.TempDir(), "missing", "events.jsonl")+ for _, tc := range []struct {+ name string+ session Session+ opts PlanOptions+ reason string+ }{+ {"another runtime's session", resumableSession(t, HarnessClaude, "claude-1"), PlanOptions{Target: HarnessFx}, ReasonOtherRuntime},+ {"a new session requested", fxSession, PlanOptions{ForceNew: true}, ReasonRequested},+ {"the session file is gone", gone, PlanOptions{}, ReasonSessionGone},+ {"known only from the runtime log", fxSession, PlanOptions{FromRuntimeLog: true}, ReasonFromRuntimeLog},+ } {+ t.Run(tc.name, func(t *testing.T) {+ tc.opts.BriefPath, tc.opts.LookPath = brief, allRuntimes+ plan, err := PlanResume(tc.session, tc.opts)+ if err == nil {+ t.Fatalf("PlanResume = %+v, want an error: fx cannot start a session from a brief", plan)+ }+ if !strings.Contains(err.Error(), "fx cannot start a new session from a brief") || !strings.Contains(err.Error(), ReasonText(tc.reason)) {+ t.Fatalf("error = %v", err)+ }+ })+ }++ // fx's own sessions still continue in a runtime that can start one.+ plan, err := PlanResume(fxSession, PlanOptions{Target: HarnessClaude, BriefPath: brief, LookPath: allRuntimes})+ if err != nil {+ t.Fatalf("PlanResume: %v", err)+ }+ if plan.Mode != ModeNewSession || plan.Executable != "/bin/claude" || !reflect.DeepEqual(plan.Args, []string{NewSessionPrompt(fxSession, brief)}) {+ t.Fatalf("plan = %+v", plan)+ }+}diff --git a/cli/beacon/internal/handoff/resume_test.go b/cli/beacon/internal/handoff/resume_test.goindex 54ed8c2d..a4fdc5ee 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", "fx")// resumableSession is a session whose directory and session file both exist.func resumableSession(t *testing.T, harness, id string) Session {diff --git a/cli/beacon/internal/handoff/runtimes.go b/cli/beacon/internal/handoff/runtimes.goindex 76162102..abbfd4ec 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/fxsession""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.HarnessHarnessPi = pisession.HarnessHarnessPrime = primesession.Harness+ HarnessFx = fxsession.Harness)// runtimes lists every runtime handoff supports, in display order.@@ -149,6 +151,20 @@ var runtimes = []Runtime{NewSession: func(prompt string) []string { return []string{"--", prompt} },},},+ {+ Harness: HarnessFx,+ Label: "fx",+ Aliases: []string{"fx"},+ NewSource: func(dir string) Source { return &fxSource{dir: dir} },+ Command: &runtimeCommand{+ Executable: "fx",+ // fx looks a session id up within the workspace it runs in; the plan starts it in the+ // session's workspace root.+ Resume: func(s Session) ([]string, bool) { return []string{"--resume", s.ID}, true },+ // No NewSession: fx has no interactive session that starts from a prompt (`fx ask` is+ // one-shot), so it reopens its own sessions but cannot pick one up from a brief.+ },+ },}// Harnesses lists the runtimes handoff supports, in display order.diff --git a/docs/cli/handoff.mdx b/docs/cli/handoff.mdxindex 4b458e2b..052d8b15 100644--- a/docs/cli/handoff.mdx+++ b/docs/cli/handoff.mdx@@ -25,10 +25,13 @@ 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` |+| fx | `~/.fx/sessions` | `fx` |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 fx its sessions directory, as `beacon endpoint fx sync --sessions-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.## `beacon handoff list`@@ -110,6 +113,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>` |+ | fx | `fx --resume <id>`, in the session's workspace |- **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:@@ -126,13 +130,15 @@ There are two ways to resume:Claude Code, Cline and Prime Agent subagent sessions, and Cline's older task history, can't be reopened by their CLIs, so they always continue from a brief. A session known only from Beacon's runtime log also continues from a brief, and it needs `--agent` if its own runtime isn't one Beacon can start.+fx has no interactive session that starts from a prompt (`fx ask` runs one request and exits), so it is not in the new-session table. Beacon reopens an fx session natively, and continues it in another runtime with `--agent`; `--agent fx` for another runtime's session, `--new` on an fx session, and an fx session whose files are gone stop with an error rather than launching anything. fx looks a session id up within the workspace it runs in, so Beacon starts it in the session's workspace; `--cwd` elsewhere won't find the session. fx's default permission mode is `auto`, where a reviewer resolves permission requests, and fx has no command-line flag to change it. Beacon passes none: it reopens your own session under whatever permission mode your fx configuration sets.+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.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 `fx` (`fx` only for fx's own sessions). 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,7 +169,7 @@ The link event keeps the new session's id, workspace and harness, and leaves theTwo 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 `fx 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.