Skip to content

fix(studio): show spans while trace details arrive - #1182

Merged
BrianNewsom merged 2 commits into
mainfrom
brnewsom/nmp-18-i-dont-have-permission-to-access-the-trace-associated-with
Aug 10, 2026
Merged

fix(studio): show spans while trace details arrive#1182
BrianNewsom merged 2 commits into
mainfrom
brnewsom/nmp-18-i-dont-have-permission-to-access-the-trace-associated-with

Conversation

@BrianNewsom

@BrianNewsom BrianNewsom commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Studio now renders activity already received for a session even when its trace details are not available yet. Previously, a direct trace link showed "Trace Not Found" and hid those spans; it now shows the available span tree with a brief informational banner, while genuinely missing traces still use the existing not-found view.

Changes

  • Build in-memory trace summaries for session spans whose trace is absent from the trace list response.
  • Keep the trace detail route loading until the span fallback has resolved, then render available activity, not-found, or request-error states accurately when the trace detail request returns 404.
  • Use the existing inline information banner pattern to explain that trace details are still arriving.
  • Add route coverage for both partial traces and genuinely missing traces.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with documentation updates
  • Documentation only
  • Contributor tooling or automation
  • CI, build, or test infrastructure

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Documentation updated for user-visible behavior
  • Documentation not applicable — justification: The change uses existing Studio behavior and explanatory UI copy; no user workflow or API changes.

Verification

  • Pull request title follows the repository's Conventional Commit format
  • Every commit includes an appropriate Signed-off-by: trailer
  • uv run pre-commit run -a passes, or any blocked checks are identified below
  • Targeted tests pass, or tests are marked not applicable above
  • No secrets, API keys, or credentials are included

Targeted validation:

  • pnpm --filter nemo-studio-ui test src/routes/IntakeSessionDetailRoute/index.test.tsx — 14 tests passed.
  • pnpm --filter nemo-studio-ui test:ci — 313 test files and 2,835 tests passed with coverage enabled.
  • pnpm --filter nemo-studio-ui typecheck — passed.
  • pnpm --filter nemo-studio-ui lint — passed.
  • pnpm --filter nemo-studio-ui format — passed.
  • uv run pre-commit run -a — all hooks passed.

Manual reproduction represented by the route regression test:

  1. Return no matching item from the session trace list and return 404 from the matching trace detail request.
  2. Return a session span with that trace ID and a parent span ID that has not been received.
  3. Open the session URL with that trace selected and verify the informational banner and received activity render instead of "Trace Not Found."
  4. Return no matching trace or spans and verify the existing "Trace Not Found" view still renders.
  5. Make the session span request fail and verify an error state renders instead of "Trace Not Found."

Summary by CodeRabbit

  • Improvements

    • Trace details now load progressively, displaying available summary information while full details are retrieved.
    • Added clearer messaging for traces that are still arriving, unavailable, or encounter activity-loading errors.
    • Session timelines now include traces inferred from received spans and sort them chronologically.
  • Tests

    • Added coverage for deep-linked traces, loading states, arriving traces, missing traces, and activity-loading failures.

Signed-off-by: Brian Newsom <brnewsom@nvidia.com>
@BrianNewsom
BrianNewsom requested review from a team as code owners August 7, 2026 19:57
@github-actions github-actions Bot added the fix label Aug 7, 2026
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The session detail flow now synthesizes missing trace summaries from spans and renders available activity when detailed trace data is loading or unavailable. Tests cover arriving activity, not-found, and activity-loading error states.

Changes

Trace summary fallback handling

Layer / File(s) Summary
Reconcile trace summaries
web/packages/studio/src/components/IntakeDetail/useSessionTrajectories.ts
Missing traces are synthesized from spans with unknown status and span counts. Trace summaries are sorted before span trees are built.
Render loading and partial trace states
web/packages/studio/src/components/IntakeDetail/SessionDetailView.tsx, web/packages/studio/src/components/IntakeDetail/TraceDetailView.tsx, web/packages/studio/src/routes/IntakeSessionDetailRoute/index.test.tsx
Summary status and errors are passed to TraceDetailView. The view distinguishes partial activity, summary errors, detailed 404 responses, and true not-found states. Tests cover these outcomes.

Sequence Diagram(s)

sequenceDiagram
  participant SessionDetailView
  participant TraceDetailView
  participant TraceSummary
  SessionDetailView->>TraceDetailView: pass trace summary status and error
  TraceDetailView->>TraceSummary: render available summary activity
  TraceSummary-->>TraceDetailView: provide summary data
  TraceDetailView-->>SessionDetailView: render loading, partial, error, or not-found state
Loading

Possibly related PRs

Suggested reviewers: shanaiabuggy, steramae-nvidia

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: showing spans while trace details are still loading.
✨ 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 brnewsom/nmp-18-i-dont-have-permission-to-access-the-trace-associated-with

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/packages/studio/src/components/IntakeDetail/SessionDetailView.tsx`:
- Line 183: Distinguish unresolved or failed span-summary requests from
successful empty summaries: in
web/packages/studio/src/components/IntakeDetail/SessionDetailView.tsx:183, pass
explicit summary resolution and error state into TraceDetailView; in
web/packages/studio/src/components/IntakeDetail/TraceDetailView.tsx:76-80,
render “Trace Not Found” only for a successfully resolved empty summary and
otherwise show loading or error state; add coverage for a 404 trace detail
combined with a failed span-summary request in
web/packages/studio/src/routes/IntakeSessionDetailRoute/index.test.tsx:443-478.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 277eafa3-9080-4ec4-bc35-72acd46355d9

📥 Commits

Reviewing files that changed from the base of the PR and between 6811a4e and 5c2c835.

📒 Files selected for processing (4)
  • web/packages/studio/src/components/IntakeDetail/SessionDetailView.tsx
  • web/packages/studio/src/components/IntakeDetail/TraceDetailView.tsx
  • web/packages/studio/src/components/IntakeDetail/useSessionTrajectories.ts
  • web/packages/studio/src/routes/IntakeSessionDetailRoute/index.test.tsx

Comment thread web/packages/studio/src/components/IntakeDetail/SessionDetailView.tsx Outdated
Signed-off-by: Brian Newsom <brnewsom@nvidia.com>
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 31626/40251 78.6% 63.2%
Integration Tests 18376/38186 48.1% 20.7%

@BrianNewsom
BrianNewsom added this pull request to the merge queue Aug 10, 2026
Merged via the queue into main with commit cd3f6f0 Aug 10, 2026
60 checks passed
@BrianNewsom
BrianNewsom deleted the brnewsom/nmp-18-i-dont-have-permission-to-access-the-trace-associated-with branch August 10, 2026 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants