Skip to content

[DEV-91] Add 'retry this run' action to Support Dashboard - #85

Open
danii1 wants to merge 1 commit into
mainfrom
feature/dev-91-attempt-25
Open

[DEV-91] Add 'retry this run' action to Support Dashboard#85
danii1 wants to merge 1 commit into
mainfrom
feature/dev-91-attempt-25

Conversation

@danii1

@danii1 danii1 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Task: DEV-91

Summary: Add 'retry this run' action to Support Dashboard

Implementation Details

I'll start by exploring the codebase to understand the structure and existing retry logic.
Previous attempts exist. Let me check if they contain useful partial work.
No partial work exists. Let me explore the key pieces: dashboard server, retry gate, and the CLI force flow.
No ticket-edit in codebase — the real mechanism is the CLI's --force retry gate bypass. Let me check the auth package for identity/roles, the RunStore schema, and existing dashboard tests.
Now I understand the architecture. Let me check the remaining UI pieces and docs structure.
I have full context now. Let me set up the work plan and start implementing.
Now let me create the retry module.
Now extend DashboardData and add the retry handler in dashboard-api.ts:
I need to fix a caching bug in RunRetryAuditStorelistForRun could cache a readonly connection that later breaks writes. Let me correct it:
Now add the handleRetryRun handler to dashboard-api.ts:
The in-flight guard must persist past the request (the spawned run takes time to appear), so let me switch it to an expiring map:
Now wire the retry info into handleRunDetail and add the POST route in the server:
Backend done. Now the UI. Let me check the utils and button component:
Now update the UI API types and add a RetrySection component. First, api.ts:
Now update RunDetailView with the retry action, confirmation, feedback, and audit trail:
Let me fix the duplicate imports issue before linting:
Now the tests — a dedicated retry test file plus extending existing dashboard tests:
Let me clean up that messy concurrency test and add a TTL knob for testability:
Now rewrite the concurrency test cleanly:
Now add a server-route test to the existing dashboard-api.test.ts:
Now let me update the docs:
Typecheck passes. Now lint and format:
Lint passes (pre-existing warnings only). Now format and verify formatting checks pass:
All 926 backend tests pass. One cleanup — use basename instead of string split in the spawn helper:
Final verification round:
DEV-91 is implemented. Summary of the changes:

Backend (packages/code)

  • src/lib/run-retry.ts (new): retry eligibility (failed/escalated/abandoned runs with a task key; succeeded/deferred/in-progress and PR-mention runs are rejected with a reason), RunRetryAuditStore (new run_retry_audit table in queue.db: who, when, action, command, pid, original run id), actor resolution from the CLI sign-in session, and spawnCliForceRetry which re-invokes the same entry script as devintern <TASK> --force as a detached subprocess.
  • src/lib/dashboard-api.ts: run detail now embeds retry: { eligible, reason, audit }; new handleRetryRun enforces eligibility → authentication (devintern login) → optional support-role allowlist (DASHBOARD_RETRY_EMAILS) → per-task concurrency guard (claims + live in-progress runs) before spawning and auditing.
  • src/dashboard-server.ts: routes POST /api/runs/:id/retry (injectable deps for tests).

UI (packages/dashboard-ui)

  • RunDetailView.tsx: "Retry this run" button on eligible runs, inline confirmation strip explaining the --force re-run, success/failure banners after triggering, and a "Retry history" audit list.

Docs & tests

  • docs/code/dashboard.md: retry flow, safeguards, env var, and API endpoint documented.
  • New tests/dashboard-retry.test.ts plus extended server-route tests — coverage for eligibility matrix, 403/409/404/500 paths, allowlist, concurrency/TTL, audit trail, and end-to-end POST via startDashboardServer.

Verification: full suite 926 pass / 0 fail, dashboard-ui tests 41 pass, typecheck, lint, format check, and vite build all green.


This PR was automatically created by @devintern/code

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