fix: recover terminal launch assets throughout runtime lifetime - #415
Conversation
Reproduction update (requested PR-first workflow)
|
Separate Windows CI blocker (not the macOS geometry flake)Windows job: 41 passed / 4 skipped / 6 failed.
No Windows assertion/fixture weakening or encoding patch has been applied during this requested rerun. Keep the PR draft until this compatibility blocker is corrected and verified on Windows. The unchanged-source macOS full gate rerun is still in progress; the original geometry case separately passed 10/10 fixed repetitions. |
Requested rerun completed — do not conflate the failuresSame product code (
The original geometry test passed both the bounded repetition batch and the new full suite. This supports an intermittent/flaky symptom, but does not establish its root cause or turn the original failed run into a pass. Required retry/fallback policy remained unchanged. The complete gate ran with 19 actually staged files in a disposable worktree. Its tree hash matched the PR commit before and after: Draft remains appropriate: Windows has 6 Unicode-path/encoding failures (concrete garbled launcher path evidence); macOS shard 1 separately failed sidebar animation sampling (2 distinct widths versus >3 required). Ubuntu checks/E2E/Web and macOS shards 2/3 passed. Neither CI blocker was patched, skipped, or retried into green in this rerun task. |
Windows-only CI repair completedPer the author’s narrowed scope, no macOS animation code or tests were changed.
The Windows job tested merge |
💡 Change Scope
📝 What Does This PR Do?
Windows compatibility fix verified:
a982704dfixes the Unicode-path script decoding failures. Native Windows CI is green: 49 E2E passed / 4 skipped / 0 failed, including all six formerly failing scenarios and both new Unicode-executable cases. The full local gate also passed. Draft status is retained while the remaining platform checks finish; the author explicitly excluded macOS animation remediation. Historical failures remain documented, with no assertions weakened or retries added.Fix new terminals immediately exiting after a long-running runtime loses its generated shell launch assets. The old Store returned cached paths without checking that the launcher still existed. Missing files were observed; the process that removed them was not established.
.ps1through%~dpn0.ps1, without changing the user’s code page.No node-pty upgrade/patch changes, native FD-leak fix, orphan-directory sweep or POSIX shell behavior changes. The Windows follow-up changes script representation/dispatch only, preserving invocation/cleanup ownership. The installed application was not modified or restarted.
🏗️ Large Change Spec (Required if "Large Change" is checked)
1. Context & Business Logic
Generated launch files must live at least as long as the runtime that publishes their paths. Apple filesystem guidance and Electron's application-specific
userDatadirectory support using an application-owned location instead of assuming temporary files remain available. Preflight repair protects subsequent launches without replaying a possibly executed user command. Windows replacement can fail under a file lock; fallback retains the original command rather than unlinking the destination.The Spec and implementation Plan were explicitly approved after an isolated macOS feasibility check. The Windows-only follow-up scope/plan was also approved. Microsoft documents UTF-8 BOM for non-ASCII Windows PowerShell source and batch path parameter expansion; encoding policy lives in the existing script generator, not a second filesystem writer.
2. State Ownership & Invariants
TerminalAgentTelemetryAssetStoreremains the sole lifecycle owner, delegating filesystem effects/identity checks to its private helper. Composition injects profile location and the existing bounded diagnostic sink; gateway credential ownership and PTY admission remain unchanged.A replacement runtime allocates a new generation; it never adopts old credentials/roots. Crash leftovers can contain private history/plans and are intentionally not age/PID-deleted. Preflight does not eliminate check/open races under continued external mutation.
3. Verification Plan & Regression Layer
OPENCOVE_REQUIRE_STAGED=1 pnpm pre-commit, with required E2E retries=0 and crash fallback disabled; architecture check separately. First full run: 330 passed / 89 skipped / 1 failed. The failure isterminal-output-stability.spec.tsfit proposal equality (83x21 vs Worker/renderer 83x19). The original asset-repair E2E passed. Standalone baseline/current and preceding-test pair checks passed; causality remains unknown. After opening this PR at the author’s request, the same geometry case passed 10/10 fixed repetitions and a new complete local gate passed: 331 E2E passed / 89 skipped / 0 failed, exit 0. This suggests intermittent behavior, not a diagnosed or fixed root cause. No assertion, timeout, skip, or retry policy in the failing test was changed.Windows follow-up — source
a982704d, documentation/head091748c7:OPENCOVE_REQUIRE_STAGED=1 pnpm pre-commitexit 0; related tests 82 passed / 3 skipped, Electron-native recovery 8 passed, full local E2E 331 passed / 91 skipped / 0 failed. Required retries/fallback stayed disabled. Existing Node-vs-Electron SQLite ABI warnings remain in the raw unit log; the dedicated native recovery gate passed.3daf72c(head091748c7into main134b4989), not a macOS mock. All original six failures, both new CMD/PowerShell Unicode-runtime cases, GUI Electron same-path repair, Ctrl-C and cleanup passed. No macOS animation code or tests changed, per the author’s scope decision.091748c7records Windows compatibility and relocates only this PR’s entries to avoid an additive CHANGELOG conflict with main. Merge preview is clean; no unrelated product changes or history rewrite.Historical evidence for
959696bf(retained):OPENCOVE_REQUIRE_STAGED=1 pnpm pre-commitpassed in a disposable worktree with all 19 PR files staged; staged/source tree5cd132ac3c297ed624244c8979e56bc46ec85834matched the committed PR tree before and after verification. This avoids claiming an empty post-commit staged gate passed.路径being interpreted as路径, leading toMODULE_NOT_FOUNDor a missing.ps1path. This was a separate compatibility blocker at that revision, not the geometry flake; it is resolved by the verified Windows follow-up above.app-header.primary-sidebar-hover-animation.spec.ts:241observed 2 distinct width samples, requiring >3. No animation code or assertions were changed in this PR; cause remains unverified.✅ Delivery & Compliance Checklist
pnpm pre-commitis completely green. Latest local run and native Windows CI passed; other platform jobs may still be running, and historical failures remain recorded.CLA.md). GitHublicense/clapassed.DEVELOPMENT.mdarchitectural boundaries.terminal-after-asset-repairto its Playwright report.📸 Screenshots / Visual Evidence
No visual design changes.
workspace-canvas.terminal-agent-assets.mac.spec.tscaptures the usable terminal after repair in its Playwright report; review-only media is not committed. Acceptance uses actual shell output plus filesystem/diagnostic checks, not screenshot appearance alone.