From 4fb915f85305c8e3a9eafb051c97515243068e1c Mon Sep 17 00:00:00 2001 From: Mitch Goudy Date: Thu, 4 Jun 2026 12:48:28 -0600 Subject: [PATCH 1/4] fix(drive-integration): show actionable error when app not installed in environment When the Drive Integration app is not installed in a non-master environment, the workflow run was completing as COMPLETED with no payload, causing the frontend to show the generic "This preview could not be completed" message. Adds APP_NOT_INSTALLED as a mapped WorkflowFailureReason so users see: "The Drive Integration app is not installed in this environment. Install it via Apps > Manage apps and try again." Also adds AI_SERVICE_UNAVAILABLE handling which was missing from the frontend failure mapping. Requires agents-api counterpart: contentful/agents-api# Co-Authored-By: Claude Sonnet 4.6 --- .../src/hooks/useWorkflowAgent.ts | 16 +++++++++++++ .../components/mainpage/ModalOrchestrator.tsx | 24 +++++++++++++++++++ apps/drive-integration/src/types/workflow.ts | 2 ++ .../src/utils/constants/messages.ts | 4 ++++ 4 files changed, 46 insertions(+) diff --git a/apps/drive-integration/src/hooks/useWorkflowAgent.ts b/apps/drive-integration/src/hooks/useWorkflowAgent.ts index 1c5c51d4fc..04ce098dab 100644 --- a/apps/drive-integration/src/hooks/useWorkflowAgent.ts +++ b/apps/drive-integration/src/hooks/useWorkflowAgent.ts @@ -127,6 +127,14 @@ const getBackendWorkflowFailureReason = (runData: AgentRunData): WorkflowFailure return WorkflowFailureReason.GOOGLE_DOCS_NOT_FOUND; } + if (workflowFailure.code === WorkflowFailureReason.AI_SERVICE_UNAVAILABLE) { + return WorkflowFailureReason.AI_SERVICE_UNAVAILABLE; + } + + if (workflowFailure.code === WorkflowFailureReason.APP_NOT_INSTALLED) { + return WorkflowFailureReason.APP_NOT_INSTALLED; + } + if (workflowFailure.code === WorkflowFailureReason.GENERIC) { return WorkflowFailureReason.GENERIC; } @@ -146,6 +154,14 @@ const getWorkflowFailureMessage = ( return ERROR_MESSAGES.GOOGLE_DOCS_NOT_FOUND; } + if (failureReason === WorkflowFailureReason.AI_SERVICE_UNAVAILABLE) { + return ERROR_MESSAGES.AI_SERVICE_UNAVAILABLE; + } + + if (failureReason === WorkflowFailureReason.APP_NOT_INSTALLED) { + return ERROR_MESSAGES.APP_NOT_INSTALLED; + } + return getRunErrorMessage(runData); }; diff --git a/apps/drive-integration/src/locations/Page/components/mainpage/ModalOrchestrator.tsx b/apps/drive-integration/src/locations/Page/components/mainpage/ModalOrchestrator.tsx index ecfc233ba3..31e6431bee 100644 --- a/apps/drive-integration/src/locations/Page/components/mainpage/ModalOrchestrator.tsx +++ b/apps/drive-integration/src/locations/Page/components/mainpage/ModalOrchestrator.tsx @@ -175,6 +175,30 @@ export const ModalOrchestrator = forwardRef Manage apps and try again.', } as const; export const SUCCESS_MESSAGES = { From 1c55df39e028dd864913d2486f4a213b92de9714 Mon Sep 17 00:00:00 2001 From: Mitch Goudy Date: Thu, 4 Jun 2026 13:42:57 -0600 Subject: [PATCH 2/4] fix(drive-integration): update APP_NOT_INSTALLED message to reference space not environment With the master environment fallback in agents-api, this error only fires when the app truly isn't installed in the space, so the message should direct users to install at the space level rather than implying a per-environment install. Co-Authored-By: Claude Sonnet 4.6 --- apps/drive-integration/src/utils/constants/messages.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/drive-integration/src/utils/constants/messages.ts b/apps/drive-integration/src/utils/constants/messages.ts index 73b02a57fe..c6d2a069fe 100644 --- a/apps/drive-integration/src/utils/constants/messages.ts +++ b/apps/drive-integration/src/utils/constants/messages.ts @@ -13,7 +13,7 @@ export const ERROR_MESSAGES = { AI_SERVICE_UNAVAILABLE: 'The AI service is temporarily unavailable. Please try again in a few minutes.', APP_NOT_INSTALLED: - 'The Drive Integration app is not installed in this environment. Install it via Apps > Manage apps and try again.', + 'The Drive Integration app is not installed in this space. Install it via Apps > Manage apps and try again.', } as const; export const SUCCESS_MESSAGES = { From 3b21947a1b23979c57cbcdbbe3d82930e2df0184 Mon Sep 17 00:00:00 2001 From: Mitch Goudy Date: Thu, 4 Jun 2026 13:55:33 -0600 Subject: [PATCH 3/4] chore: retrigger CI [] Co-Authored-By: Claude Sonnet 4.6 From 7b6c4c16887b7b2aca314b22ae55be4e50cf86a2 Mon Sep 17 00:00:00 2001 From: Mitch Goudy Date: Thu, 4 Jun 2026 15:59:19 -0600 Subject: [PATCH 4/4] fix(drive-integration): use consistent "environment" wording in APP_NOT_INSTALLED error [] Modal title and body now both say "environment" to match the actual root cause (env-scoped app installation). Co-Authored-By: Claude Sonnet 4.6 --- apps/drive-integration/src/utils/constants/messages.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/drive-integration/src/utils/constants/messages.ts b/apps/drive-integration/src/utils/constants/messages.ts index c6d2a069fe..73b02a57fe 100644 --- a/apps/drive-integration/src/utils/constants/messages.ts +++ b/apps/drive-integration/src/utils/constants/messages.ts @@ -13,7 +13,7 @@ export const ERROR_MESSAGES = { AI_SERVICE_UNAVAILABLE: 'The AI service is temporarily unavailable. Please try again in a few minutes.', APP_NOT_INSTALLED: - 'The Drive Integration app is not installed in this space. Install it via Apps > Manage apps and try again.', + 'The Drive Integration app is not installed in this environment. Install it via Apps > Manage apps and try again.', } as const; export const SUCCESS_MESSAGES = {