Repository navigation
feat(local): Add daemon-managed telemetry sessions and viewer - #1492
Conversation
Port getsentry/cli#1578 to Toolkit with scoped capabilities, portable daemon lifecycle, and native/npm E2E coverage. Co-Authored-By: GPT-6 Codex <noreply@openai.com>
|
Validation of the migrated feature:
The complete workspace test command was run in UTC with isolated temporary storage and four workers. Its CLI result was 10,644 passed, 14 existing skips, and two failures:
These existing test-isolation failures are documented rather than changed, as requested. The installer and debug-files tests have no changes in this PR. Linux, macOS and Windows npm/native Local coverage is configured in the new Local E2E workflow. The existing Local hosting project also needs to point to Toolkit with |
|
Hosted Local E2E passed on Linux, macOS, and Windows at commit 82cacca. Each platform ran viewer integration tests plus the Local process suite against both the npm bundle and a freshly built native CLI. Typecheck, lint, and docs checks also passed after rebasing onto current main. The original getsentry/cli#1578 draft is now closed as superseded. |
…URLs Carry the ingest token in the pathname for Spotlight SDK transports that omit URL query parameters. Preserve scoped read URLs and legacy ingestion, cover real SDK capture, and scrub Local capabilities at telemetry delivery. Co-Authored-By: GPT-6 Codex <noreply@openai.com>
|
Validation for
The full workspace test gate retains exactly two existing macOS-dependent failures, with 10,653 CLI tests passing and 14 skipped: the musl installer case does not simulate Linux, and the DerivedData case scans the host Xcode directory and times out. The user requested that this PR remain scoped to Local, so those unrelated test files are unchanged. Other tested workspace packages pass. The actual Node SDK regression exposed transports dropping query parameters; the ingest capability now lives in the pathname. Scoped capability URLs are also redacted at final CLI telemetry delivery. Fresh Linux/macOS/Windows npm and native E2E checks are running on this head. BYK is requested for review; the PR is now ready for review. |
|
Hosted readiness update for The PR risk (Jev) check failed with Warden and the broad CLI test job are still running. BYK has not yet reviewed. The PR should not be merged with these gates unresolved. Unrelated workflow/provider changes remain outside this Local migration. |
|
Final platform validation at The independent review has no remaining actionable findings and this PR has no unresolved review threads. Merge readiness is still blocked: PR risk (Jev) failed with a non-retryable provider HTTP 400, Warden and the broad CLI check remain in progress, and BYK review is requested but not yet submitted. The two documented local macOS baseline failures remain unchanged as requested. |
Protect both ingest routes, keep live and replacement discovery intact, wait through listen retries, and clean up failed startup. Keep viewer selection, search, JSON and receiver state consistent, and guide legacy commands when the managed daemon owns their port. Integrate current main and verify scoped regressions, browser behavior, full npm E2E and native Local E2E. Existing macOS installer/DerivedData test failures remain documented outside this migration. Co-Authored-By: GPT-6 Codex <noreply@openai.com>
|
Validation of the review fixes at
Current main was integrated without force-pushing; the PR diff remains scoped to Local and its documentation/tests. Fresh Linux/macOS/Windows npm/native checks are running on this head. PR-risk provider failures remain an external gate to track, not a reason to weaken checks. Vercel setup is explicitly deferred. A monitor checks this PR every 30 minutes and reports meaningful changes or confirmed merge readiness; it does not merge the PR. |
Reset shared query queues between browser integration tests and wait for the asynchronous search URL update before asserting it. Co-Authored-By: GPT-6 Codex <noreply@openai.com>
|
Published the Local-only Windows CI correction in Windows exposed an integration-test race: Nuqs updates React state before writing the URL, and its shared pending query queue can survive a test unmount. The test now waits for the same
All eight existing Warden threads remain resolved. PR-risk on |
Keep search available for retained telemetry after disconnect or session close and show search-specific empty trace results. Accept multi-word session names in telemetry view commands consistently with the sibling management commands. Co-Authored-By: GPT-6 Codex <noreply@openai.com>
|
Final Local review fixes are published in All three new Warden findings were reproduced with regressions, fixed, replied to and resolved. Search now remains available after disconnect/session close, including raw-only retained envelopes. Empty trace searches use the shared search empty state. Event/envelope view accepts quoted and split multi-word session names while rejecting missing item IDs. Independent review found no remaining actionable issue in these changes. All 11 review threads are resolved. Validation after the final review fixes:
The prior head |
Serialize ownership claim, recovery and release under a shared guard. Bound stop requests and wait for shutdown before restarting. Preserve duplicate-name guidance and redact the scoped SSE endpoint in diagnostics. Co-Authored-By: GPT-6 Codex <noreply@openai.com>
|
Published the final Local lifecycle review fixes in All four new Warden findings were reproduced, fixed, replied to and resolved. Restart now bounds a hung stop POST, rejects a failed stop, waits through the live-but-unresponsive shutdown window, and reports a timeout instead of returning the old daemon as a successful restart. Ownership creation, stale recovery and release share an exclusive guard; interrupted guards remain in place with explicit cleanup guidance. Ambiguous session names return HTTP409 with ID guidance that the CLI preserves. Initial SSE attach warnings show the scoped endpoint with its capability redacted. Independent review approved the final changes and independently exercised three concurrent process claims against stale ownership: exactly one owner succeeded, and release left no ownership files. The guard is deliberately not recovered by automatic unlink after an interrupted critical section; callers must confirm the owning process has stopped before removing the reported guard. Validation of the published code:
Current main |
Co-Authored-By: GPT-6 Codex <noreply@openai.com>
Use each span's own metadata and SDK status for waterfall failures. Match AI namespace components, resolve item-level event IDs, and show the receiver picker for empty closed sessions. Co-Authored-By: GPT-6 Codex <noreply@openai.com>
|
Final full-PR audit and cleanup published in The independent review found receiver-action races and trace-size failures. All were reproduced before fixes and are now covered by regressions:
Removed unreachable ThemeToggle and Card components, unused appendBounded and SESSION_BUFFER_SIZE, and the obsolete item-based telemetry append path. Index/replay tests now exercise the actual envelope API. Shared browser-safe loopback policy and default retention values replace duplicated implementations; the run BUFFER_SIZE export remains because setup verification uses it. A final independent review approved the fixes and cleanup with no remaining actionable findings. Validation:
Fresh exact-head status: Linux/macOS/Windows Local viewer/npm/native E2E are all green on 8b2fb17. Warden is still running; current review threads are all resolved. Required aggregate test is awaiting the CLI job. PR-risk run 38644059547 failed on this exact head. Its artifact confirms provider_error / GatewayInternalServerError HTTP400 with retryable:false; it produced no risk classification. This external failure remains outside Local scope and checks have not been weakened. The user authorizes squash merge only after final review and exact-head gates are satisfied; this revision has not been merged. Vercel remains deferred. |
Share connection flags, session references and control output configuration. Use focused builders for session queries and event/envelope lookup while preserving help, argument parsing, errors and daemon lifecycle behavior. Co-Authored-By: GPT-6 Codex <noreply@openai.com>
Add receiver/session limits and runtime controls that preserve retained envelopes and active streams. Reject unsafe decreases, follow ordered settings in the viewer, and clear stale decode alerts with the feed. Co-Authored-By: GPT-6 Codex <noreply@openai.com>
Claim ownership immediately after verified stale-file removal or disappearance, including on the final recovery attempt. Preserve the incomplete-owner grace period, replacement/live ownership checks and bounded retries. Co-Authored-By: GPT-6 Codex <noreply@openai.com>
Wait for authenticated discovery when a foreground owner is still binding. A competing child exiting must not abort attachment to the winning daemon. Cover pre-existing and late ownership with regressions and real CLI E2E. Co-Authored-By: GPT-6 Codex <noreply@openai.com>
Validate --session with --verify before resolving or starting a command. Co-Authored-By: GPT-6 Codex <noreply@openai.com>
Share bounded stop/restart handling and prune expired sessions before creation. Co-Authored-By: GPT-6 Codex <noreply@openai.com>
Prevent stale receiver actions from mutating later connections. Calculate trace timing and traverse spans without repeated scans or recursion. Remove unused viewer code and share loopback policy and retention defaults. Co-Authored-By: GPT-6 Codex <noreply@openai.com>
Add isolated Sentry Local telemetry sessions owned by a loopback daemon.
local run --session <name>andlocal serve --session <name>retain captured data after their foreground lease ends; session, event, envelope, and daemon commands let developers and agents inspect it later. Each session has separate ingest/read capabilities and retains data for three hours after close and subsequent ingestion.Move the browser viewer into
apps/localso the complete feature lives in Toolkit. Receivers default to 500 envelopes;--max-envelopeson create/run/serve andlocal session retentionconfigure limits from 1 to 50,000. Connected loopback-served viewers can change retention, reset, or close their scoped session; hosted viewers remain read-only. Growth preserves envelope IDs, decoded items, and active streams. Decreases below the retained count are rejected without changing data. The viewer follows CLI updates, preserves malformed raw envelopes for inspection, and keeps retained search available after disconnection. Connecting the Vercel Local project to Toolkit is deferred.The daemon authenticates discovery, enforces singleton ownership without deleting replacement metadata, waits through listener retries, and preserves SDK compression and stream compatibility. Plain commands guide users to
--sessionwhen a daemon owns their port. Both ingest routes reject remote browser writes, and capability URLs are scrubbed from diagnostics and outgoing CLI telemetry. Process E2E coverage includes real Sentry Node SDK capture, concurrent startup, scoped telemetry, retention changes, foreground leases, restart, and shutdown; Local CI runs npm/native cases on Linux, macOS, and Windows.Supersedes getsentry/cli#1578.
The full local workspace gate still fails the existing macOS musl-installer and DerivedData-scanner tests. They remain outside this Local migration. Fresh validation and hosted platform results are recorded in the PR's review evidence comment.