88 type ViewBlock ,
99 type WatchResultBlock as WatchResultBlockPayload ,
1010} from "@internal/dashboard-agent-contracts" ;
11- import { DEMO_WORLD , demoFixtures } from "~/components/dashboard-agent/demo" ;
11+ import { DEMO_WORLD , demoFixtures , demoId , demoRunsUri } from "~/components/dashboard-agent/demo" ;
1212import type { TurnActivity } from "~/components/dashboard-agent/DashboardAgentMessages" ;
1313import { watchConfirmationBlockBody , watchOneShotBlockBody } from "~/presenters/v3/dashboardAgent" ;
1414import {
@@ -47,6 +47,11 @@ const {
4747 userMessage,
4848} = demoFixtures ;
4949
50+ const DEMO_WATCH_ID = demoId ( "watch_gallery" ) ;
51+
52+ // A stored error_recurrence spec holds the internal id, so the demo one drops its prefix.
53+ const DEMO_FINGERPRINT = DEMO_WORLD . errorFingerprint . replace ( / ^ e r r o r _ / , "" ) ;
54+
5055/** One transcript the message gallery renders, with the turn state it belongs to. */
5156export type DemoTranscript = {
5257 messages : UIMessage [ ] ;
@@ -182,7 +187,7 @@ export const demoTranscripts = {
182187
183188export const fullDiagnosis : DiagnosisBlock = {
184189 type : "diagnosis" ,
185- runId : "run_a1b2c3d4e5" ,
190+ runId : DEMO_WORLD . failedRunId ,
186191 summary :
187192 "The run failed because processOrder threw on an order with no line items. The payload had an empty items array." ,
188193 category : "user_code_error" ,
@@ -193,7 +198,7 @@ export const fullDiagnosis: DiagnosisBlock = {
193198 {
194199 type : "error" ,
195200 detail : "TypeError: Cannot read properties of undefined (reading 'sku')" ,
196- reference : "run_a1b2c3d4e5" ,
201+ reference : DEMO_WORLD . failedRunId ,
197202 } ,
198203 { type : "failed_span" , detail : "processOrder attempt 1 failed after 42ms" } ,
199204 {
@@ -204,7 +209,7 @@ export const fullDiagnosis: DiagnosisBlock = {
204209 {
205210 type : "historical_match" ,
206211 detail : "14 runs of this task hit the same error in the last 24h." ,
207- reference : "error_emptyorder" ,
212+ reference : DEMO_WORLD . errorFingerprint ,
208213 } ,
209214 ] ,
210215 impact :
@@ -214,14 +219,14 @@ export const fullDiagnosis: DiagnosisBlock = {
214219 "Validate the payload before triggering so empty orders never reach the task." ,
215220 ] ,
216221 actions : [
217- { label : "View run" , kind : "view_run" , target : "run_a1b2c3d4e5" } ,
222+ { label : "View run" , kind : "view_run" , target : DEMO_WORLD . failedRunId } ,
218223 { label : "Retries docs" , kind : "docs" , target : "https://trigger.dev/docs/errors-retrying" } ,
219224 ] ,
220225} ;
221226
222227export const externalServiceDiagnosis : DiagnosisBlock = {
223228 type : "diagnosis" ,
224- runId : "run_f6g7h8i9j0" ,
229+ runId : DEMO_WORLD . slowRunId ,
225230 summary : "chargePayment timed out waiting on the Stripe API after 30 seconds." ,
226231 category : "external_service" ,
227232 likelyCause :
@@ -231,7 +236,7 @@ export const externalServiceDiagnosis: DiagnosisBlock = {
231236 {
232237 type : "error" ,
233238 detail : "TimeoutError: Stripe API timed out after 30s" ,
234- reference : "run_f6g7h8i9j0" ,
239+ reference : DEMO_WORLD . slowRunId ,
235240 } ,
236241 { type : "deploy" , detail : "First seen on version 20260620.2" , reference : "20260620.2" } ,
237242 ] ,
@@ -240,12 +245,12 @@ export const externalServiceDiagnosis: DiagnosisBlock = {
240245 "Wrap the Stripe call in a retry with backoff." ,
241246 "Set an explicit request timeout shorter than the task's max duration." ,
242247 ] ,
243- actions : [ { label : "View run" , kind : "view_run" , target : "run_f6g7h8i9j0" } ] ,
248+ actions : [ { label : "View run" , kind : "view_run" , target : DEMO_WORLD . slowRunId } ] ,
244249} ;
245250
246251export const lowConfidenceDiagnosis : DiagnosisBlock = {
247252 type : "diagnosis" ,
248- runId : "run_k1l2m3n4o5" ,
253+ runId : DEMO_WORLD . priorRunId ,
249254 summary :
250255 "The run crashed without a captured error, so the cause isn't conclusive from the available signals." ,
251256 category : "unknown" ,
@@ -265,21 +270,21 @@ export const lowConfidenceDiagnosis: DiagnosisBlock = {
265270export const revisedDiagnosisBlocks : ViewBlock [ ] = [
266271 {
267272 ...lowConfidenceDiagnosis ,
268- id : " diagnosis-run_a1b2c3d4e5" ,
273+ id : ` diagnosis-${ DEMO_WORLD . failedRunId } ` ,
269274 revision : 1 ,
270275 version : VIEW_BLOCK_VERSION ,
271276 summary : "Revision 1 — first guess, before the logs came back. Should not render." ,
272277 } ,
273278 {
274279 ...externalServiceDiagnosis ,
275- id : " diagnosis-run_a1b2c3d4e5" ,
280+ id : ` diagnosis-${ DEMO_WORLD . failedRunId } ` ,
276281 revision : 2 ,
277282 version : VIEW_BLOCK_VERSION ,
278283 summary : "Revision 2 — narrowed to the payload, still unconfirmed. Should not render." ,
279284 } ,
280285 {
281286 ...fullDiagnosis ,
282- id : " diagnosis-run_a1b2c3d4e5" ,
287+ id : ` diagnosis-${ DEMO_WORLD . failedRunId } ` ,
283288 revision : 3 ,
284289 version : VIEW_BLOCK_VERSION ,
285290 summary :
@@ -299,7 +304,7 @@ export const offerActionsBlock: ViewBlock = {
299304 kind : "watch" ,
300305 spec : {
301306 kind : "error_recurrence" ,
302- fingerprint : "a1b2c3" ,
307+ fingerprint : DEMO_FINGERPRINT ,
303308 checkEveryMinutes : 15 ,
304309 maxHours : 6 ,
305310 note : "the TypeError in send-order-receipt" ,
@@ -308,7 +313,7 @@ export const offerActionsBlock: ViewBlock = {
308313 } ,
309314 {
310315 label : "See its failed runs" ,
311- intent : { kind : "navigate" , target : "trigger://proj_abc/env_abc/runs" } ,
316+ intent : { kind : "navigate" , target : demoRunsUri ( ) } ,
312317 } ,
313318 ] ,
314319} ;
@@ -318,16 +323,16 @@ export const offerActionsBlock: ViewBlock = {
318323 * ------------------------------------------------------------------ */
319324
320325const WATCH_BLOCK_ENVELOPE = {
321- id : " watch:watch_demo" ,
326+ id : ` watch:${ DEMO_WATCH_ID } ` ,
322327 revision : 0 ,
323328 version : VIEW_BLOCK_VERSION ,
324329} as const ;
325330
326331/** Both opt-ins took effect: the happy path a submit with `notifyExternally` produces. */
327332export const watchConfirmationBlock : WatchResultBlockPayload = {
328333 ...watchConfirmationBlockBody ( {
329- spec : queueWatchRecommendation ( "email-sends" ) ,
330- watchId : "watch_demo" ,
334+ spec : queueWatchRecommendation ( DEMO_WORLD . queue ) ,
335+ watchId : DEMO_WATCH_ID ,
331336 followUp : { investigateOnAttention : true , external : { status : "enabled" } } ,
332337 } ) ,
333338 ...WATCH_BLOCK_ENVELOPE ,
@@ -339,8 +344,8 @@ export const watchConfirmationBlock: WatchResultBlockPayload = {
339344 */
340345export const watchDegradedConfirmationBlock : WatchResultBlockPayload = {
341346 ...watchConfirmationBlockBody ( {
342- spec : queueWatchRecommendation ( "email-sends" ) ,
343- watchId : "watch_demo" ,
347+ spec : queueWatchRecommendation ( DEMO_WORLD . queue ) ,
348+ watchId : DEMO_WATCH_ID ,
344349 unavailable : true ,
345350 followUp : {
346351 investigateOnAttention : true ,
@@ -352,7 +357,7 @@ export const watchDegradedConfirmationBlock: WatchResultBlockPayload = {
352357
353358export const watchSatisfiedBlock : WatchResultBlockPayload = {
354359 ...watchOneShotBlockBody ( {
355- spec : runWatchRecommendation ( "run_a1b2c3d4e5" ) ,
360+ spec : runWatchRecommendation ( DEMO_WORLD . failedRunId ) ,
356361 result : "satisfied" ,
357362 } ) ,
358363 ...WATCH_BLOCK_ENVELOPE ,
0 commit comments