Skip to content

Conversation

@devsy-bot
Copy link
Contributor

@devsy-bot devsy-bot bot commented Sep 7, 2025

Summary

  • Fixed missing video recording persistence when workflows use script execution path
  • Added clean_up_workflow calls in both success and failure cases of _execute_workflow_script
  • Ensures video recordings are saved consistently across all workflow execution types

Problem

The workflow script execution path (_execute_workflow_script) was missing the cleanup step that persists video recordings and other artifacts. This resulted in video recordings not being saved when workflows used script execution instead of the normal block execution path.

Solution

Added clean_up_workflow calls in the _execute_workflow_script method:

  1. Success case: Added cleanup after marking workflow run as completed
  2. Failure case: Added cleanup after marking workflow run as failed, with proper error handling

This ensures video data is persisted regardless of execution outcome and maintains consistency with the normal workflow execution path.

Test plan

  • Analyze existing video recording implementation in clean_up_workflow
  • Identify missing cleanup in workflow script execution path
  • Add cleanup calls to both success and failure branches
  • Ensure error handling for cleanup failures doesn't affect main workflow status
  • Test workflow script execution with video recording enabled
  • Verify video recordings are persisted after script completion
  • Verify video recordings are persisted even when script fails

🤖 Generated with Claude Code


🎥 This PR fixes a critical bug where video recordings were not being persisted when workflows used script execution instead of the normal block execution path, ensuring consistent video recording behavior across all workflow execution types.

🔍 Detailed Analysis

Key Changes

  • Workflow Script Execution: Added missing clean_up_workflow calls in both success and failure paths of _execute_workflow_script method
  • Error Handling: Implemented proper exception handling for cleanup failures to prevent disrupting main workflow status
  • Consistency Fix: Ensures script execution path matches the cleanup behavior of normal block execution path

Technical Implementation

sequenceDiagram
    participant WS as Workflow Script
    participant WR as Workflow Run
    participant CU as Clean Up Workflow
    participant VS as Video Storage
    
    WS->>WR: Execute workflow script
    alt Success Case
        WR->>WR: Mark as completed
        WR->>CU: clean_up_workflow()
        CU->>VS: Persist video recordings
    else Failure Case
        WR->>WR: Mark as failed
        WR->>CU: clean_up_workflow() (with try/catch)
        CU->>VS: Persist video recordings
        Note over CU: Cleanup errors logged but don't affect workflow status
    end
Loading

Impact

  • Bug Resolution: Video recordings are now consistently saved regardless of workflow execution type (script vs block)
  • Data Persistence: Ensures artifacts and video data are properly preserved even when script execution fails
  • Robustness: Added error handling prevents cleanup failures from affecting the main workflow execution status

Created with Palmier


Important

Adds clean_up_workflow calls in _execute_workflow_script to ensure video recordings are saved for both success and failure cases.

  • Behavior:
    • Adds clean_up_workflow calls in _execute_workflow_script to ensure video recordings are saved.
    • Handles both success and failure cases for script execution.
  • Functions:
    • Modifies _execute_workflow_script in service.py to include cleanup after marking workflow run as completed or failed.
  • Error Handling:
    • Logs errors to Sentry if cleanup fails after script execution failure.

This description was created by Ellipsis for 82adff9. You can customize this summary. It will automatically update as commits are pushed.

The workflow script execution path (_execute_workflow_script) was missing
the cleanup step that persists video recordings and other artifacts. This
resulted in video recordings not being saved when workflows used script
execution instead of the normal block execution path.

Fixed by adding clean_up_workflow calls in both success and failure cases
of _execute_workflow_script, ensuring video data is persisted regardless
of execution outcome.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Changes requested ❌

Reviewed everything up to 82adff9 in 1 minute and 42 seconds. Click for details.
  • Reviewed 42 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.

Workflow ID: wflow_eUF7nZAbSZ2as5ai

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

workflow_run = await self.mark_workflow_run_as_completed(workflow_run_id=workflow_run.workflow_run_id)

# Clean up workflow to persist video data and other artifacts
await self.clean_up_workflow(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider wrapping the clean_up_workflow call in the success branch in a try/except block (as done in the failure branch) to prevent cleanup errors from unexpectedly failing a successful run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant