Add --replay-all to browsers telemetry stream#189
Conversation
Add --replay-all to `browsers telemetry stream`, forwarding replay=all so the stream starts from the oldest retained event instead of from-now. Mutually exclusive with --seq. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
🔧 CI Fix Available I've pushed a fix for the CI failure. The build broke because The fix implements |
The replay=all wire value is shared with the browser image with no generated enum tying them; name it and document the contract. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Exposes the telemetry stream replay param. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Get gained a query params argument in the SDK bump; thread it through the service interface, call site, and test fake. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
rgarcia
left a comment
There was a problem hiding this comment.
reviewed with live QA. one correctness issue to fix before this ships:
cmd/browsers_telemetry.go:181—--replay-all --seq=-1is accepted and replays from the oldest retained event, even though the new help/docs say--replay-allis mutually exclusive with--seq. consider tracking whether--seqwas explicitly provided (for example fromcmd.Flags().Changed("seq")) and rejecting the combination based on flag presence, not justSeq != -1.
The mutual-exclusion guard keyed off Seq != -1, so an explicit --seq=-1 (the unset sentinel) slipped past it and was accepted alongside --replay-all, contradicting the documented mutual exclusivity. Track whether --seq was provided via cmd.Flags().Changed and reject on presence, not value. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sayan-
left a comment
There was a problem hiding this comment.
Confirmed feedback flagged by raf has been appropriately addressed. No pending issues from my review 👍
Summary
Adds
--replay-alltokernel browsers telemetry stream <id>, the CLI surface for telemetry replay-from-oldest. When set, it forwardsreplay=allso the stream starts from the oldest retained ring-buffer event instead of from-now.--replay-allbool flag, mutually exclusive with--seq(one starts from the oldest retained event, the other resumes after a specific sequence).--seq->Last-Event-ID,--replay-all->replay=all(named constantreplayAllValue, since the wire value is shared with the browser image with no generated enum tying them).kernel-go-sdkto v0.70.0 (exposes theReplayparam). The bump also required a small unrelated adaptation toAPIKeyService.Get(gained a params arg), kept as its own commit.Sequencing (KERNEL-1351): kernel-images replay (shipped) -> kernel/kernel #2381 (merged + deployed) -> kernel-go-sdk v0.70.0 (published) -> this PR.
Test plan
go build ./...+go test ./cmd/...green (SDK bumped to v0.70.0)Live test results
Built
bin/kernelatkernel-go-sdk v0.70.0and ran against production.Flag / validation (these fire before any network call):
--help--replay-all--replay-all --seq 5--replay-all --seq 0--seq -2/--seq 0--categories bogus-o yamlLive end-to-end (created a headless browser with
--telemetry all, generated ~7api_callevents, then deleted the browser):--replay-allseq 1--seq 3seq 4 -> 8seq 10(the post-connect event), not 1-7Not exercised live: eviction (replay-all's first
seq> 1 once the 1024-event ring overflows) needs >1024 events; it is pure server behavior, already verified server-side, and the CLI just prints whatever frames the server returns.Note
Low Risk
CLI flag wiring, SDK bump, and docs/tests only; replay behavior is server-side and API keys get uses an empty params struct.
Overview
Adds
--replay-alltokernel browsers telemetry stream, so the CLI can start from the oldest retained telemetry event instead of only live /--seqresume. With--replay-all, the stream sends SDK paramreplay=all(viareplayAllValue);--seqstill maps to Last-Event-ID. The two modes are mutually exclusive when--seqwas explicitly passed (SeqProvided), including--seq=-1.kernel-go-sdkis bumped to v0.70.0 for theReplaystream param.api-keys getis updated to passAPIKeyGetParams{}on the newGetsignature. README documents the flag and bounded-buffer caveat. Tests cover param wiring and the mutual-exclusion error.Reviewed by Cursor Bugbot for commit ee9db08. Bugbot is set up for automated code reviews on this repo. Configure here.