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
Record each --follow upload, honor explicit --title/--visibility, fix CI advice
Claude8343d97c6620
diff --git a/cli/beacon/cmd/share_follow.go b/cli/beacon/cmd/share_follow.goindex 94f5d64b..2151c5fe 100644--- a/cli/beacon/cmd/share_follow.go+++ b/cli/beacon/cmd/share_follow.go@@ -90,9 +90,18 @@ func runShareFollow(cmd *cobra.Command, client *account.ShareClient, subject shafingerprint, end, err := shareFollowState(subject)ended = endif err == nil && fingerprint != lastPrint {- opts := shareUploadOptions{Record: uploads == 0}+ // Every upload that sends messages records a session.shared refresh, so a session+ // being followed never looks out of date locally; it is at most one per interval.+ opts := shareUploadOptions{Record: true}if uploads == 0 {+ // An explicit --visibility or --title applies once, to the trace as it is now+ // (created or existing). Later uploads leave both alone, so a rename on beacon.sh+ // while following is kept.opts.Visibility = visibility+ opts.ExplicitVisibility = visibility != ""+ if f := cmd.Flags().Lookup("title"); f != nil && f.Changed {+ opts.ExplicitTitle = true+ }}result, aligned, upErr := shareUpload(ctx, client, subject, opts)var recordErr *shareRecordError@@ -148,11 +157,6 @@ func runShareFollow(cmd *cobra.Command, client *account.ShareClient, subject sha}return fmt.Errorf("%s session %s has nothing to share", subject.session.Harness, subject.session.ID)}- if uploads > 1 {- if err := recordShareEvent(subject.session, last, true); err != nil {- fmt.Fprintf(errOut, "warning: the runtime log was not updated: %v\n", err)- }- }if finalErr != nil {return finalErr}diff --git a/cli/beacon/cmd/share_follow_test.go b/cli/beacon/cmd/share_follow_test.goindex 186a37e1..3dfef142 100644--- a/cli/beacon/cmd/share_follow_test.go+++ b/cli/beacon/cmd/share_follow_test.go@@ -113,8 +113,19 @@ func TestShareFollowUploadsNewMessagesUntilTheSessionEnds(t *testing.T) {if err := json.Unmarshal([]byte(lines[len(lines)-1]), &final); err != nil || !final.Data.Final || !final.Data.Ended || final.Data.SharedURL != "https://beacon.sh/s/k3xabc" {t.Fatalf("last line %q (%v)", lines[len(lines)-1], err)}- if n := len(shareEventsIn(t, env.logPath)); n != 2 {- t.Fatalf("session.shared events = %d, want one for the share and one at the end", n)+ // One per upload: the share, the second answer, the new prompt and the end. Each later one is+ // a refresh, so a followed session is never shown as out of date.+ records := shareEventsIn(t, env.logPath)+ if len(records) != 4 {+ t.Fatalf("session.shared events = %d, want one per upload", len(records))+ }+ for i, r := range records {+ if _, ok := r.Raw["shared_through"].(string); !ok {+ t.Fatalf("record %d has no shared_through: %v", i, r.Raw)+ }+ if _, first := r.Raw["shared_at"]; first != (i == 0) {+ t.Fatalf("record %d shared_at present = %v", i, first)+ }}}@@ -287,3 +298,47 @@ func TestShareFollowKeepsGoingWhenTheFirstRecordFails(t *testing.T) {t.Fatalf("server has %d messages, want 5", len(srv.messages))}}++// --follow to a trace that already exists keeps the title set on it earlier, and applies an+// explicit --visibility to it as plain share does.+func TestShareFollowKeepsTitleAndAppliesExplicitVisibility(t *testing.T) {+ env := newShareEnv(t)+ src := &growingSource{+ session: handoff.Session{Harness: handoff.HarnessClaude, ID: shareTestSession, Directory: env.projectDir, UpdatedAt: time.Now()},+ events: shareFixtureEvents(env.projectDir),+ }+ stubHandoffSources(t, src)+ srv := newFakeShareServer(t)+ srv.signIn(account.ScopeTracesWrite)+ if _, stderr, err := runShareCommand(t, "--cwd", env.projectDir, "--title", "Login fix", "--visibility", "public", "--yes", "--log-path", env.logPath); err != nil {+ t.Fatalf("share: %v\n%s", err, stderr)+ }+ polls := 0+ prevWait := shareFollowWait+ shareFollowWait = func(ctx context.Context, d time.Duration) error {+ polls+++ switch polls {+ case 1:+ m := followEvent(env.projectDir, "2026-10-01T10:01:00.000000000Z", "agent.message")+ m.GenAI = &schema.GenAIInfo{Output: &schema.GenAIOutputInfo{Messages: asymptoteobserve.TextOutputMessages("Second answer.")}}+ src.add(m)+ case 2:+ src.add(followEvent(env.projectDir, "2026-10-01T10:03:00.000000000Z", "session.ended"))+ case 10:+ return errors.New("the loop did not stop")+ }+ return nil+ }+ t.Cleanup(func() { shareFollowWait = prevWait })+ if _, stderr, err := runShareCommand(t, "--follow", "--visibility", "private", "--cwd", env.projectDir, "--log-path", env.logPath); err != nil {+ t.Fatalf("follow: %v\n%s", err, stderr)+ }+ srv.mu.Lock()+ defer srv.mu.Unlock()+ if srv.trace.Title != "Login fix" {+ t.Fatalf("title = %q, want the one set with --title", srv.trace.Title)+ }+ if srv.trace.Visibility != "private" {+ t.Fatalf("visibility = %q, want the explicit --visibility", srv.trace.Visibility)+ }+}diff --git a/docs/cli/share.mdx b/docs/cli/share.mdxindex 93d3df51..726f6be3 100644--- a/docs/cli/share.mdx+++ b/docs/cli/share.mdx@@ -127,7 +127,7 @@ beacon share --follow # this session, until it endsbeacon share --follow --session 5f0c1d2e --interval 30s```-`--follow` waits for a session that has nothing to share yet. The link is printed after the first upload; with `--json`, each upload prints one JSON document per line, and the last carries `"final":true` (and `"ended":true` when the session ended). The runtime log gets one `session.shared` event when the trace is first shared and one when following stops. `--follow` cannot be combined with `--print` or `--list`.+`--follow` waits for a session that has nothing to share yet. The link is printed after the first upload; with `--json`, each upload prints one JSON document per line, and the last carries `"final":true` (and `"ended":true` when the session ended). The runtime log gets one `session.shared` event when the trace is first shared and one after each later upload that sent messages, so the dashboard does not show a followed session as out of date. `--follow` cannot be combined with `--print` or `--list`.## Auto-share@@ -227,7 +227,7 @@ jobs:});```-The URL reaches the script through an environment variable rather than being written into the script, so nothing in the share output can change what the script runs. Sharing failures leave the job green (`exit 0`); drop that to make a missing trace fail the build. To watch the session live, start `beacon share --follow --harness claude_code &` in the step before the agent instead.+The URL reaches the script through an environment variable rather than being written into the script, so nothing in the share output can change what the script runs. Sharing failures leave the job green (`exit 0`); drop that to make a missing trace fail the build. Share after the agent finishes, as above, rather than with `--follow`: `--follow` needs the session to exist when it starts (it exits with "no agent session found" otherwise), and most CI runners stop background processes when the step that started them ends. Keep `--follow` for watching a session from your own terminal, or for a step that runs it alongside the agent and waits for it.### GitLab CI