fix(cloud-tests): move remediation preview to Trigger.dev#2567
Merged
fix(cloud-tests): move remediation preview to Trigger.dev#2567
Conversation
…owser timeout The "Preparing fix plan" step (preview) runs 3+ LLM calls + cloud API reads + permission analysis, often taking 50-70+ seconds — exceeding browser timeout limits and causing silent failures. Changes: - New `remediate-preview` Trigger.dev task (3-minute max duration) - New `startPreview` server action in single-fix.ts - RemediationDialog now uses two separate useRealtimeRun hooks: one for preview, one for execute — both fully async - Recheck flow (cachedPermissions) also runs through Trigger.dev - Guided-only mode unchanged (no API call needed) - Removed direct api.post calls — no more synchronous HTTP for either preview or execute Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
🎉 This PR is included in version 3.22.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Summary
The "Preparing fix plan" step (preview) runs 3+ LLM calls + cloud API reads + permission analysis, often taking 50-70+ seconds — exceeding browser timeout limits and causing silent failures ("Failed to load preview").
Now both preview AND execute run as Trigger.dev background tasks with real-time progress via websocket. Zero browser timeout risk for the entire remediation flow.
Changes
remediate-preview.ts(new)/v1/cloud-security/remediation/previewvia service token, streams result via metadatasingle-fix.ts(action)startPreview()server action (same pattern asstartSingleFix)RemediationDialog.tsxuseRealtimeRunhooks: one for preview, one for execute. Removed all synchronousapi.postcalls.What changed for the user
Nothing visible — same UI, same loading animation, same preview display. The only difference is it won't silently fail after 60 seconds.
Edge cases
cachedPermissionsto skip AI re-analysis)Test plan
🤖 Generated with Claude Code
Summary by cubic
Move the remediation preview to a
@trigger.devbackground task with real-time progress to eliminate browser timeout failures during “Preparing fix plan.” Preview and execute now follow the same async task pattern.remediate-previewTrigger.dev task (3-minute max) calling/v1/cloud-security/remediation/previewwith a service token and streaming progress via metadata.startPreview()server action insingle-fix.tsthat returns a run ID and public token via@trigger.dev/sdk.RemediationDialogto use separateuseRealtimeRunhooks for preview and execute (@trigger.dev/react-hooks), removed directapi.postcalls, and routed rechecks withcachedPermissionsthrough Trigger.dev.Written for commit ef88b91. Summary will update on new commits.