Repository navigation
fix(session): keep temporary-task attachments readable after branching - #815
Merged
Merged
Conversation
Allow explicit file previews without requiring a project. Copy referenced pasted inputs into each fork so its transcript remains readable independently of the source task. Keep scratch access scoped to the current session and remove copied inputs if fork publication fails. Cover preview navigation, bounded forks, retained context, source deletion and rollback.
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.
Pasting long text into a temporary task saves a file, but clicking the sent attachment shows “Open a project to browse files.” After Branch from here, the copied attachment instead reports “No file matches”: its path still belongs to the source task.
This makes explicit attachment previews work without a project and gives each branch its own copy of the referenced pasted/imported inputs. Deleting the original task then leaves the branch attachment readable.
Native macOS recording, before and after (53 seconds, 1920×1440). English UI and step annotations, highlighted results, 1–2× playback with idle waits trimmed. These are isolated builds of the real desktop app using a localhost model fixture; no UI or file-read results are mocked.
attachment-fix-before-after-hd.mp4
The production change is limited to
FilesTab, the existing fork operation, and its file-copy helper. Only referenced existing files underscratch/<session>/pasted/are copied; unrelated scratch outputs are excluded. Failed forks clean up their copies, and already-expired files remain unavailable. No cross-session read permission, IPC, or database schema change. ADR 0023 and the corresponding English/Chinese specs and E2E scenario reflect the attachment exception to scratch isolation.Regression coverage checks temporary preview/back navigation, bounded and repeated forks, retained checkpoint paths, source deletion, and rollback. Both original failures were demonstrated before the fixes.
Validation details
8ffb30e70cce373857a736a6549233feb806c714.0111e306c120ad5820688d7608cb37bad8fbcc1f; upstream, fork, and local main matched before publication.c2c03705ce1c207544a7d0f9a110abbf04a259a6has the same tree as the tested head (0a79f39a7bc3904e5aa3258f16ac497e4a837d93).node scripts/e2e-composer-paste.mjspassed on the final candidate with rebuilt preload, including saved-byte verification and temporary-task preview/back.cargo test -p host-core --locked: 583 passed; Desktop tests: 2523 passed. Final commit adds only documentation to the tested Rust tree.cargo fmt --check, docs/locale checks, and PR-base check passed. Clippy completed with the existinguser_skills.rs:921warning.