Repository navigation
fix: harden generation, workspace, and preview continuity - #425
Merged
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Serialize participating writers by canonical file path across designs. Reject stale agent edits and refresh their view for explicit retry while retaining rename leases and external conflict checks. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Exercise seeded HTML and JSX through real browser preview, shared-workspace conditional save conflicts, and standalone HTML plus extracted ZIP rendering with network requests blocked. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve CSS and JSX syntax when decoded asset filenames contain spaces, quotes, or parentheses. Validate extracted HTML and JSX ZIP assets in an offline system browser. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Centralize native :disabled actionability checks and preserve first-legend, inert, and ARIA semantics. Cover fieldset controls with system-browser regressions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep source conflicts distinct from storage failures so actual text-editor view/retry recovers in the same generation. Accept an optional generation signal and check it before queued publication; callers wire the signal separately. Cover intentional unconditional replacements and cancellation barriers. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Forward the tool signal into scaffold copying and recheck after acquiring the canonical writer and immediately before writeFile. Hold queued operations until settlement without claiming to revoke in-flight OS writes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep source-bound inferred controls stable and validate colors with the browser. Serialize and coalesce debounced writes without erasing newer drafts, stale ACK publication, or weakening source guards. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Retain generation ownership through cleanup, cancel clarification and preview waits, guard prompt and recovery admissions, and enforce native ask ordering and the three-round done repair cap. Add installed-pi lifecycle and main-chain regressions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Replay the existing React root element for render-time token reads instead of redefining components on each update. Keep conservative legacy replay for module-scope token snapshots, static roots, and memoized components with a nonfatal, source-guarded compatibility notice. Cover the production WorkspaceFilePreview boundary, guarded disk saves and watcher echoes, native Electron IPC state retention, and legacy compatibility examples. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Map validated compatibility notices to the app locale in English, Chinese, Spanish, and Brazilian Portuguese without changing the runtime protocol or nonfatal semantics. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Conservatively use existing compatibility replay when useMemo or useCallback executes, including closures that capture tokens before entering the hook. Preserve the ordinary useState/useEffect render-time fast path and localized nonfatal notice. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Scan the middleware fixture's real entry and use a per-suite cold optimizer cache instead of sharing Vite output with concurrent fixtures. Report startup page, console, request, and HTTP failures without increasing timeouts or retrying navigation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Replace development dependency optimization with an awaited Vite build and static preview. Assert nonempty entry/CSS artifacts before serving and retain startup network diagnostics and production behavior coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
hqhq1025
marked this pull request as ready for review
September 17, 2026 19:16
Collaborator
Author
|
Final required CI is green (35263365774), including Linux/Node 22 tests and production bundle build; CodeQL and Dependency Review passed. All three independent adversarial reviewers cleared their assigned original and second-pass repros. The additional ready-for-review DeepSeek workflow (35263880571) failed after three responses with empty final message content and posted no review; this is not being counted as a successful review. No check bypass or workflow change is being used. The repository only permits squash merges, so the validated candidate will be published using that normal merge mode. |
9 of 10 tasks
Sun-sunshine06
added a commit
that referenced
this pull request
Sep 19, 2026
## 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 - Persist `runId`/`generationId`, monotonic event sequences, schema version, and explicit `run_settled` outcomes in per-run JSONL journals. Commit events before broadcasting; validate cursors and fail closed on committed corruption while repairing incomplete tails. - Subscribe before replay, buffer overlapping live events, deduplicate cursors, recover gaps, and catch up on focus/visibility changes. Support multiple renderer subscribers without replay-triggered tool execution, auto-polish, or stale workspace overwrites. - Persist questions, answers, cancellation/interruption, and acknowledgement state in `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. - Project chat/tool/active-message events idempotently. Committed delivery and tool results outrank inferred terminal fallbacks; repaired rows refresh even when replay contains only already-consumed cursors. - Finalize artifact snapshots in the main process so detached completion does not depend on the original renderer Promise. Reattached renderers refresh the latest snapshot without recreating it. - Preserve the upstream native cancellation and import-ownership protections; keep generation/workspace ownership until the worker actually settles, and reject duplicate run IDs. ## Type of change - [x] Bug fix - [x] New feature - [ ] Breaking change ## Context Follow-up to the continuity work in #425, rebased onto `main` including 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](https://github.com/nexu-io/open-design/blob/f5707c8cae7b61014c5e91e114b9aa07826df725/apps/daemon/src/runtimes/runs.ts). Retains CoDesign's existing file/JSONL and session-chat approach rather than importing the separate logical-task database architecture. ## Recovery contract and limits - Renderer refresh/detachment can reattach to a still-running main-process run and pending questions. - A main-process restart preserves history and marks orphaned runs/questions **interrupted**. It does **not** resurrect provider Promises or automatically repeat tools/side effects. - Question answers are acknowledged only after persistence. Invalid submissions leave the question available for correction; losing a window no longer cancels the question by itself. - Additive IPC fields and versioned journals; no SQLite, new production dependencies, or retention/deletion policy. - Very large histories may need future replay pagination and writer backpressure. ## 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 - [x] Checked relevant continuity context and upstream implementation - [x] `pnpm lint && pnpm typecheck && pnpm test` passes locally - [x] Added/updated regression tests - [x] Added a user-visible desktop patch changeset - [x] Documented recovery boundaries above - [x] Additive protocol, schema-versioned storage, explicit main-process ownership - [x] No new production dependencies or database layer Signed-off-by: Sun-sunshine06 <Sun-sunshine06@users.noreply.github.com> Co-authored-by: Sun-sunshine06 <Sun-sunshine06@users.noreply.github.com>
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
Validation
Compatibility checklist
The latest main changes from #424 are included without rewriting upstream history. Existing dependency alerts and unrelated generated-artifact quality limitations are outside this bounded fix set.