Repository navigation
fix(desktop): persist runs and recover question workflows - #428
Merged
Merged
Conversation
Signed-off-by: Sun-sunshine06 <Sun-sunshine06@users.noreply.github.com>
5 tasks
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.
Summary
Make generation and question workflows survive renderer refreshes, window switches, and temporary detachment without introducing a new database. The main process now owns durable run/question state, chat projection, and completion snapshots; the renderer reattaches using ordered replay and preserves unanswered form drafts.
Changes
runId/generationId, monotonic event sequences, schema version, and explicitrun_settledoutcomes in per-run JSONL journals. Commit events before broadcasting; validate cursors and fail closed on committed corruption while repairing incomplete tails.ask-journal.jsonl. Scope queues and drafts to the owning request/design; retain input on failed persistence, accept identical answer retries, and reject conflicting retries.Type of change
Context
Follow-up to the continuity work in #425, rebased onto
mainincluding the v0.2.2 release updates. This PR contains only the recovery implementation, regression tests, and a desktop patch changeset.Behavioral reference: Open Design run identity, JSONL events, replay, and restart handling. Retains CoDesign's existing file/JSONL and session-chat approach rather than importing the separate logical-task database architecture.
Recovery contract and limits
Validation
Executed locally on Windows with Node 22 and repository-pinned pnpm:
pnpm lint— passed (617 files).pnpm typecheck— passed for the workspace.pnpm test— passed for the workspace; desktop 152 test files, 1937 passed / 1 skipped. Unchanged workspace packages used valid Turbo cache entries.pnpm --filter @open-codesign/desktop build— main, preload, and renderer bundles passed.git diff --check— passed. Repository commit/push hooks also passed.Regression coverage includes temporary-filesystem reopen/torn-write/corruption cases, failed durable answers, identical/conflicting retries, native cancellation ownership, replay/live overlap and gaps, multiple subscribers, headless completion and snapshot persistence, repaired chat authority, stale status responses, design-scoped drafts, and cancellation/import races.
No paid/live-provider manual Electron reload acceptance run was performed. No visual redesign or screenshot recording is included; renderer recovery and import behavior are covered by component tests.
Checklist
pnpm lint && pnpm typecheck && pnpm testpasses locally