fix(drive-integration): show actionable error when app not installed in environment []#11012
Open
Mitch Goudy (mgoudy91) wants to merge 4 commits into
Open
fix(drive-integration): show actionable error when app not installed in environment []#11012Mitch Goudy (mgoudy91) wants to merge 4 commits into
Mitch Goudy (mgoudy91) wants to merge 4 commits into
Conversation
…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#<see PR> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… 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 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
⚔️ The Gauntlet — 🛡️ 0 Blockers · 3 advisory🤖 AI-powered · your code, through the lanes
Findings
One thing worth confirming: is there a throw site for 🤖 Machine-readable findings (for agents){
"tool": "gauntlet",
"schema": "v1",
"reviewed_ref": "3b21947",
"verdict": { "blockers": 0, "concerns": 2, "nits": 1, "security": "clean" },
"findings": [
{ "severity": "concern", "location": "apps/drive-integration/src/utils/constants/messages.ts:15", "lens": "adversarial-review / Failure Scenarios", "confidence": 90, "claim": "APP_NOT_INSTALLED copy is shown on a transient ext-api 502 (agents-api#615 maps 404||502 to app-not-installed), telling users to reinstall an installed app.", "recommendation": "Soften the frontend copy to cover the transient case; fix the root cause in agents-api#615 by not mapping 502 to app-not-installed." },
{ "severity": "concern", "location": "apps/drive-integration/src/locations/Page/components/mainpage/ModalOrchestrator.tsx:196", "lens": "adversarial-review / Hidden Assumptions", "confidence": 92, "claim": "Modal title says 'environment' while body copy says 'space' for the same APP_NOT_INSTALLED error.", "recommendation": "Use one consistent term in title and body; 'environment' matches the root cause." },
{ "severity": "nit", "location": "apps/drive-integration/src/hooks/useWorkflowAgent.ts:130", "lens": "code-quality-standards / Gaps", "confidence": 80, "claim": "No unit test covers the new code->reason->message mapping across the cross-service string contract.", "recommendation": "Add a unit test asserting app-not-installed and ai-service-unavailable map to the correct reason and message." }
]
}🎮 The Gauntlet · an AI review harness built by Josh C.S. Lewis · reviewed at |
…OT_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 <noreply@anthropic.com>
JuliRossi
added a commit
that referenced
this pull request
Jun 11, 2026
…ABLE error handling Ports error cases from #11012 — surfaces actionable messages when the app is not installed in the target environment or the AI service is down. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
JuliRossi
added a commit
that referenced
this pull request
Jun 11, 2026
…ABLE error handling Ports error cases from #11012 — surfaces actionable messages when the app is not installed in the target environment or the AI service is down. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
5 tasks
JuliRossi
added a commit
that referenced
this pull request
Jun 12, 2026
…s [INTEG-4151] (#11020) * fix(drive-integration): use environment alias for agents API calls sdk.ids.environment returns the real environment ID (e.g. master-2026-06-09) instead of the alias (master), causing the agents API path to not match aliased environments. Fall back to raw ID when no alias is set. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(drive-integration): resolve environment alias before agents API calls When the app is opened on a raw environment ID (e.g. master-2026-06-09), sdk.ids.environmentAlias is undefined. Fall back to fetching the environment and reading sys.aliases to find the alias name, so the agents API path matches the app installation which is scoped to the alias. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * test(drive-integration): add unit tests for resolveEnvironmentId Covers: alias fast-path, CMA alias lookup, no-alias fallback, and CMA error fallback. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(drive-integration): add APP_NOT_INSTALLED and AI_SERVICE_UNAVAILABLE error handling Ports error cases from #11012 — surfaces actionable messages when the app is not installed in the target environment or the AI service is down. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * refactor(drive-integration): simplify env alias resolution to sdk.ids.environmentAlias ?? sdk.ids.environment Replaces the resolveEnvironmentId helper (which made a CMA call to look up aliases) with the one-liner pattern used across closest-preview, slack, braze, and other apps. The CMA fallback was fragile (aliases[0] guess) and unnecessary — sdk.ids.environmentAlias is already populated when the user accesses via alias, which is the case that was causing the 403. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * chore(drive-integration): apply prettier formatting to useWorkflowAgent.ts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a Google Drive import fails due to the app not being installed in a space, users see a generic "This preview could not be completed. Please start again." message with no actionable guidance.
Fix
Adds frontend handling for two new failure codes surfaced by agents-api:
app-not-installed— shown when the app is not installed in the space (after the master env fallback in agents-api also finds nothing). Message: "The Drive Integration app is not installed in this space. Install it via Apps > Manage apps and try again."ai-service-unavailable— shown when the AI service is temporarily unavailable. Message: "The AI service is temporarily unavailable. Please try again in a few minutes."Both codes are handled in
useWorkflowAgent,WorkflowFailureReason, andModalOrchestrator.Test plan
APP_NOT_INSTALLEDerror modal appears with correct title and messageAI_SERVICE_UNAVAILABLEerror modal appears with correct title and messageRelated: contentful/agents-api#615
🤖 Generated with Claude Code