Skip to content

fix(console): keep live traces listed and drop empty payload cards in traces view - #515

Merged
sergiofilhowz merged 1 commit into
mainfrom
fix/traces-improvements
Jul 16, 2026
Merged

fix(console): keep live traces listed and drop empty payload cards in traces view#515
sergiofilhowz merged 1 commit into
mainfrom
fix/traces-improvements

Conversation

@sergiofilhowz

@sergiofilhowz sergiofilhowz commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Follow-ups to #504 from live testing: spans showing request/response · empty, live traces stalling mid-run, and a second prompt's thread missing from the list for a long time.

Problems

  1. Empty request/response on most spans — the span panel synthesizes a call card for any span that resolves a function id (ancestor walk / baggage), but the SDK attaches iii.payload.json events only to the invocation span itself, so nested plumbing and scope spans all rendered cards with two empty panes.
  2. Rows vanished mid-run — the list's span-filter verdicts recomputed from the all-spans feed on every pass. The feed retains ~2min, so during a long quiet stretch (one long LLM/tool call) a trace's visible bars pruned out while hidden bookkeeping spans kept it in the feed, flipping the row back to hidden until more work closed near completion.
  3. A new turn's row hid until its first visible span closed — turn traces root in the producer-hidden harness::turn dispatch group and worker spans only export on close, so early in a turn the feed holds nothing but hidden plumbing and the filter judged the whole trace hidden.
  4. No recovery from delivery gaps — a dropped trace-rows frame left a trace off the list until a full reseed, and the all-spans feed never re-seeded on tab-visible, leaving permanent holes after tab switches.

Solutions

  • functionCallFromSpan: spans that only inherit their identity render a card only when they actually captured data (payload events, tool.arguments, exception); invocation spans keep their card.
  • useSpanFilteredTraceRows: verdicts are monotone per selection (a visible verdict sticks — composition only grows); fetched verdicts never downgrade a visible one; live traces (pending snapshot in the feed, or a span end within 10s) are never hidden on a feed-only negative verdict.
  • useTraceData: span activity for unknown traces routes through the existing debounced trace_ids read and missing roots are backfilled into the list — a dropped row frame self-heals in ~1s.
  • useAllSpans: re-seed on tab-visible, mirroring the list's recovery.

Tests cover the card gate, monotone verdicts, the live exemption, and liveTraceIds.

Summary by CodeRabbit

  • Bug Fixes
    • Live traces now remain visible while spans are pending or have recently completed.
    • Trace verdicts no longer incorrectly downgrade during concurrent updates.
    • Trace tags refresh more reliably, including for newly discovered root spans.
    • Returning to a browser tab refreshes trace data to prevent stale spans.
    • Empty function-call cards are no longer shown for non-invocation spans.
  • Tests
    • Added coverage for live trace visibility, tag updates, verdict merging, and function-call rendering.

@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
workers Ready Ready Preview, Comment Jul 16, 2026 3:08pm
workers-tech-spec Ready Ready Preview, Comment Jul 16, 2026 3:08pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

skill-check — worker

0 verified, 44 skipped (no docs/).

Layer Result
structure
vale
ai
render

Four for four. Nicely done.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6b68ecd8-272a-437d-87f2-c49549156174

📥 Commits

Reviewing files that changed from the base of the PR and between 521ed49 and 2b91e56.

📒 Files selected for processing (6)
  • console/web/src/pages/TracesV2/hooks/useAllSpans.ts
  • console/web/src/pages/TracesV2/hooks/useSpanFilteredTraceRows.test.ts
  • console/web/src/pages/TracesV2/hooks/useSpanFilteredTraceRows.ts
  • console/web/src/pages/TracesV2/hooks/useTraceData.ts
  • console/web/src/pages/TracesV2/lib/functionCallFromSpan.test.ts
  • console/web/src/pages/TracesV2/lib/functionCallFromSpan.ts

📝 Walkthrough

Walkthrough

The changes improve trace visibility during live activity, refresh missing trace tags and roots, reseed spans after hidden-tab intervals, and suppress empty function-call cards from inherited identity-only spans.

Changes

Trace resilience and rendering

Layer / File(s) Summary
Live trace visibility and verdict merging
console/web/src/pages/TracesV2/hooks/useSpanFilteredTraceRows.ts, console/web/src/pages/TracesV2/hooks/useSpanFilteredTraceRows.test.ts
Live and recently ended traces remain visible, while existing positive verdicts are preserved during merged reads.
Trace tag refresh and root backfill
console/web/src/pages/TracesV2/hooks/useTraceData.ts
Debounced trace refreshes update tags, backfill missing roots, adjust totals, and process activity for uncached trace IDs.
Visible-tab span reseeding
console/web/src/pages/TracesV2/hooks/useAllSpans.ts
Visible-tab transitions trigger reseeding when active, with listener cleanup during disposal.
Function-call card filtering
console/web/src/pages/TracesV2/lib/functionCallFromSpan.ts, console/web/src/pages/TracesV2/lib/functionCallFromSpan.test.ts
Identity-only spans without payloads return no card, while payload, error, and genuine invocation cases continue to render.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • iii-hq/workers#504: Updates related trace-row visibility and verdict reconciliation logic.

Poem

I’m a bunny watching traces flow,
Live little spans now stay aglow.
Lost roots hop back, tags bloom bright,
Empty call cards vanish from sight—
A tidy burrow, day and night!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main UI fixes: preserving live traces and suppressing empty payload cards in the traces view.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/traces-improvements

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sergiofilhowz
sergiofilhowz merged commit 98499d0 into main Jul 16, 2026
13 of 15 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Jul 20, 2026
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