Skip to content

feat(local): Add session discovery and viewer controls - #1509

Open
MathurAditya724 wants to merge 27 commits into
mainfrom
codex/local-session-switcher
Open

MathurAditya724 wants to merge 27 commits into
mainfrom
codex/local-session-switcher

Conversation

@MathurAditya724

@MathurAditya724 MathurAditya724 commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Connect Local to a daemon's plain http://127.0.0.1:<port>/stream address to discover capturing and saved sessions. The searchable picker keeps feeds isolated, refreshes as runs start or expire, and restores the selected capture after reload. Human-readable Local commands print a hosted viewer link using the actual bound port; JSON output stays unchanged.

The workspace explains capture state and the scope of each action:

  • Capture context shows the selected session/project, Capturing or Saved capture, receiver connectivity, last received time, and the receiver's original save deadline when supplied. Expired captures keep already displayed events readable.
  • Clear view affects this tab only and keeps ingestion running. Delete captured events requires confirmation and deletes receiver history when the existing loopback permissions allow it. Reload stays disabled while receiver deletion is pending. Stop capture rejects later ingestion with HTTP 410 and saves a finite archive. Disconnect viewer leaves capture and receiver history intact.
  • Switch receiver probes the replacement before changing the feed. Failed or cancelled attempts preserve existing events. Reload restores the tab’s successful receiver choice; choosing a local receiver supersedes that tab’s earlier remote choice. Past connections keep five successful receivers per tab, omitting displayed credentials and local session capabilities.
  • Capture-first onboarding offers a copyable sentry local run --session web --open -- <your dev command> example, with connecting to an existing receiver as a secondary flow.
  • Event inspection shows log messages/attributes, exception causes and stack frames, compact request summaries, and related telemetry. Diagnostic types open directly in original JSON.
  • Span investigation opens a selected waterfall span's timing, attributes, original payload, and related errors/logs in the inspector. Back to trace restores focus to that span, drill-down preserves the active Traces filter, and event/trace/span selection works with URL history.
  • Resizable panes support pointer and keyboard adjustment, preserve inspector space, and stack on narrow screens. Descriptions wrap and code, IDs, and timing use monospace.
  • Navigation and search emphasize Events, Traces, Errors, Logs, and AI, with secondary views under Diagnostics. SDK reports distinguishes SDK reports from named Local captures. Search this session (Cmd/Ctrl+K) stays independent of the labelled view filter; filtering is explicit and has a Clear filter action. Existing /live and /sdks routes remain compatible.
  • Settings separates app-wide appearance from History capacity for the selected capture. Capacity is measured in SDK envelope batches and is independent of the saved-capture deadline. Both client and receiver reject limits outside 1–50,000 or decreases that would discard retained envelopes.

Discovery uses a separate capability restricted to loopback and trusted hosted Local origins. Scoped retention updates require the session stream capability; discovery grants neither ingestion nor CLI control. Hosted viewers can update validated retention and clear their own view, but cannot delete receiver data or stop captures. Remote HTTPS streams stay read-only. Older receivers can connect without discovery; upgrading older daemons requires a restart, which clears their in-memory telemetry. This PR has not been deployed to production.

The span-v2 handling from Spotlight #1372 is adapted to Toolkit's viewer model, including supported-container validation, typed HTTP attributes, and late segment naming. Raw payloads remain available.

Validation: 278 viewer tests and all 27 real Local CLI process E2E tests pass. Root typecheck and lint pass. Known unrelated local failures are musl installer detection, the DerivedData scan timeout, and an existing issue-link response-cache race under coverage (11,399 CLI unit tests pass). The cache failure also reproduces on the pre-UI commit; its 63-test file passes without coverage. These local gate exceptions were explicitly approved; the cache implementation is unchanged. Regressions cover permission boundaries, confirmed deletion/cancellation, finite replay, frozen expiry, receiver switching, independent filters, span navigation/focus, resizing, and repeated parent refreshes. The Local workflow also runs npm/native process E2E on Linux, macOS, and Windows.

Location Screenshot
Local › Capture onboarding Capture-first onboarding
Local › Session picker, capturing and saved Capturing and saved session picker
Local › Events, request inspector Request inspector and capture context
Local › Logs, structured details Structured log inspection
Local › Traces, selected span Selected span inspector
Local › Traces, narrow viewport Mobile trace waterfall
Local › Saved capture, empty traces Saved capture empty state and deadline
Local › Search this session, explicit view filter Session search with explicit view filter
Local › Switch receiver Switch receiver preserves the current feed
Local › Capture actions, delete confirmation Confirmed deletion scope on mobile
Local › Settings, narrow viewport Appearance and capture-scoped capacity

Discover running and retained sessions through a separate browser capability and switch isolated feeds in local and hosted viewers.

Co-Authored-By: GPT-6 Codex <noreply@openai.com>
@vercel

vercel Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sentry-local Ready Ready Preview Oct 26, 2026 1:39pm UTC

Request Review

Use the existing shadcn Command and Button components with a Radix popover, keep session paths in the menu, and constrain the workspace width.

Co-Authored-By: GPT-6 Codex <noreply@openai.com>
Use full-width labeled buttons and separate closing a session from clearing events.

Co-Authored-By: GPT-6 Codex <noreply@openai.com>
Give Change receiver a full button and retain accessible icon controls for clearing events and closing sessions.

