From cb5a39a68cd7aa1de19cb5790d8f179412b519c7 Mon Sep 17 00:00:00 2001 From: Theo Browne Date: Thu, 2 Jul 2026 05:17:33 -0700 Subject: [PATCH] Restore cause on WorkflowInspectionError per service error conventions Real filesystem failures (read-failed / not-found wraps) forward their underlying error as an optional cause, matching the GitCommandError convention; pure validation reasons stay cause-less. The paths a cause can carry are ones the client supplied in the request, so this does not reintroduce the earlier information-exposure concern. Co-Authored-By: Claude Fable 5 --- apps/server/src/workflow/WorkflowInspectionService.ts | 5 +++++ packages/contracts/src/workflow.ts | 3 +++ 2 files changed, 8 insertions(+) diff --git a/apps/server/src/workflow/WorkflowInspectionService.ts b/apps/server/src/workflow/WorkflowInspectionService.ts index bad1f2c39f..06ef488523 100644 --- a/apps/server/src/workflow/WorkflowInspectionService.ts +++ b/apps/server/src/workflow/WorkflowInspectionService.ts @@ -116,6 +116,7 @@ export const make = (options?: { readonly projectsRoot?: string }) => operation, reason: isEnoent(cause) ? "not-found" : "read-failed", detail: "Failed to resolve the workflow projects root.", + cause, }), }); @@ -126,6 +127,7 @@ export const make = (options?: { readonly projectsRoot?: string }) => operation, reason: isEnoent(cause) ? "not-found" : "read-failed", detail: "Failed to resolve the requested path.", + cause, }), }); @@ -160,6 +162,7 @@ export const make = (options?: { readonly projectsRoot?: string }) => operation, reason: isNotFoundPlatformError(cause) ? "not-found" : "read-failed", detail: "Failed to read the workflow script.", + cause, }), ), ); @@ -189,6 +192,7 @@ export const make = (options?: { readonly projectsRoot?: string }) => operation, reason: isNotFoundPlatformError(cause) ? "not-found" : "read-failed", detail: "Failed to read the workflow journal.", + cause, }), ), ); @@ -275,6 +279,7 @@ export const make = (options?: { readonly projectsRoot?: string }) => operation, reason: isNotFoundPlatformError(cause) ? "not-found" : "read-failed", detail: "Failed to read the agent transcript.", + cause, }), ), ); diff --git a/packages/contracts/src/workflow.ts b/packages/contracts/src/workflow.ts index 07bdd89545..63a59bc2e7 100644 --- a/packages/contracts/src/workflow.ts +++ b/packages/contracts/src/workflow.ts @@ -96,6 +96,9 @@ export class WorkflowInspectionError extends Schema.TaggedErrorClass