Skip to content

feat(local): Add capture controls and telemetry investigation - #1509

Merged
MathurAditya724 merged 32 commits into
mainfrom
codex/local-session-switcher
Oct 26, 2026
Merged

MathurAditya724 merged 32 commits into
mainfrom
codex/local-session-switcher

Conversation

@MathurAditya724

@MathurAditya724 MathurAditya724 commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Local discovers capturing and saved sessions from a daemon's plain loopback stream address. The searchable picker keeps feeds isolated, refreshes as runs start or expire, and restores the selected capture after reload. Local commands print a viewer link using the actual bound port.

The viewer now supports investigation beyond raw payload inspection:

  • Capture controls: session/project context, capture state, connectivity, last received time and save deadline. Clear view, delete captured events, stop capture and disconnect have distinct scopes. Receiver switching probes the replacement before changing the feed; failed attempts preserve the current capture. Onboarding provides a copyable Local run command.
  • Errors and feedback: exception causes, captured source context and frame variables, breadcrumbs, request/context data, tags and modules. Absolute local source paths have VS Code links, and Copy for AI produces a Markdown summary. Modern feedback and legacy user reports link to their associated captured error.
  • AI inspection: standard GenAI and Vercel AI fields from embedded and standalone spans show model/provider, token usage, system instructions, messages, responses and tool arguments/results. Child AI steps stay connected to the interaction. Spans identified only by operation or origin remain visible when content was not captured.
  • Performance insights: queries and resources group exact operation/description pairs, sort by executions/duration/size, and open individual executions in their trace. Web Vitals compares captured measurements by page and visit, with explicit units and thresholds.
  • Profiles and diagnostics: legacy profiles and continuous chunks provide thread selection, inclusive/self function summaries, trace links and interactive flame, treemap and sunburst views. Timing and visualization limits are explicit. SDK inventory discovers name/version/platform metadata independently of client reports. Attachments preserve item headers and binary bytes, with text/JSON/raster-image/video previews and downloads; captured HTML and code remain inert. Download Blob URLs retain original MIME types only for allowlisted raster/video media.
  • Investigation controls: severity/logger facets, sorting and configurable event metadata; trace search, only-matches, branch collapse and adjustable tree width. Explicit event navigation reconciles active facets. Session-wide Cmd/Ctrl+K search stays independent of the view filter, resizable panes stack on narrow screens, and settings separates appearance from capture history capacity.

For development, pnpm --filter local sample posts nine bundled, sanitized example envelopes through the real receiver. It also replays a custom file or recursive fixture directory, including Spotlight's corpus, with endpoint selection, gzip/Brotli, intervals and repeated passes. Byte-counted fixtures preserve their original bytes on Windows checkouts. See the viewer and replay guide.

Discovery uses a separate capability restricted to loopback and trusted hosted Local origins; it grants neither ingestion nor CLI control. Scoped retention updates require the session stream capability. Hosted viewers cannot delete receiver data or stop captures, and remote HTTPS streams remain read-only. Older receivers connect without discovery; restarting an older daemon to upgrade clears its in-memory telemetry.

The span-v2 handling from Spotlight #1372 is adapted to Toolkit's viewer model, including container validation, typed HTTP attributes and late segment naming. Existing /live and /sdks routes remain compatible, and original envelopes remain inspectable.

Validation: all 322 viewer tests pass, including HTTP/SSE replay, analysis drill-down, binary attachments, filtered navigation, a 150,000-sample profile and Windows checkout regressions. Root typecheck and lint pass. The Local workflow exercises viewer integration and npm/native process E2E on Linux, macOS and Windows. The full local suite still encounters the known macOS musl-installer and DerivedData-scan failures; the unrelated issue-link cache race is unchanged.

The screenshots below show the capture/session flows:

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 6:24pm 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>
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
Add dedicated AI, error, profile, attachment, feedback and SDK inspection
alongside query, resource and Web Vitals analysis. Extend filtering and
trace navigation and replay raw SDK envelopes through the receiver for
repeatable UI verification.

Co-Authored-By: GPT-6 (Codex) <noreply@openai.com>
MathurAditya724 and others added 2 commits October 26, 2026 21:36
Disable line-ending conversion for byte-counted replay fixtures.
Exercise a real Git checkout with core.autocrlf=true to prevent corruption.

Co-Authored-By: GPT-6 (Codex) <noreply@openai.com>
Apply the same AI operation and origin classification to semantic
inspection and workspace routing, including spans without captured content.

Co-Authored-By: GPT-6 (Codex) <noreply@openai.com>
Allow the multi-view HTTP/SSE integration scenario 15 seconds on slower
Windows runners, preserving teardown before the next receiver test.

Co-Authored-By: GPT-6 (Codex) <noreply@openai.com>
Comment thread apps/local/src/lib/attachments.ts
Comment thread apps/local/fixtures/05-profile.txt
Comment thread apps/local/src/App.tsx
Comment thread apps/local/src/App.tsx Outdated
Comment thread apps/local/src/components/attachment-detail.tsx Outdated
Comment thread apps/local/src/components/profile-workspace.tsx Outdated
Comment thread apps/local/src/components/semantic-inspection.test.tsx
Comment thread apps/local/src/components/event-detail.tsx
@MathurAditya724 MathurAditya724 changed the title feat(local): Add session discovery and viewer controls feat(local): Add capture controls and telemetry investigation Oct 26, 2026
Restrict download MIME types and render attachments from raw SSE envelopes.
Preserve edited receiver ownership and lifecycle-aware SDK empty states.
Keep long profile and Web Vitals lists scrollable and avoid false empty details.

Cover attachment encoding and raw fixture boundaries with receiver regressions.

Co-Authored-By: GPT-6 (Codex) <noreply@openai.com>
@MathurAditya724
MathurAditya724 merged commit 1a92462 into main Oct 26, 2026
40 of 42 checks passed
@MathurAditya724
MathurAditya724 deleted the codex/local-session-switcher branch October 26, 2026 18:58

This branch was successfully deployed

1 active deployment
Preview — fbdbea3e 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