Co-Authored-By: GPT-6 Codex <noreply@openai.com>
Let Change fill the available space beside fixed-size Clear and Close icon buttons.

Co-Authored-By: GPT-6 Codex <noreply@openai.com>
Comment thread apps/local/src/App.tsx
Move retention into validated sidebar settings and add tooltips to receiver actions. Preserve discovery across reloads and same-port daemon restarts.

Co-Authored-By: GPT-6 Codex <noreply@openai.com>
Point human Local output at the hosted viewer with the actual loopback port. Accept plain receiver query links and consume them after pairing so reloads preserve the selected session without exposing capabilities or changing JSON output.

Co-Authored-By: GPT-6 Codex <noreply@openai.com>
Offer Light, Dark, and System themes through the existing viewer theme provider. Persist the preference without reconnecting the receiver and cover the Settings flow with an integration regression.

Co-Authored-By: GPT-6 Codex <noreply@openai.com>
Use a dismissible Add receiver modal with a shared connection form and tab-scoped history.
Probe replacement streams before switching, preserve retained-session context, and guard
cancelled or stale lifecycle actions. Keep Settings accessible on the landing and cover
modal, history, replay, and session-state transitions with regressions.

Co-Authored-By: GPT-6 Codex <noreply@openai.com>
Close old SSE and probe sockets explicitly after stopping each test server.
This avoids Node 22 keep-alive delays exhausting the history test timeout on CI.

Co-Authored-By: GPT-6 Codex <noreply@openai.com>
Separate retained envelopes from the editable limit and preserve visible capacity in read-only viewers.

Co-Authored-By: GPT-6 Codex <noreply@openai.com>
Comment thread apps/local/src/App.tsx
Merge main after PR #1503, reuse the CLI brand asset, simplify receiver copy, and make event and trace inspection usable on narrow screens.

Use the shared Settings dialog from mobile receiver actions and cover focus handoff, retention bounds, and live system-theme changes.

Co-Authored-By: GPT-6 Codex <noreply@openai.com>
@MathurAditya724 MathurAditya724 changed the title feat(local): Add browser session switching feat(local): Add session discovery and viewer controls Oct 15, 2026
Clear a failed landing attempt when its endpoint changes. Preserve the disconnected feed error while a replacement is edited in the modal.

Co-Authored-By: GPT-6 Codex <noreply@openai.com>
Freeze closed sessions, replay finite archives, notify every reader on reset and close, and provide explicit disconnection without deleting capture data. Keep the workspace stable during clears and guard stale deliveries.

Co-Authored-By: GPT-6 Codex <noreply@openai.com>
Use the existing React Hook Form and Valibot form on trusted hosted Local origins. Permit only retention updates, preserve session capabilities and origin checks, and reject values that would discard retained envelopes.

Co-Authored-By: GPT-6 Codex <noreply@openai.com>
Comment thread apps/local/src/App.tsx Outdated
Evict the least recently used receiver when adding another and trim existing oversized history on load and save.

Co-Authored-By: GPT-6 Codex <noreply@openai.com>
Gate Settings on the known closed session instead of transient SSE connection status. Cover replay connection, open and completion in a regression test.

Co-Authored-By: GPT-6 Codex <noreply@openai.com>
Comment thread apps/local/src/App.tsx
Comment thread apps/local/src/lib/connection-history.ts
Offer an enabled reconnect action after failed clears, including clears during a pending reconnect. Reuse startup URL validation so ignored links cannot reconnect a disconnected tab to a saved receiver.

Co-Authored-By: GPT-6 Codex <noreply@openai.com>
Preserve session discovery and hosted retention controls alongside upstream promise-handling and envelope-ID fixes.

Refs #1509

Co-Authored-By: GPT-6 (Codex) <noreply@openai.com>
Reject foreign daemon authorities and finish CLI tails after retained replay.

Preserve final viewer events and explicit reconnections, and validate streamed spans with segment names and typed HTTP metadata.

Refs #1509

Co-Authored-By: GPT-6 (Codex) <noreply@openai.com>
Comment thread apps/local/src/App.sessions.integration.test.tsx
Exercise a delayed real POST and wait for submission completion.
Assert retained data after the receiver commits the new limit.

Refs #1509

Co-Authored-By: GPT-6 (Codex) <noreply@openai.com>
Separate tab-only clearing from confirmed receiver deletion.

Show capture lifecycle and scope, and provide event and span inspectors with resizable panes.

Add explicit view filters, diagnostics, onboarding, and lifecycle and accessibility regressions.

Co-Authored-By: GPT-6 (Codex) <noreply@openai.com>
Comment thread apps/local/src/App.integration.test.tsx
Comment thread apps/local/src/App.tsx
Comment thread apps/local/src/App.tsx
Comment thread apps/local/src/components/trace-workspace.tsx Outdated
Seed retained envelopes with bounded HTTP concurrency and query only the settings dialog.

Keep real replay and mutation coverage without starving CI request deadlines.

Co-Authored-By: GPT-6 (Codex) <noreply@openai.com>
Restore this tab's receiver choice, block reload during deletion, and preserve trace filters.

Ignore stale span selections on fallback traces and cover each transition with regressions.

Co-Authored-By: GPT-6 (Codex) <noreply@openai.com>
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Oct 26, 2026
@github-actions github-actions Bot removed the risk: medium PR risk score: medium label Oct 26, 2026

This branch was successfully deployed

1 active deployment
Preview — d5e5863e Deployed Oct 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant