Skip to content

Conversation

@felarof99
Copy link
Contributor

Add a retry button to the RunResultDialog when a scheduled task fails. The button uses the same logic as the Test button to re-run the task.

Add a retry button to the RunResultDialog when a scheduled task fails.
The button uses the same logic as the Test button to re-run the task.
@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

Thank you for your contribution! Before we can merge this PR, we need you to sign our Contributor License Agreement.

To sign the CLA, please add a comment to this PR with the following text:

I have read the CLA Document and I hereby sign the CLA

You only need to sign once. After signing, this check will pass automatically.


Troubleshooting
  • Already signed but still failing? Comment recheck to trigger a re-verification.
  • Signed with a different email? Make sure your commit email matches your GitHub account email, or add your commit email to your GitHub account.
- - - I have read the CLA Document and I hereby sign the CLA - - - You can retrigger this bot by commenting **recheck** in this Pull Request. Posted by the **CLA Assistant Lite bot**.

@claude
Copy link

claude bot commented Jan 9, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 9, 2026

Greptile Overview

Greptile Summary

This PR adds a retry button to the RunResultDialog component that appears when a scheduled task fails. The implementation follows a clean approach:

Key Changes:

  • run-result-dialog.tsx: Adds an optional onRetry prop and conditionally renders a retry button when run.status === 'failed' and the callback is provided
  • ScheduledTasksPage.tsx: Passes the retry callback that reuses the existing handleRun function with the failed run's job ID

Implementation Details:

  • The retry button uses the Play icon for consistency with the test functionality
  • The dialog closes immediately after triggering the retry, providing clear feedback
  • JavaScript closures correctly capture the viewingRun.jobId value, preventing issues even though the dialog closes and clears the state
  • The DialogFooter component's built-in gap spacing handles button layout properly

Minor Consideration:

  • The retry action reuses SCHEDULED_TASK_TESTED_EVENT for analytics tracking rather than having a dedicated retry event, which could make it harder to distinguish user behavior patterns in analytics

The code is well-structured and follows existing patterns in the codebase.

Confidence Score: 4/5

  • This PR is safe to merge with minimal risk. The changes are well-contained and follow existing patterns.
  • Score of 4 reflects a clean, working implementation with only minor non-blocking considerations. The code correctly handles edge cases through closures, conditionally renders based on state, and integrates smoothly with existing functionality. The single style suggestion about analytics tracking is a nice-to-have improvement but doesn't affect functionality. No logic errors, security issues, or breaking changes were found.
  • No files require special attention. Both files contain straightforward changes that follow established patterns in the codebase.

Important Files Changed

File Analysis

Filename Score Overview
apps/agent/components/ai-elements/run-result-dialog.tsx 5/5 Added optional onRetry prop and retry button for failed tasks. Implementation is clean with proper conditional rendering and closure handling.
apps/agent/entrypoints/options/scheduled-tasks/ScheduledTasksPage.tsx 4/5 Wired retry callback to RunResultDialog using handleRun. Works correctly but reuses test analytics event instead of tracking retries separately.

Sequence Diagram

sequenceDiagram
    participant User
    participant RunResultDialog
    participant ScheduledTasksPage
    participant scheduleStorage
    participant scheduleMessages

    Note over User,scheduleMessages: User Views Failed Task Run
    User->>ScheduledTasksPage: Click to view failed run
    ScheduledTasksPage->>ScheduledTasksPage: setViewingRun(run)
    ScheduledTasksPage->>RunResultDialog: open dialog with run data
    RunResultDialog->>User: Display failed status & error

    Note over User,scheduleMessages: User Clicks Retry Button
    User->>RunResultDialog: Click Retry button
    RunResultDialog->>RunResultDialog: handleRetry()
    RunResultDialog->>ScheduledTasksPage: onRetry() callback
    ScheduledTasksPage->>ScheduledTasksPage: handleRun(viewingRun.jobId)
    ScheduledTasksPage->>scheduleStorage: runJob(jobId)
    scheduleStorage->>scheduleMessages: sendScheduleMessage('runScheduledJob')
    scheduleMessages-->>scheduleStorage: job execution initiated
    scheduleStorage-->>ScheduledTasksPage: job running
    RunResultDialog->>ScheduledTasksPage: onOpenChange(false)
    ScheduledTasksPage->>ScheduledTasksPage: setViewingRun(null)
    RunResultDialog->>User: Dialog closes
Loading

@felarof99
Copy link
Contributor Author

@claude I want to add retry button on the scheduled task runs shown in the new tab page as well. Help implement that logic and create a commit on this prt

@claude
Copy link

claude bot commented Jan 12, 2026

Claude finished @felarof99's task in 1m 14s —— View job


Completed: Retry button added to new tab page

  • Review existing retry button implementation
  • Find new tab page scheduled task runs component
  • Implement retry button for new tab page
  • Commit and push changes

Summary

Successfully added retry button functionality to the new tab page's scheduled task runs. The implementation follows the same pattern used in ScheduledTasksPage.tsx:

Changes made to apps/agent/entrypoints/newtab/index/ScheduleResults.tsx:

  • Imported SCHEDULED_TASK_TESTED_EVENT constant for analytics tracking
  • Added runJob function from the useScheduledJobs hook
  • Created handleRetry function that executes the job retry and tracks the event
  • Passed onRetry callback to the RunResultDialog component

The retry button will now appear in the new tab page when viewing failed scheduled task runs, using the same UI and behavior as the options page implementation.

Note: I was unable to run the linter (bun run lint) as it requires approval, but the changes follow the existing code patterns in the file.


|

- Import SCHEDULED_TASK_TESTED_EVENT and runJob hook
- Add handleRetry function to trigger job retry with analytics tracking
- Pass onRetry callback to RunResultDialog component
- Follows same pattern as ScheduledTasksPage implementation

Co-authored-by: Felarof <felarof99@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants