Skip to content

Commit af49aa1

Browse files
d-csclaude
andcommitted
fix(webapp): use internal cuid for synth run-header id
The PG path's `RunPresenter.getRun` sets `id: run.id` (internal cuid). The synth header was setting `id: run.friendlyId`, causing the admin debug tooltip on the run detail page to show a `run_xxxx` friendly ID where the PG-resident view shows a cuid. `SyntheticRun.id` is already the cuid (via `RunId.fromFriendlyId(entry.runId)`), so use it directly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c5b209d commit af49aa1

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

apps/webapp/app/v3/mollifier/syntheticRunHeader.server.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ export function buildSyntheticRunHeader(args: {
3232
const isFailed = run.status === "FAILED";
3333

3434
return {
35-
id: run.friendlyId,
35+
// `id` mirrors RunPresenter.getRun's runData (the PG path), which
36+
// is the internal cuid — not the friendlyId. SyntheticRun.id is
37+
// already the cuid (RunId.fromFriendlyId(entry.runId) in
38+
// readFallback.server.ts) so the admin debug tooltip on the run
39+
// detail page shows the same format for buffered + materialised
40+
// runs.
41+
id: run.id,
3642
number: 1,
3743
friendlyId: run.friendlyId,
3844
traceId: run.traceId ?? "",

apps/webapp/test/mollifierSyntheticRunHeader.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ describe("buildSyntheticRunHeader", () => {
8989
it("forwards identity and environment fields from the snapshot", () => {
9090
const header = buildSyntheticRunHeader({ run: makeSyntheticRun(), environment: ENV });
9191
expect(header.friendlyId).toBe("run_friendly_1");
92-
expect(header.id).toBe("run_friendly_1");
92+
// `id` mirrors RunPresenter.getRun (the PG path) which puts the
93+
// internal cuid in this field. SyntheticRun.id is the cuid; the
94+
// header must surface it (not the friendlyId).
95+
expect(header.id).toBe("run_internal_1");
9396
expect(header.traceId).toBe("trace_1");
9497
expect(header.spanId).toBe("span_1");
9598
expect(header.environment).toMatchObject({

0 commit comments

Comments
 (0)