Skip to content

feat(observability): durable metric history, trend charts & trace exemplars - #158

Merged
prisis merged 4 commits into
alphafrom
feat/observability-monitoring
Jul 22, 2026
Merged

prisis merged 4 commits into
alphafrom
feat/observability-monitoring

Conversation

@prisis

@prisis prisis commented Jul 21, 2026 •

Copy link
Copy Markdown
Member

Builds on the now-merged #149 (ctx.trace + ctx.metrics). Adds the durable/trend tier for ctx.metrics, rebased onto latest alpha.

What's in it

  • Durable metric history — a reserved SQLite table of per-minute ctx.metrics rollups on the ShardDO (mirrors function-metrics.ts: bounded retention, distinct-series cap, read clamp), surviving hibernation. New getMetricHistory admin RPC.
  • Trace exemplars — every measurement is stamped with the recording dispatch's trace id (shard-owned); it rides onto the live buffer series and each history bucket.
  • Studio — the Instruments table gains a Trend sparkline (from the durable history) and a Trace exemplar link that deep-links the Traces panel (one-shot sessionStorage handoff; filterTraces now matches traceId).

Notes

🤖 Generated with Claude Code

https://claude.ai/code/session_019M6G6CAoLVrQMxDYg7BWq2

Summary by CodeRabbit

  • New Features
    • Added durable per-minute metric history to power trend charts across sessions.
    • Added “trend” and “trace” columns to the Instruments table with sparklines and exemplar trace links.
    • Selecting a trace from Metrics now opens the Traces panel with the trace filter applied.
  • Improvements
    • Trace search now matches full trace IDs (case-insensitive substring).
    • Metric exemplars now support drill-down from trends to the corresponding trace, when available.
  • Improvements
    • Trend rendering is more resilient when history data is missing or incomplete.

@netlify

netlify Bot commented Jul 21, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for lunorash ready!

Name Link
🔨 Latest commit 917413a
🔍 Latest deploy log https://app.netlify.com/projects/lunorash/deploys/6a60d84673e14900083d829f
😎 Deploy Preview https://deploy-preview-158--lunorash.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

@coderabbitai

coderabbitai Bot commented Jul 21, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2a2f7567-0a16-4007-bb84-1e534c0d053d

📥 Commits

Reviewing files that changed from the base of the PR and between c976284 and 917413a.

