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
fix(cloud): honest backfill times, real Codex prompts, faster first upload
shukieshah3e7ffdb9105d
diff --git a/beacon-sandbox/runner/forward.go b/beacon-sandbox/runner/forward.goindex ec0971b6..a931178d 100644--- a/beacon-sandbox/runner/forward.go+++ b/beacon-sandbox/runner/forward.go@@ -232,7 +232,7 @@ echo "FORWARD_VECTOR_EXE=$(readlink /proc/$pid/exe)"`,// forwardCollect waits for the session's events to reach the stand-in, then brings its record// home.//-// The pack batches for up to 60 seconds, so the wait is a poll for the two things the check needs,+// The pack batches for up to 10 seconds, so the wait is a poll for the two things the check needs,// bounded well past one batch. It is skipped when setup failed, since nothing is running to wait// for; whatever the stand-in and Vector wrote is still collected. Vector and the stand-in are// stopped afterwards; on a disposable sandbox that is tidiness, on a machine that outlives the rundiff --git a/cli/beacon/cmd/endpoint_connect.go b/cli/beacon/cmd/endpoint_connect.goindex cae81636..2fa3dbee 100644--- a/cli/beacon/cmd/endpoint_connect.go+++ b/cli/beacon/cmd/endpoint_connect.go@@ -187,12 +187,12 @@ func connectEndpointFor(cmd *cobra.Command, userMode bool, logPath string, backf// the staged session backfill the dashboard fills as agents run.fmt.Fprintln(out)if result.Backfill != nil && result.Backfill.Events > 0 {- fmt.Fprintf(out, "Uploading %d events of recent session history; they appear at %s within a few minutes.\n", result.Backfill.Events, dashboardHomeURL(result.Enrollment.DashboardURL))- fmt.Fprintln(out, "Next: keep using your agents as you normally would; new sessions appear within a minute of the activity.")+ fmt.Fprintf(out, "Uploading %d events of recent session history; they appear at %s within about 15 seconds.\n", result.Backfill.Events, dashboardHomeURL(result.Enrollment.DashboardURL))+ fmt.Fprintln(out, "Next: keep using your agents as you normally would; new sessions appear within about 15 seconds of the activity.")return nil}fmt.Fprintln(out, "Next: run any supported agent as you normally would.")- fmt.Fprintf(out, "Its sessions appear at %s within a minute of the activity.\n", dashboardHomeURL(result.Enrollment.DashboardURL))+ fmt.Fprintf(out, "Its sessions appear at %s within about 15 seconds of the activity.\n", dashboardHomeURL(result.Enrollment.DashboardURL))return nil}diff --git a/cli/beacon/cmd/endpoint_connect_test.go b/cli/beacon/cmd/endpoint_connect_test.goindex bed146ac..67497e0f 100644--- a/cli/beacon/cmd/endpoint_connect_test.go+++ b/cli/beacon/cmd/endpoint_connect_test.go@@ -135,7 +135,7 @@ func TestConnectUsesSignedInAccountAndSelectedPrivacy(t *testing.T) {"Next: run any supported agent",// The recorded service URL is the marketing root; the app is at /dashboard."sessions appear at https://beacon.sh/dashboard",- "within a minute",+ "within about 15 seconds",} {if !strings.Contains(text, want) {t.Fatalf("connect should close on next steps, missing %q:\n%s", want, text)@@ -144,7 +144,7 @@ func TestConnectUsesSignedInAccountAndSelectedPrivacy(t *testing.T) {if strings.Contains(text, "/dashboard/endpoints") || strings.Contains(text, "Revoke this device") {t.Fatalf("the closing lines should be next steps, not device administration:\n%s", text)}- if last := strings.TrimSpace(text); !strings.HasSuffix(last, "within a minute of the activity.") {+ if last := strings.TrimSpace(text); !strings.HasSuffix(last, "within about 15 seconds of the activity.") {t.Fatalf("the dashboard should be the last thing said:\n%s", text)}}diff --git a/cli/beacon/cmd/endpoint_destinations.go b/cli/beacon/cmd/endpoint_destinations.goindex 5d930c90..3356a95e 100644--- a/cli/beacon/cmd/endpoint_destinations.go+++ b/cli/beacon/cmd/endpoint_destinations.go@@ -333,7 +333,7 @@ var siemDestinations = []siemDestination{fmt.Println(`Check the device key: curl -sS -o /dev/null -w '%{http_code}\n' "$BEACON_ASYMPTOTE_INGEST_URL/v1/ingest/health" -H "Authorization: Bearer $(sed -n 's/.*\"device_key\": *\"\([^\"]*\)\".*/\1/p' "$BEACON_ASYMPTOTE_SECRETS_FILE")" # 200 valid, 401 revoked`)// Points at the dashboard itself: its views are tabs, so there is no// /dashboard/telemetry route to send anyone to.- fmt.Printf("Confirm delivery at %s by searching for \"Beacon endpoint Asymptote validation event\"; forwarded events appear within a minute or two.\n", dashboardHomeURL(""))+ fmt.Printf("Confirm delivery at %s by searching for \"Beacon endpoint Asymptote validation event\"; forwarded events appear within about 15 seconds.\n", dashboardHomeURL(""))},},extra: addAsymptoteReconcileCommand,diff --git a/cli/beacon/internal/claudesession/mapper.go b/cli/beacon/internal/claudesession/mapper.goindex 379b999b..06eb70a9 100644--- a/cli/beacon/internal/claudesession/mapper.go+++ b/cli/beacon/internal/claudesession/mapper.go@@ -50,10 +50,13 @@ type mapper struct {// to the same prompt by their place in the file. The whole file is read on every sync, so the// value is right even for the first record past the cursor.promptID string+ // fallbackTimestamp stamps records that carry no timestamp of their own (see fallbackTimestamp).+ fallbackTimestamp string}func MapSession(ref SessionRef, records []Record, opts MapOptions) []MappedEvent {m := &mapper{ref: ref, opts: opts, tools: map[string]toolCall{}}+ m.fallbackTimestamp = fallbackTimestamp(ref, records, opts.MinLine)m.usage = planUsage(ref, records, opts.MinLine, opts.responses)for i := range records {m.consume(records[i])@@ -322,6 +325,8 @@ func (m *mapper) base(record Record, action, category string, severity schema.Se})if ts := parseTimestamp(entry.Timestamp); ts != "" {ev.Timestamp = ts+ } else if m.fallbackTimestamp != "" {+ ev.Timestamp = m.fallbackTimestamp}sessionID := entry.SessionIDif sessionID == "" {@@ -462,11 +467,51 @@ func mergeGenAI(base, next *schema.GenAIInfo) *schema.GenAIInfo {}func parseTimestamp(value string) string {+ if ts, ok := recordTime(value); ok {+ return schema.FormatTimestamp(ts)+ }+ return ""+}++func recordTime(value string) (time.Time, bool) {if strings.TrimSpace(value) == "" {- return ""+ return time.Time{}, false+ }+ ts, err := time.Parse(time.RFC3339Nano, value)+ if err != nil {+ return time.Time{}, false+ }+ return ts.UTC(), true+}++// fallbackTimestamp is the time given to a record that has none of its own. Claude Code writes+// bookkeeping records (permission-mode, mode, last-prompt, ai-title, agent-name, summary) that+// carry a sessionId but no timestamp, and the first of them is often the record session.started+// is emitted for. Stamping those with the time of the sync made every backfilled session look as+// if it ran until the backfill. The earliest timestamp past the cursor is used, then the earliest+// in the file, then the file's modification time; only a file with none of these is left with+// the time of the sync.+func fallbackTimestamp(ref SessionRef, records []Record, minLine int) string {+ var earliest, earliestPastCursor time.Time+ for _, record := range records {+ ts, ok := recordTime(record.Entry.Timestamp)+ if !ok {+ continue+ }+ if earliest.IsZero() || ts.Before(earliest) {+ earliest = ts+ }+ if record.Line > minLine && (earliestPastCursor.IsZero() || ts.Before(earliestPastCursor)) {+ earliestPastCursor = ts+ }}- if ts, err := time.Parse(time.RFC3339Nano, value); err == nil {- return schema.FormatTimestamp(ts.UTC())+ switch {+ case !earliestPastCursor.IsZero():+ return schema.FormatTimestamp(earliestPastCursor)+ case !earliest.IsZero():+ return schema.FormatTimestamp(earliest)+ case ref.ModTimeUnixMS > 0:+ return schema.FormatTimestamp(time.UnixMilli(ref.ModTimeUnixMS).UTC())}return ""}diff --git a/cli/beacon/internal/claudesession/timestamp_test.go b/cli/beacon/internal/claudesession/timestamp_test.gonew file mode 100644index 00000000..a69652b8--- /dev/null+++ b/cli/beacon/internal/claudesession/timestamp_test.go@@ -0,0 +1,84 @@+package claudesession++import (+ "testing"+ "time"+)++// Claude Code writes bookkeeping records with a sessionId and no timestamp. When one of them is the+// first record of a session, session.started is emitted for it, and it must take the session's own+// time rather than the time of the sync.+func TestSessionStartedWithoutATimestampTakesTheSessionsEarliest(t *testing.T) {+ ref := SessionRef{ID: "sess-1", Path: "/tmp/sess-1.jsonl", ProjectPath: "/tmp/repo"}+ records := decodeFixture(t, []string{+ `{"type":"permission-mode","permissionMode":"default","sessionId":"sess-1"}`,+ userLineAt("sess-1", "u1", "add a health endpoint", "2026-10-08T10:00:00Z"),+ userLineAt("sess-1", "u2", "now document it", "2026-10-08T10:05:00Z"),+ })++ mapped := MapSession(ref, records, MapOptions{})+ started := findAction(t, mapped, "session.started")+ if want := "2026-10-08T10:00:00.000000000Z"; started.Timestamp != want {+ t.Fatalf("session.started timestamp = %q, want %q", started.Timestamp, want)+ }+ if mapped[0].SourceLine != 1 {+ t.Fatalf("session.started source line = %d, want the permission-mode record", mapped[0].SourceLine)+ }++ // The event id stays tied to the record's place in the file, not to the time it was given.+ again := MapSession(ref, records, MapOptions{})+ if again[0].DedupID != mapped[0].DedupID {+ t.Fatalf("session.started id changed between syncs: %q then %q", mapped[0].DedupID, again[0].DedupID)+ }+}++// A sweep past a cursor that has not yet recorded a start emits session.started for the first+// record past the cursor, and takes the earliest time past the cursor.+func TestSessionStartedPastTheCursorTakesTheEarliestTimePastIt(t *testing.T) {+ ref := SessionRef{ID: "sess-1", Path: "/tmp/sess-1.jsonl", ProjectPath: "/tmp/repo"}+ records := decodeFixture(t, []string{+ `{"type":"file-history-snapshot","snapshot":{}}`,+ userLineAt("sess-1", "u0", "an earlier prompt", "2026-10-08T09:00:00Z"),+ `{"type":"mode","mode":"normal","sessionId":"sess-1"}`,+ userLineAt("sess-1", "u1", "add a health endpoint", "2026-10-08T10:00:00Z"),+ })++ mapped := MapSession(ref, records, MapOptions{MinLine: 2, SkipSessionStarted: false})+ started := findAction(t, mapped, "session.started")+ if want := "2026-10-08T10:00:00.000000000Z"; started.Timestamp != want {+ t.Fatalf("session.started timestamp = %q, want %q", started.Timestamp, want)+ }+}++// A summary record carries no timestamp, so it is given the session's own time too.+func TestSummaryWithoutATimestampTakesTheSessionsTime(t *testing.T) {+ ref := SessionRef{ID: "sess-1", Path: "/tmp/sess-1.jsonl", ProjectPath: "/tmp/repo"}+ records := decodeFixture(t, []string{+ `{"type":"summary","summary":"Health endpoint added","leafUuid":"u1","message":{"summary":"Health endpoint added"}}`,+ userLineAt("sess-1", "u1", "add a health endpoint", "2026-10-08T10:00:00Z"),+ })++ mapped := MapSession(ref, records, MapOptions{SkipSessionStarted: true})+ summary := findAction(t, mapped, "session.summary")+ if want := "2026-10-08T10:00:00.000000000Z"; summary.Timestamp != want {+ t.Fatalf("session.summary timestamp = %q, want %q", summary.Timestamp, want)+ }+}++// A file whose records carry no timestamp at all is given its modification time.+func TestRecordsWithoutAnyTimestampTakeTheFilesModificationTime(t *testing.T) {+ modified := time.Date(2026, 10, 7, 18, 30, 0, 0, time.UTC)+ ref := SessionRef{ID: "sess-1", Path: "/tmp/sess-1.jsonl", ProjectPath: "/tmp/repo", ModTimeUnixMS: modified.UnixMilli()}+ records := decodeFixture(t, []string{+ `{"type":"ai-title","title":"Health endpoint","sessionId":"sess-1"}`,+ })++ started := findAction(t, MapSession(ref, records, MapOptions{}), "session.started")+ if want := "2026-10-07T18:30:00.000000000Z"; started.Timestamp != want {+ t.Fatalf("session.started timestamp = %q, want %q", started.Timestamp, want)+ }+}++func userLineAt(sessionID, uuid, text, timestamp string) string {+ return `{"parentUuid":null,"isSidechain":false,"type":"user","message":{"role":"user","content":` + quote(text) + `},"uuid":` + quote(uuid) + `,"timestamp":` + quote(timestamp) + `,"cwd":"/tmp/repo","sessionId":` + quote(sessionID) + `,"version":"2.1.154","gitBranch":"main"}`+}diff --git a/cli/beacon/internal/codexsession/injected_context_test.go b/cli/beacon/internal/codexsession/injected_context_test.gonew file mode 100644index 00000000..9931ca8e--- /dev/null+++ b/cli/beacon/internal/codexsession/injected_context_test.go@@ -0,0 +1,107 @@+package codexsession++import (+ "strings"+ "testing"+)++const (+ environmentContext = "<environment_context>\n <cwd>/tmp/repo</cwd>\n <shell>zsh</shell>\n</environment_context>"+ agentsInstructions = "# AGENTS.md instructions for /tmp/repo\n\n<INSTRUCTIONS>\nRun the tests before committing.\n</INSTRUCTIONS>"+ userInstructions = "<user_instructions>\nPrefer small commits.\n</user_instructions>"+)++// userMessageLine writes a user-role message with one block per text and, when kinds is not nil,+// the content_item_kinds newer Codex builds attach.+func userMessageLine(id string, kinds []string, texts ...string) string {+ blocks := make([]string, 0, len(texts))+ for _, text := range texts {+ blocks = append(blocks, `{"type":"input_text","text":`+quote(text)+`}`)+ }+ passthrough := ""+ if kinds != nil {+ quoted := make([]string, 0, len(kinds))+ for _, kind := range kinds {+ quoted = append(quoted, quote(kind))+ }+ passthrough = `,"internal_chat_message_metadata_passthrough":{"turn_id":"turn-1","content_item_kinds":[` + strings.Join(quoted, ",") + `]}`+ }+ return `{"timestamp":"2026-09-19T22:00:02.000Z","type":"response_item","payload":{"type":"message","id":` + quote(id) + `,"role":"user","content":[` + strings.Join(blocks, ",") + `]` + passthrough + `}}`+}++func prompts(mapped []MappedEvent) []MappedEvent {+ var out []MappedEvent+ for _, item := range mapped {+ if item.Event.Event.Action == "prompt.submitted" {+ out = append(out, item)+ }+ }+ return out+}++// Codex writes the environment, AGENTS.md and the person's instructions as user-role messages.+// Recording them as prompts titled every backfilled session after them, so only what the person+// typed is a prompt.+func TestInjectedContextIsNotAPrompt(t *testing.T) {+ ref := SessionRef{ID: "codex-1", Path: "/tmp/codex-1.jsonl", Workspace: "/tmp/repo"}+ records := decodeFixture(t, []string{+ sessionMetaLine("codex-1", "/tmp/repo"),+ turnStartedLine("turn-1"),+ turnContextLine("turn-1", "gpt-5.3-codex"),+ userMessageLine("u0", nil, environmentContext),+ userMessageLine("u1", nil, agentsInstructions),+ userMessageLine("u2", nil, userInstructions),+ messageLine("user", "u3", "run the tests"),+ messageLine("assistant", "a1", "Tests pass."),+ })++ got := prompts(MapSession(ref, records, MapOptions{}))+ if len(got) != 1 {+ t.Fatalf("prompts = %d, want only the one the person typed", len(got))+ }+ prompt := got[0].Event+ if prompt.Prompt.Text != "run the tests" {+ t.Fatalf("prompt text = %q, want the typed prompt", prompt.Prompt.Text)+ }+ if prompt.Prompt.ID != "turn-1" {+ t.Fatalf("prompt id = %q, want turn-1", prompt.Prompt.ID)+ }+}++// Newer Codex builds name each block's kind. A message whose kinds include no "user.text" is+// injected context even when its text opens with something Beacon does not recognize, and a+// message that mixes both keeps only what the person typed.+func TestContentItemKindsDecideWhatIsAPrompt(t *testing.T) {+ ref := SessionRef{ID: "codex-1", Path: "/tmp/codex-1.jsonl", Workspace: "/tmp/repo"}+ records := decodeFixture(t, []string{+ sessionMetaLine("codex-1", "/tmp/repo"),+ turnStartedLine("turn-1"),+ turnContextLine("turn-1", "gpt-5.3-codex"),+ userMessageLine("u0", []string{"agents_md.instructions", "environments.environment_context"}, agentsInstructions, environmentContext),+ userMessageLine("u1", []string{"environments.future_context"}, "<future_context>a block Beacon has never seen</future_context>"),+ userMessageLine("u2", []string{"user.text"}, "tell me about this repo"),+ userMessageLine("u3", []string{"environments.environment_context", "user.text"}, environmentContext, "and then the tests"),+ })++ var texts []string+ for _, item := range prompts(MapSession(ref, records, MapOptions{})) {+ texts = append(texts, item.Event.Prompt.Text)+ }+ want := []string{"tell me about this repo", "and then the tests"}+ if strings.Join(texts, "|") != strings.Join(want, "|") {+ t.Fatalf("prompts = %q, want %q", texts, want)+ }+}++// The passthrough metadata is Codex's own and may change shape. One Beacon cannot read is ignored+// rather than making the record unreadable.+func TestUnreadablePassthroughKeepsThePrompt(t *testing.T) {+ ref := SessionRef{ID: "codex-1", Path: "/tmp/codex-1.jsonl", Workspace: "/tmp/repo"}+ line := `{"timestamp":"2026-09-19T22:00:02.000Z","type":"response_item","payload":{"type":"message","id":"u1","role":"user","content":[{"type":"input_text","text":"run the tests"}],"internal_chat_message_metadata_passthrough":{"content_item_kinds":"user.text"}}}`+ records := decodeFixture(t, []string{sessionMetaLine("codex-1", "/tmp/repo"), line})++ got := prompts(MapSession(ref, records, MapOptions{}))+ if len(got) != 1 || got[0].Event.Prompt.Text != "run the tests" {+ t.Fatalf("prompts = %+v, want the typed prompt", got)+ }+}diff --git a/cli/beacon/internal/codexsession/mapper.go b/cli/beacon/internal/codexsession/mapper.goindex fe8963f0..82124dd4 100644--- a/cli/beacon/internal/codexsession/mapper.go+++ b/cli/beacon/internal/codexsession/mapper.go@@ -155,16 +155,71 @@ func (m *mapper) consumeMessage(record Record, item *ResponseItem, emit bool) {if !emit {return}- text := strings.TrimSpace(textFromContent(item.Content))- if text == "" {- return- }switch strings.ToLower(item.Role) {case "user":- m.emitPrompt(record, text)+ if text := userPromptText(item); text != "" {+ m.emitPrompt(record, text)+ }case "assistant":- m.emitAgentMessage(record, text, item.ID)+ if text := strings.TrimSpace(textFromContent(item.Content)); text != "" {+ m.emitAgentMessage(record, text, item.ID)+ }+ }+}++// injectedContextPrefixes open the user-role messages Codex writes itself at the start of a+// session or turn: the environment it runs in, the repository's AGENTS.md, and the person's+// configured instructions. None of them is something the person typed.+var injectedContextPrefixes = []string{+ "<environment_context>",+ "<user_instructions>",+ "# AGENTS.md instructions for",+}++func injectedContext(text string) bool {+ text = strings.TrimSpace(text)+ for _, prefix := range injectedContextPrefixes {+ if strings.HasPrefix(text, prefix) {+ return true+ }+ }+ return false+}++// userPromptText is what the person typed in a user-role message, or "" when the message is only+// context Codex injected. Recording that context as a prompt titled every backfilled session after+// its environment or AGENTS.md. Newer builds name each block's kind, and a message with kinds but+// no "user.text" among them is injected context whatever its text says; blocks are otherwise+// recognized by the prefixes Codex writes.+func userPromptText(item *ResponseItem) string {+ if kinds := item.contentItemKinds(); len(kinds) > 0 && !containsString(kinds, "user.text") {+ return ""+ }+ blocks, ok := item.Content.([]interface{})+ if !ok {+ text := textFromContent(item.Content)+ if injectedContext(text) {+ return ""+ }+ return text+ }+ kept := make([]interface{}, 0, len(blocks))+ for _, raw := range blocks {+ if block, ok := raw.(map[string]interface{}); ok && injectedContext(firstString(block, "text", "content")) {+ continue+ }+ kept = append(kept, raw)+ }+ return textFromContent(kept)+}++func containsString(values []string, want string) bool {+ for _, value := range values {+ if value == want {+ return true+ }}+ return false}func (m *mapper) consumeEventMessage(record Record, emit bool) {diff --git a/cli/beacon/internal/codexsession/types.go b/cli/beacon/internal/codexsession/types.goindex d99f89b9..7e087ede 100644--- a/cli/beacon/internal/codexsession/types.go+++ b/cli/beacon/internal/codexsession/types.go@@ -66,6 +66,26 @@ type ResponseItem struct {Input interface{} `json:"input,omitempty"`Output interface{} `json:"output,omitempty"`Arguments string `json:"arguments,omitempty"`+ // Passthrough is the metadata newer Codex builds attach to a message. It is kept raw and+ // read leniently (see contentItemKinds), so a shape Beacon does not expect never makes the+ // whole record unreadable.+ Passthrough json.RawMessage `json:"internal_chat_message_metadata_passthrough,omitempty"`+}++// contentItemKinds is what Codex says each content block of a message is, such as "user.text"+// for what the person typed or "environments.environment_context" for context Codex injected.+// It is nil when the message carries no such list.+func (item *ResponseItem) contentItemKinds() []string {+ if len(item.Passthrough) == 0 {+ return nil+ }+ var passthrough struct {+ ContentItemKinds []string `json:"content_item_kinds"`+ }+ if err := json.Unmarshal(item.Passthrough, &passthrough); err != nil {+ return nil+ }+ return passthrough.ContentItemKinds}type EventMessage struct {diff --git a/cli/beacon/internal/endpoint/asymptote/asymptote_test.go b/cli/beacon/internal/endpoint/asymptote/asymptote_test.goindex 2a736ee3..48f6f220 100644--- a/cli/beacon/internal/endpoint/asymptote/asymptote_test.go+++ b/cli/beacon/internal/endpoint/asymptote/asymptote_test.go@@ -64,6 +64,48 @@ func TestVectorConfigForwardsBothStreamsOverHTTPWithABearerSecret(t *testing.T)}}+// A new user's first sessions should reach the dashboard within seconds of connecting, so the+// runtime sink flushes a partial batch after ten seconds and paces itself at the one request a+// second the ingest service allows each device. Vector accepts unknown keys in these sections+// without a word, so a misspelled or misplaced key would validate and do nothing; this pins them.+func TestRuntimeSinkFlushesQuicklyAtTheIngestRate(t *testing.T) {+ got, err := VectorConfig("/tmp/beacon/runtime.jsonl")+ if err != nil {+ t.Fatalf("VectorConfig returned error: %v", err)+ }+ var config struct {+ Sinks map[string]struct {+ Batch struct {+ TimeoutSecs *int64 `toml:"timeout_secs"`+ } `toml:"batch"`+ Request struct {+ RateLimitNum *int64 `toml:"rate_limit_num"`+ RateLimitDurationSecs *int64 `toml:"rate_limit_duration_secs"`+ } `toml:"request"`+ } `toml:"sinks"`+ }+ if err := toml.Unmarshal([]byte(got), &config); err != nil {+ t.Fatalf("parse rendered config: %v", err)+ }+ runtime, ok := config.Sinks["asymptote_runtime"]+ if !ok {+ t.Fatalf("no asymptote_runtime sink:\n%s", got)+ }+ for _, setting := range []struct {+ name string+ value *int64+ want int64+ }{+ {"batch.timeout_secs", runtime.Batch.TimeoutSecs, 10},+ {"request.rate_limit_num", runtime.Request.RateLimitNum, 1},+ {"request.rate_limit_duration_secs", runtime.Request.RateLimitDurationSecs, 1},+ } {+ if setting.value == nil || *setting.value != setting.want {+ t.Fatalf("asymptote_runtime %s = %v, want %d", setting.name, setting.value, setting.want)+ }+ }+}+func TestIngestSmokeTestChecksCredentialBeforePosting(t *testing.T) {got, err := IngestSmokeTest("/tmp/beacon/runtime.jsonl")if err != nil {diff --git a/cli/beacon/internal/endpoint/asymptote/pack/vector.toml.tmpl b/cli/beacon/internal/endpoint/asymptote/pack/vector.toml.tmplindex 641ac1fc..f4f9e794 100644--- a/cli/beacon/internal/endpoint/asymptote/pack/vector.toml.tmpl+++ b/cli/beacon/internal/endpoint/asymptote/pack/vector.toml.tmpl@@ -66,10 +66,12 @@ method = "newline_delimited"Content-Type = "application/x-ndjson"[sinks.asymptote_runtime.batch]-# Stays under the ingest service's 8 MiB compressed / 10,000 line limits.+# Stays under the ingest service's 8 MiB compressed / 10,000 line limits. A+# short window puts a new user's first sessions on the dashboard within seconds+# of connecting; a busy device still fills batches by size.max_bytes = 5000000max_events = 5000-timeout_secs = 60+timeout_secs = 10[sinks.asymptote_runtime.buffer]# Survives offline periods and forwarder restarts; drains on reconnect.@@ -81,6 +83,11 @@ when_full = "block"timeout_secs = 30retry_initial_backoff_secs = 2retry_max_duration_secs = 300+# At most one request a second, the rate the ingest service allows each+# device. A backfill or a backlog drained after an offline period is sent in+# full batches at that pace instead of tripping 429s.+rate_limit_num = 1+rate_limit_duration_secs = 1# The healthcheck carries the bearer key, so a revoked or expired device shows up# as an unhealthy sink at startup (401) instead of silently dropping batches.diff --git a/docs/changelog/cli.mdx b/docs/changelog/cli.mdxindex 650d3c3d..717f72ea 100644--- a/docs/changelog/cli.mdx+++ b/docs/changelog/cli.mdx@@ -12,6 +12,10 @@ Stay up to date with the latest changes to the Agent Beacon CLI.## October 2026- **Setup ends at the dashboard** · Confirming Beacon Cloud in the `beacon endpoint install` wizard used to end on some forty lines of file paths, connect details, an MCP table and per-runtime steps, and nothing pointed to the hosted dashboard. It now ends on four lines: the account, device and privacy mode; the session backfill; the dashboard URL; and where Beacon Cloud MCP was added. Beacon then opens the dashboard in your browser, except with `--no-browser`, over SSH, or on Linux without a display. The sign-in wait screen now also asks you to open the URL in the browser where you are signed in to beacon.sh, and cancelling the wizard says that nothing was installed and how to start again. `beacon endpoint connect` and `beacon mcp connect` print the same output as before. See [Onboarding](/cli/endpoint-onboarding#when-setup-finishes).+- **Beacon Cloud shows new sessions within seconds** · The forwarder held runtime events for up to 60 seconds before sending a batch, so right after `beacon endpoint connect` the dashboard stayed empty for a minute and looked broken. It now sends a partial batch after 10 seconds, and paces runtime requests at one a second, the rate the ingest service allows each device, so a backfill or a backlog after an offline period goes out in full batches without being turned away. Install, repair and package upgrades rewrite a connected forwarder's config and restart it; what it has already read is kept. See [Beacon Cloud](/log-forwarding/asymptote).+- **Backfilled Claude Code sessions keep their own times** · Claude Code writes some transcript records (the permission mode, the session title, the last prompt and similar) without a timestamp, and the first of them is often where a session starts. Session sync stamped those with the time of the sync, so every backfilled session appeared to run until Beacon was installed. They now take the session's earliest recorded time, or the transcript's modification time when no record has one. Events already written keep their old time.+- **Backfilled Codex sessions are named after what you typed** · Codex records the environment it runs in, the repository's AGENTS.md and your configured instructions as user messages, and session sync recorded them as prompts. Every backfilled Codex session was then titled `<environment_context>` or `# AGENTS.md instructions for …`, and the dashboard grouped them all as recurring. Those messages are no longer prompts, using the block kinds newer Codex builds record and the text older ones open with.+- **Self-update installs only Beacon-signed packages, over https** · The macOS self-updater took the Apple team a package must be signed by from `update-manifest.json`, which is unsigned, matched it as a substring of the signature output, and skipped the check when the manifest named no team. Whoever could rewrite the manifest could have any notarized package installed as root. The team is now built into `beacon` (Asymptote Labs, `3A98D35XJR`) and must match the package's installer signer exactly, for self-update and the enterprise edition install alike. The manifest and the package must also be fetched over `https`, plain `http` only to a loopback mirror and never through a redirect, so a `managed.json` that names an `http://` update URL on another host stops updating until it is changed to `https`.- **The Jamf hook repair script no longer hands the console user root** · `jamf/claude/common/repair-hooks.sh` runs as root. It granted the console user permission to add and delete entries in `/var/log/beacon-agent`, which let them replace the runtime log with a link that the root collector then opened, and it ran `chown -R` on `~/.beacon` as root, which a planted hard link turned into ownership of a root-run binary. The directory grant is gone, and the script now removes every grant that adds or deletes entries there, including ones earlier runs gave a previous console user and the one the Jamf guide's snippet used to add. It creates and fixes up `~/.beacon` as the user, refuses a symlinked directory, and moves aside one the user does not own. The Jamf guide explains how to remove the old grant by hand.- **The scheduled inventory job follows every moved runtime directory** · The job starts without your shell's environment, so a per-user install or repair records the variables that move a runtime's user directory into it. It recorded `CODEX_HOME`, `HERMES_HOME`, `CLINE_DIR`, `GEMINI_CLI_HOME` and `CLAUDE_CONFIG_DIR`, and now also `KIRO_HOME`, `KIMI_CODE_HOME`, `DSH_HOME`, `OH_PERSISTENCE_DIR`, `OPENCLAW_STATE_DIR`, `XDG_CONFIG_HOME` (Muse, and VS Code on Linux), `PI_CODING_AGENT_DIR`, `OMO_CODING_AGENT_DIR`, `SENPI_CODING_AGENT_DIR`, `PRIME_AGENT_CODING_AGENT_DIR`, and Oh My Pi's `PI_CONFIG_DIR`, `OMP_PROFILE` and `PI_PROFILE`. With one of these set only in your shell, the job used to inventory the default directory while the runtime read the moved one. See [Inventory heartbeats](/cli/endpoint-inventory#inventory-heartbeats).diff --git a/docs/cli/asymptote.mdx b/docs/cli/asymptote.mdxindex a16be3af..2d3d5791 100644--- a/docs/cli/asymptote.mdx+++ b/docs/cli/asymptote.mdx@@ -123,7 +123,7 @@ vector --config ./beacon-asymptote-pack/vector.tomlbeacon endpoint asymptote validate```-The command writes the local event only. If the forwarder is running, the event reaches the ingest service within its batch window (60 seconds) and appears on the dashboard telemetry page a minute or so later. Search for the message `Beacon endpoint Beacon validation event`.+The command writes the local event only. If the forwarder is running, the event reaches the ingest service within its batch window (10 seconds) and appears on the dashboard telemetry page within about 15 seconds of being written. Search for the message `Beacon endpoint Beacon validation event`.Expected validation fields:diff --git a/docs/log-forwarding/asymptote.mdx b/docs/log-forwarding/asymptote.mdxindex 424b1cfc..1bde4327 100644--- a/docs/log-forwarding/asymptote.mdx+++ b/docs/log-forwarding/asymptote.mdx@@ -45,7 +45,7 @@ The ingest service checks three things on every request: the key is known and no- `POST <ingest url>/v1/ingest/runtime` and `POST <ingest url>/v1/ingest/inventory` with `Authorization: Bearer <device key>`, `Content-Type: application/x-ndjson`, and `Content-Encoding: gzip`. HTTPS only; the CLI and pack refuse other schemes.- Each line must be a Beacon endpoint event: `vendor=beacon`, `product=endpoint-agent`, `schema_version`, a parseable `timestamp`, and `event.kind` and `event.action`. Malformed lines are counted and reported; a batch fails only if every line is bad.-- Limits per request: 8 MiB compressed, 10,000 lines, 1 MiB per line. The pack batches at 5 MB or 5,000 events or 60 seconds, whichever comes first.+- Limits per request: 8 MiB compressed, 10,000 lines, 1 MiB per line. The pack batches at 5 MB or 5,000 events or 10 seconds, whichever comes first, and sends runtime batches at most once a second, the rate the ingest service allows each device.- Responses: `200` with accepted and rejected counts and the object written; `401` for an unknown, revoked, or expired key, or an approver who left the organization; `403` when the organization is not enabled; `413` when a limit is exceeded; `429` and `5xx` are retried by Vector with backoff. Other `4xx` responses are dropped, which is the intended behavior for a revoked key.- `GET /v1/ingest/health` (or `HEAD`) with the bearer key returns `200` or `401` and is the credential check the forwarder's startup healthcheck and the smoke-test script use.@@ -67,7 +67,7 @@ The pack includes `README.md`, `vector.toml`, `asymptote-ingest-smoke-test.sh`,1. Run `sh ./beacon-asymptote-pack/asymptote-ingest-smoke-test.sh` with `BEACON_ASYMPTOTE_INGEST_URL` and `BEACON_ASYMPTOTE_SECRETS_FILE` set. It checks the key (`200` valid, `401` revoked) and posts the log tail once.2. With Vector running, write a validation event: `beacon endpoint asymptote validate`.-3. Within a minute or two, search the dashboard telemetry page for `Beacon endpoint Beacon validation event`.+3. Within about 15 seconds, search the dashboard telemetry page for `Beacon endpoint Beacon validation event`.## Revocation