@@ -320,7 +320,7 @@ export function sanitizeError(error: TaskRunError): TaskRunError {
320320 case "CUSTOM_ERROR" : {
321321 // CUSTOM_ERROR.raw holds JSON.stringify(error) which is later parsed by
322322 // JSON.parse in createErrorTaskError. Naive truncation would cut mid-token
323- // and produce invalid JSON — wrap the preview in a valid JSON envelope.
323+ // and produce invalid JSON wrap the preview in a valid JSON envelope.
324324 const clean = error . raw . replace ( / \0 / g, "" ) ;
325325 const safeRaw =
326326 clean . length > MAX_MESSAGE_LENGTH
@@ -332,7 +332,7 @@ export function sanitizeError(error: TaskRunError): TaskRunError {
332332 } ;
333333 }
334334 case "INTERNAL_ERROR" : {
335- // message and stackTrace are optional for INTERNAL_ERROR — preserve
335+ // message and stackTrace are optional for INTERNAL_ERROR preserve
336336 // `undefined` so the `error.message ?? "Internal error (CODE)"` fallback
337337 // in createErrorTaskError still kicks in (empty string is not nullish).
338338 return {
@@ -429,6 +429,9 @@ export function shouldLookupRetrySettings(error: TaskRunError): boolean {
429429 case "TASK_RUN_UNCAUGHT_EXCEPTION" :
430430 return true ;
431431
432+ case "TASK_MIDDLEWARE_ERROR" :
433+ return true ;
434+
432435 default :
433436 return false ;
434437 }
@@ -641,7 +644,7 @@ export class ChatChunkTooLargeError extends Error {
641644 `chat.agent chunk${ chunkType ? ` of type "${ chunkType } "` : "" } is ${ chunkSize } bytes, ` +
642645 `over the realtime stream's per-record cap of ${ maxSize } bytes. ` +
643646 `For oversized payloads (e.g. large tool outputs), write the value to your own store and ` +
644- `emit only an id/url through the chat stream — see https://trigger.dev/docs/ai-chat/patterns/large-payloads.`
647+ `emit only an id/url through the chat stream see https://trigger.dev/docs/ai-chat/patterns/large-payloads.`
645648 ) ;
646649 this . name = "ChatChunkTooLargeError" ;
647650 }
@@ -744,7 +747,7 @@ const prettyInternalErrors: Partial<
744747 href : links . docs . troubleshooting . stalledExecution ,
745748 } ,
746749 } ,
747- // Link only — we deliberately do NOT set `message`, so the original
750+ // Link only we deliberately do NOT set `message`, so the original
748751 // error message (e.g. "read ECONNRESET") is preserved in the dashboard.
749752 // Common cause: an EventEmitter (node-redis, pg, etc.) emitted "error"
750753 // with no listener attached, which Node escalates to uncaughtException.
@@ -1152,7 +1155,7 @@ export function createTaskMetadataFailedErrorStack(
11521155 }
11531156
11541157 stack . push ( "\n" ) ;
1155- stack . push ( ` ❯ ${ taskWithIssues . exportName } in ${ taskWithIssues . filePath } ` ) ;
1158+ stack . push ( ` ? ${ taskWithIssues . exportName } in ${ taskWithIssues . filePath } ` ) ;
11561159
11571160 for ( const issue of taskWithIssues . issues ) {
11581161 if ( issue . path ) {
0 commit comments