⛔ Files ignored due to path filters (11)
  • api-snapshots/do.api.md is excluded by none and included by none
  • api-snapshots/runtime.api.md is excluded by none and included by none
  • api-snapshots/studio.api.md is excluded by none and included by none
  • packages/do/__tests__/metric-buffer.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/do/__tests__/metric-history.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/do/__tests__/shard-do.admin.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/do/__tests__/tracing.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/studio/__tests__/app/studio.test.tsx is excluded by !**/__tests__/** and included by packages/**
  • packages/studio/__tests__/features/reports/instruments-table.test.tsx is excluded by !**/__tests__/** and included by packages/**
  • packages/studio/__tests__/features/traces/traces-panel.test.tsx is excluded by !**/__tests__/** and included by packages/**
  • shared/metric-event.ts is excluded by none and included by none
📒 Files selected for processing (13)
  • apps/studio/src/mock/dev-client.ts
  • packages/do/src/introspect.ts
  • packages/do/src/metric-buffer.ts
  • packages/do/src/metric-history.ts
  • packages/do/src/shard-do.ts
  • packages/studio/src/features/reports/instrument-format.ts
  • packages/studio/src/features/reports/instruments-table.tsx
  • packages/studio/src/features/reports/metrics-panel.tsx
  • packages/studio/src/features/traces/trace-geometry.ts
  • packages/studio/src/features/traces/traces-panel.tsx
  • packages/studio/src/lib/admin.ts
  • packages/studio/src/lib/trace-handoff.ts
  • packages/studio/src/locales/en.ts

Walkthrough

Metrics gain durable per-minute history and exemplar trace IDs. The Studio Instruments table displays sparklines and trace links, while navigation hands selected exemplars to the Traces panel for filtering.

Changes

Metrics observability flow

Layer / File(s) Summary
Metric contracts and exemplar aggregation
packages/do/src/metric-buffer.ts, packages/do/src/introspect.ts, packages/studio/src/lib/admin.ts
Metric series retain exemplar trace IDs, use an exported canonical key helper, and expose metric-history RPC and wire contracts.
Durable metric history pipeline
packages/do/src/metric-history.ts, packages/do/src/shard-do.ts
Metric events are persisted as bounded per-minute SQLite buckets and returned through the admin history RPC.
Studio trends and exemplar rendering
packages/studio/src/features/reports/..., apps/studio/src/mock/dev-client.ts, packages/studio/src/locales/en.ts
Studio joins live series to history, projects values by metric kind, renders sparklines and exemplar traces, and supplies deterministic mock history data.
Exemplar trace navigation
packages/studio/src/features/reports/metrics-panel.tsx, packages/studio/src/lib/trace-handoff.ts, packages/studio/src/features/traces/...
Selected exemplars are handed to the Traces panel through session storage, consumed on initialization, and matched by full trace ID.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant MetricsPanel
  participant InstrumentsTable
  participant ShardDO
  participant MetricHistory
  participant TracesPanel
  MetricsPanel->>InstrumentsTable: Load metric series and history
  InstrumentsTable->>ShardDO: getMetricSeries and getMetricHistory
  ShardDO->>MetricHistory: Read durable metric buckets
  MetricHistory-->>InstrumentsTable: Return trend points and exemplars
  InstrumentsTable->>MetricsPanel: Open exemplar trace
  MetricsPanel->>TracesPanel: Persist trace filter and navigate
  TracesPanel->>TracesPanel: Consume filter and match trace ID
Loading

Possibly related PRs

  • anolilab/lunora#149: Adds related tracing, metrics plumbing, and shard admin telemetry used by this RPC and exemplar flow.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the feature at a high level, but it does not follow the required template and omits Summary, Linked issues, Test plan, Checklist, and CLA sections. Reformat it to the repo template and add the missing Summary, linked issues, test plan, checklist items, reviewer notes, and CLA statement.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise, conventional-commit style, and matches the main change: durable metric history with trend charts and trace exemplars.
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.
✨ 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 feat/observability-monitoring

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.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for confirming the Contributor License Agreement! 🙏

@github-actions

github-actions Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit 917413a.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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 `@apps/studio/src/mock/dev-client.ts`:
- Around line 300-312: Update the historyPoints helper so generated histogram
buckets have a meaningful mean by ensuring sum differs from count, preferably
calculating sum as the generated mean value multiplied by count (or setting
count to 1). Preserve the existing trend generation and bucket fields while
making checkout.ms pointValue("histogram", point) reflect the intended varying
trend.

In `@packages/studio/src/features/reports/metrics-panel.tsx`:
- Around line 126-135: Update openTrace to persist a one-shot payload containing
both traceId and the selected debouncedShard, rather than only the trace ID.
Ensure the Traces panel handoff consumes this payload to initialize both the
trace filter and shard state before querying, while preserving the existing
navigation fallback behavior.
🪄 Autofix (Beta)

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: Pro

Run ID: fe340d50-d55d-4b3e-9c04-2bab0589bcc9

📥 Commits

Reviewing files that changed from the base of the PR and between f073c2a and 18cff06.

⛔ Files ignored due to path filters (7)
  • packages/do/__tests__/metric-buffer.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/do/__tests__/metric-history.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/do/__tests__/shard-do.admin.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/do/__tests__/tracing.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/studio/__tests__/app/studio.test.tsx is excluded by !**/__tests__/** and included by packages/**
  • packages/studio/__tests__/features/reports/instruments-table.test.tsx is excluded by !**/__tests__/** and included by packages/**
  • shared/metric-event.ts is excluded by none and included by none
📒 Files selected for processing (12)
  • apps/studio/src/mock/dev-client.ts
  • packages/do/src/introspect.ts
  • packages/do/src/metric-buffer.ts
  • packages/do/src/metric-history.ts
  • packages/do/src/shard-do.ts
  • packages/studio/src/features/reports/instrument-format.ts
  • packages/studio/src/features/reports/instruments-table.tsx
  • packages/studio/src/features/reports/metrics-panel.tsx
  • packages/studio/src/features/traces/trace-geometry.ts
  • packages/studio/src/features/traces/traces-panel.tsx
  • packages/studio/src/lib/admin.ts
  • packages/studio/src/locales/en.ts

Comment thread apps/studio/src/mock/dev-client.ts Resolved
@codspeed

codspeed Bot commented Jul 21, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 10.3%

⚡ 2 improved benchmarks
✅ 158 untouched benchmarks
⏩ 1 skipped benchmark1

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ baseline (Object.keys + toInternal + path spread per field) 72 µs 65.2 µs +10.42%
⚡ hit: cache.run returns memoized result 73.2 µs 66.4 µs +10.18%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing feat/observability-monitoring (917413a) with alpha (0804b38)2

Open in CodSpeed

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports. ↩

  2. No successful run was found on alpha (8ebe128) during the generation of this report, so 0804b38 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@prisis

prisis commented Jul 21, 2026

Copy link
Copy Markdown
Member Author

Pushed fixes for all review comments:

  • React Doctor (sessionStorage in render, traces-panel): the exemplar hand-off is now read in a useEffect on mount, not the useState initializer.
  • CodeRabbit — carry the shard (Major): openTrace now stashes { traceId, shardKey }; the Traces panel seeds both its search and its shard on mount, so an exemplar from a non-root shard opens the right ring. Covered by a new test.
  • CodeRabbit — flat histogram mock (Minor): historyPoints is now kind-aware (sum = value * count for histograms) so checkout.ms trends non-flat.
  • Also rebased onto latest alpha (resolved the conflict) and regenerated api-snapshots.

@prisis
prisis force-pushed the feat/observability-monitoring branch from 18cff06 to 79a85b3 Compare July 21, 2026 18:49
@prisis
prisis force-pushed the feat/observability-monitoring branch from 79a85b3 to 9b47743 Compare July 21, 2026 18:59
@prisis

prisis commented Jul 21, 2026

Copy link
Copy Markdown
Member Author

Ran a two-pass thermo review on the rebased branch and applied all findings:

Code quality

  • Structural (blocker): moved the exemplar sessionStorage hand-off out of the pure trace-geometry.ts into a new lib/trace-handoff.ts built on the existing guarded lib/browser-storage accessors (a sibling of lib/shard-history.ts). trace-geometry is pure again and metrics-panel no longer imports a geometry module.
  • DRY: collapsed pointValue/metricHeadline into one projectByKind so a series' headline and its sparkline point provably agree.

Correctness

  • Medium (hot-path write cost): recordMetricHistory now fast-paths the in-minute repeat — an existing (series, minute) bucket costs one point-lookup + upsert, and the distinct-series cap scan + retention trim run only when a new bucket appears (≈ once per series per minute). Documented that a tight metrics loop should still pre-aggregate.
  • Low: readPendingTraceFilter now type-checks shardKey too, so a tampered non-string can't reach the panel and crash .trim().

Reviewers independently confirmed the three earlier review items are resolved, wire contracts are in lockstep, and exemplar trace ids are server-stamped only (not caller-injectable). Local: do 1163, studio 787, typecheck + api:check clean.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
packages/agent/src/telemetry/otlp.ts (2)

14-16: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Correct the endpoint contract.

The docs describe endpoint as a /v1 base, but line 113 appends /v1/traces; a documented value ending in /v1 becomes /v1/v1/traces. Document an origin/base without /v1, or change construction to append only /traces.

🤖 Prompt for 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.

In `@packages/agent/src/telemetry/otlp.ts` around lines 14 - 16, Correct the
endpoint contract in the OTLP configuration documentation and construction logic
so they agree: either document endpoint as an origin without /v1 while retaining
the /v1/traces construction, or treat it as a /v1 base and append only /traces.
Ensure trailing slashes remain tolerated and prevent duplicated /v1 segments.

64-66: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Prevent input serialization from rejecting the observer.

JSON.stringify throws for circular values and BigInt. With input recording enabled, the success handler falls into its rejection handler, which serializes the same input again and can leave observed rejected—contrary to the intended swallowed background failures. Skip unserializable attributes.

Proposed fix
-    attributes.push(encodeAttribute(key, JSON.stringify(value)));
+    try {
+        const serialized = JSON.stringify(value);
+
+        if (serialized !== undefined) {
+            attributes.push(encodeAttribute(key, serialized));
+        }
+    } catch {
+        // Omit values such as circular objects and BigInt.
+    }
🤖 Prompt for 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.

In `@packages/agent/src/telemetry/otlp.ts` around lines 64 - 66, Update the
attribute serialization flow around encodeAttribute so JSON.stringify failures
for circular values or BigInt are caught and the affected attribute is skipped.
Ensure these input-serialization errors do not propagate into the observer’s
success or rejection handling, while preserving serialization for supported
objects and arrays.
🤖 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 `@packages/agent/src/telemetry/otlp.ts`:
- Line 199: Guard the optional waitUntil?.(observed) calls in the wrapper paths
around execute() and the corresponding second occurrence so any injected
waitUntil exception is caught and does not alter or replace the original
operation promise. Match the error-isolation behavior already used inside
emitSpan.

In `@packages/studio/src/features/traces/traces-panel.tsx`:
- Around line 210-218: Move the readPendingTraceFilter call out of the lazy
useState initializer and into a committed mount boundary such as a one-time
effect. After reading the pending handoff, update shardKey and search from its
shardKey and traceId values, while preserving initialShardKey and empty-string
fallbacks when no pending filter exists.

---

Outside diff comments:
In `@packages/agent/src/telemetry/otlp.ts`:
- Around line 14-16: Correct the endpoint contract in the OTLP configuration
documentation and construction logic so they agree: either document endpoint as
an origin without /v1 while retaining the /v1/traces construction, or treat it
as a /v1 base and append only /traces. Ensure trailing slashes remain tolerated
and prevent duplicated /v1 segments.
- Around line 64-66: Update the attribute serialization flow around
encodeAttribute so JSON.stringify failures for circular values or BigInt are
caught and the affected attribute is skipped. Ensure these input-serialization
errors do not propagate into the observer’s success or rejection handling, while
preserving serialization for supported objects and arrays.
🪄 Autofix (Beta)

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: Pro

Run ID: f448e7e9-751a-4c94-afd0-ea5094d36954

📥 Commits

Reviewing files that changed from the base of the PR and between 18cff06 and d0c36dc.

⛔ Files ignored due to path filters (12)
  • api-snapshots/do.api.md is excluded by none and included by none
  • api-snapshots/runtime.api.md is excluded by none and included by none
  • api-snapshots/studio.api.md is excluded by none and included by none
  • packages/agent/__tests__/telemetry/otlp.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/do/__tests__/metric-buffer.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/do/__tests__/metric-history.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/do/__tests__/shard-do.admin.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/do/__tests__/tracing.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/studio/__tests__/app/studio.test.tsx is excluded by !**/__tests__/** and included by packages/**
  • packages/studio/__tests__/features/reports/instruments-table.test.tsx is excluded by !**/__tests__/** and included by packages/**
  • packages/studio/__tests__/features/traces/traces-panel.test.tsx is excluded by !**/__tests__/** and included by packages/**
  • shared/metric-event.ts is excluded by none and included by none
📒 Files selected for processing (14)
  • apps/studio/src/mock/dev-client.ts
  • packages/agent/src/telemetry/otlp.ts
  • packages/do/src/introspect.ts
  • packages/do/src/metric-buffer.ts
  • packages/do/src/metric-history.ts
  • packages/do/src/shard-do.ts
  • packages/studio/src/features/reports/instrument-format.ts
  • packages/studio/src/features/reports/instruments-table.tsx
  • packages/studio/src/features/reports/metrics-panel.tsx
  • packages/studio/src/features/traces/trace-geometry.ts
  • packages/studio/src/features/traces/traces-panel.tsx
  • packages/studio/src/lib/admin.ts
  • packages/studio/src/lib/trace-handoff.ts
  • packages/studio/src/locales/en.ts
🚧 Files skipped from review as they are similar to previous changes (9)
  • packages/do/src/introspect.ts
  • packages/studio/src/locales/en.ts
  • packages/do/src/shard-do.ts
  • packages/studio/src/features/reports/metrics-panel.tsx
  • packages/studio/src/lib/admin.ts
  • apps/studio/src/mock/dev-client.ts
  • packages/do/src/metric-history.ts
  • packages/studio/src/features/reports/instruments-table.tsx
  • packages/studio/src/features/reports/instrument-format.ts

Comment thread packages/agent/src/telemetry/otlp.ts Resolved
prisis added a commit that referenced this pull request Jul 22, 2026
Two open findings from the PR review:

- agent/otlp: guard the `waitUntil?.(observed)` registration in both span
  wrappers with try/catch — a throwing injected `waitUntil` must not surface
  after `execute()` has started, so the caller keeps the original promise
  (matching the isolation already inside `emitSpan`).

- studio/traces: the exemplar hand-off read cleared sessionStorage inside a
  lazy state initializer, so a render mutated the store (fragile under a
  StrictMode double-invoked initializer). Split it: `peekPendingTraceFilter`
  is a pure read (safe in the initializer), and `clearPendingTraceFilter`
  consumes it one-shot from a mount effect. The clear needs no setState, so
  it also stays clear of the repo's set-state-in-effect rule — which is why
  the original avoided an effect in the first place.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0197KjhmBDB3PXAc6TXiPqZ9
prisis added a commit that referenced this pull request Jul 22, 2026
Two open findings from the PR review:

- agent/otlp: guard the `waitUntil?.(observed)` registration in both span
  wrappers with try/catch — a throwing injected `waitUntil` must not surface
  after `execute()` has started, so the caller keeps the original promise
  (matching the isolation already inside `emitSpan`).

- studio/traces: the exemplar hand-off read cleared sessionStorage inside a
  lazy state initializer, so a render mutated the store (fragile under a
  StrictMode double-invoked initializer). Split it: `peekPendingTraceFilter`
  is a pure read (safe in the initializer), and `clearPendingTraceFilter`
  consumes it one-shot from a mount effect. The clear needs no setState, so
  it also stays clear of the repo's set-state-in-effect rule — which is why
  the original avoided an effect in the first place.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0197KjhmBDB3PXAc6TXiPqZ9
@prisis
prisis force-pushed the feat/observability-monitoring branch from 3518f30 to c976284 Compare July 22, 2026 10:38
prisis and others added 3 commits July 22, 2026 16:48
…exemplars

Squashed: durable ctx.metrics rollups + trend charts + exemplars, with the
thermo-review fixes folded in (text-safe series key, raw SQL handle, canonical
join). Rebased onto alpha after #149 (the ctx.trace/ctx.metrics base) merged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019M6G6CAoLVrQMxDYg7BWq2
The durable metric history persists the series identity as a SQLite TEXT
`series_key`, but `metricSeriesKey` joined its parts with NUL (U+0000).
`node:sqlite` reads TEXT back C-string-style, truncating at the first NUL,
so every `counter…`-prefixed key collapsed to `"counter"` on read and
distinct series silently merged — deterministically on CI's Node, by luck
not locally (the distinct-series test got 2 series, expected 4). Switch the
delimiter to U+001F (Unit Separator): non-NUL, round-trips through TEXT, and
JSON-escaped in every `stableStringify` output so it still can't collide.

Also fold in the PR review + lint fixes that were blocking the pipes:

- studio: read the one-shot trace hand-off in a lazy `useState` initializer
  instead of a mount effect (no setState-in-effect; the SPA is client-only
  and the read is SSR-guarded); `readPendingTraceFilter` now returns
  `undefined` not `null`.
- studio: define the trace hand-off after `debouncedShard` so the selected
  shard is carried without a use-before-define.
- do/studio: exports-last, import order, text-safe escapes, jsdoc params,
  `toReversed`, and drop unnecessary casts/String() conversions flagged by
  eslint; restore the `getByTestId<HTMLInputElement>` generic a bad autofix
  had stripped.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019M6G6CAoLVrQMxDYg7BWq2
An earlier eslint --fix (import sort + arrow-body) left shard-do.ts in a
shape prettier disagreed with; reformat so Lint (prettier) passes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019M6G6CAoLVrQMxDYg7BWq2
Two open findings from the PR review:

- agent/otlp: guard the `waitUntil?.(observed)` registration in both span
  wrappers with try/catch — a throwing injected `waitUntil` must not surface
  after `execute()` has started, so the caller keeps the original promise
  (matching the isolation already inside `emitSpan`).

- studio/traces: the exemplar hand-off read cleared sessionStorage inside a
  lazy state initializer, so a render mutated the store (fragile under a
  StrictMode double-invoked initializer). Split it: `peekPendingTraceFilter`
  is a pure read (safe in the initializer), and `clearPendingTraceFilter`
  consumes it one-shot from a mount effect. The clear needs no setState, so
  it also stays clear of the repo's set-state-in-effect rule — which is why
  the original avoided an effect in the first place.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0197KjhmBDB3PXAc6TXiPqZ9
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using our GitHub Discussions tab for questions.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Sep 9, 2026

This branch was previously deployed

1 inactive deployment
benchmarks — 917413ae Deployed Jul 22, 2026 by prisis via Benchmarks #857
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant