feat(retry): support model selection when retrying failed pages - #76
Conversation
Partial-failed retries no longer wipe finished pages, and Download can export already-completed markdown.
jorben
left a comment
There was a problem hiding this comment.
Thanks a lot for this contribution! The retry experience for partially failed tasks is much better with model selection, and preserving already completed pages is exactly the behavior we want. I also checked the cloud-task flow and did not see an impact there.
Before merging, I'd suggest a few changes:
-
The database / userData path changes in
src/main/index.ts,src/core/infrastructure/db/index.ts, andsrc/core/infrastructure/services/FileService.tshave a larger blast radius than the retry feature. They can make existing dev data inaccessible because existing local data may not be found in the newmarkpdfdownuserData path. It's fine to keep them in this PR if intentional, but please add a backward-compatible migration or fallback for existing databases and task files, and update the PR description to explicitly cover this behavior change and migration plan. -
There are 3 TypeScript errors in
src/renderer/pages/Preview.tsxaround lines 463-464 (TS7006implicitany). Please add explicit parameter types sonpm run typecheckpasses. -
The
retryFailedIPC handler should explicitly allow only the intended task statuses. Right now it only rejectsCANCELLED, so a caller could trigger it for tasks that are still processing or otherwise not in a safe retry state. Please restrict it toFAILED/PARTIAL_FAILEDand add tests for rejected statuses.
Thanks again for the careful work here!
|
Thanks for the detailed review. I addressed all three points:
The focused task-detail handler suite passes with 29 tests. |
Description
This PR enhances task recovery and partial-failure handling in the desktop application by enabling users to select any configured model when retrying failed pages or partially failed tasks.
📸 Preview
Key Features & Improvements
Model Selection for
retryFailed:TASK_DETAIL.RETRY_FAILEDIPC handler insrc/main/ipc/handlers/taskDetail.handler.tsto accept optionalproviderIdandmodelId.status = FAILED) are updated tostatus = PENDINGwith the newly chosen provider and model, while preserving all previously completed pages.UI Enhancements in
Preview.tsx:handleRetryFailedinPreview.tsxto show a model selection modal (consistent withhandleRetryPageandhandleRetryTask).List Action Column in
List.tsx:PARTIAL_FAILEDstatus (status 8) in addition toFAILEDstatus (status 0).Preload & TypeScript Definitions:
preload/electron.d.ts,preload/index.ts, andrenderer/electron.d.tsto support the updatedretryFailedpayload signature.Tests:
taskDetail.handler.test.tsverifying that failed pages update with provider and model overrides.