Repository navigation
fix(desktop): preview downloads skip Save dialogs and dark-mode pages stay visible - #983
Merged
Merged
Conversation
Adapted 5cc99e1c23980d7995a13c47f969b47cb68ed1be: save agent-driven downloads as browser artifacts, preserving human Save dialogs and Pylon preview partition identity. Port the takeover and queued-action regression test. Adopted 3e60fecf39f37faaca9bdf37e64b7a58229ea547: initialize an opaque webview base background so dark-scheme Markdown and plain text remain visible, including after webview replacement. Preserve Pylon recording, screenshot, profile, and browser session behavior.
Contributor
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
…avigation out of capture Limit captured downloads to 200 MiB each and five files including active transfers. Store captures separately from thread artifacts, prune oldest completed downloads and expire them after 24 hours, cancel stalled transfers, and report failures through the agent snapshot action timeline. Clear capture ownership and invalidate pending automation before human toolbar navigation. Cover byte limits, storage reservation, pruning, expiry, cancellation reporting, and each toolbar action while preserving recordings and screenshots.
…load capture Thread explicit navigation origin through the desktop bridge, IPC, preview UI, and automation hosts. Human navigation clears download ownership; agent navigation marks ownership before navigation can start a download. Preserve legacy human defaults for IPC requests without origin. Remove toolbar epoch changes so pending automation retains its prior behavior. Refuse symlinked or non-directory captured download storage before writing, pruning, or cleaning partial files. Cover origins, attachment downloads, pending evaluate completion, and symlink refusal.
Create new automation tabs without a URL so the webview attaches blank. After registration and readiness, navigate with agent origin for both new and reused tabs, marking download capture ownership before an attachment URL loads. Cover opening an attachment without an existing tab and with reuseExistingTab disabled, including blank creation and origin-aware navigation ordering.
Recover ERR_ABORTED only when an agent navigation observes an admitted download capture on the same WebContents while loadURL is pending. Return the remaining page URL and a started-download receipt with filename, artifact path, and advertised size when known; preserve ordinary navigation results and all unrelated failures. Forward receipts through IPC and return them from fresh-tab open and reused-tab navigate without waiting for a page load that a download cannot complete. Cover aborted navigation with and without capture, stale captures, other errors, response URLs, and receipt serialization.
This was referenced Oct 3, 2026
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.
Agent-driven preview downloads now save to browser artifacts without opening native Save dialogs. Human takeover and URL-bar navigation restore normal download behavior. Preview webviews also receive an opaque base background so dark-mode Markdown/plain-text pages remain visible across webview replacements.
Sources:
Pylon recording and screenshot code is preserved. No helpers were deleted.
Verification:
env -u CLAUDE_CODE_ENABLE_TODO_TOOLS vp test run apps/desktop/src/preview/Manager.test.ts apps/desktop/src/preview/BrowserSession.test.ts apps/desktop/src/ipc/methods/preview.test.ts apps/desktop/src/window/DesktopWindow.test.tsPassed: 4 files, 144 tests; final run took 3.49 seconds.
vp run -F @t3tools/desktop typecheckPassed, exit 0, after dependency installation completed. Base and ported files produced identical advisory diagnostics.
vp lint apps/desktop/src/preview/Manager.ts apps/desktop/src/preview/Manager.test.tsPassed, exit 0.
vp fmt --check apps/desktop/src/preview/Manager.ts apps/desktop/src/preview/Manager.test.tsPassed: both files correctly formatted.
git diff --checkPassed.
Remaining verification: no live Electron download/dialog or visual dark-mode check was performed. Local, remote, and tunnel desktop sessions were not exercised interactively.
Part of upstream cycle #981. Ported with Codex (relay); pushed and opened by Claude Opus 5.5 (Claude Code).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Review rounds
Six adversarial review rounds (Codex via relay). The original port only redirected agent downloads. Review hardened it in five ways:
agent-downloadsdirectory and are pruned there; recordings and screenshots are never touched. A symlinked download directory is refused.ERR_ABORTED. A download only counts if it comes from the main frame, its URL chain matches the navigation, and the navigation is still the current request. A one-second window covers a rejection that arrives before the capture.Final review at
3a9cb8de8d: MERGE. Not exercised in a running Electron app: live downloads and Save dialogs.