Support re-triggering a failed run from the Hackbot UI - #6449
Open
suhaibmujahid wants to merge 1 commit into
Open
Support re-triggering a failed run from the Hackbot UI#6449suhaibmujahid wants to merge 1 commit into
suhaibmujahid wants to merge 1 commit into
Conversation
Failed runs previously had to be retried by re-entering every input in the trigger form, which is tedious for agents with non-trivial inputs such as build-repair's failure_tasks JSON. Add a "Re-run with same inputs" button to the run detail page for failed and timed-out runs. It posts to a new /api/runs/:runId/retrigger route that reads the stored run server-side and starts a fresh run with the same agent and inputs, attributed to the signed-in user. The original run is left untouched, and the new run gets its own id and results prefix. Key RunDetail on the run id so following the new run remounts with fresh state instead of rendering the previous run's doc, error and actions.
There was a problem hiding this comment.
Pull request overview
This PR adds “re-run” support to Hackbot UI for failed runs by introducing a dedicated API endpoint that creates a new run using the failed run’s stored inputs, and wiring that up to the run detail UI.
Changes:
- Add an
isFailedhelper for consistent “failed or timed out” status checks across UI and API code. - Add
POST /api/runs/:runId/retriggerto create a new run with the same inputs as a failed run (attributed to the currently signed-in user). - Add a “Re-run with same inputs” button on the run detail page and ensure state resets cleanly when navigating to the newly created run.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| services/hackbot-ui/lib/types.ts | Adds isFailed helper and reuses existing RunStatus/RunRef types for retrigger flow. |
| services/hackbot-ui/components/RunDetail.tsx | Adds UI/button + client-side POST to retrigger endpoint and navigates to the newly created run. |
| services/hackbot-ui/components/RecentRuns.tsx | Refactors failed-status checks to use isFailed helper. |
| services/hackbot-ui/app/runs/[runId]/page.tsx | Forces RunDetail remount on runId changes to clear transient UI state after navigation. |
| services/hackbot-ui/app/api/runs/[runId]/retrigger/route.ts | Implements the retrigger API route that re-creates a run from a failed run’s stored inputs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Resolves #6413