Skip to content

fix(session): keep temporary-task attachments readable after branching - #815

Merged
vastsa merged 1 commit into
vastsa:mainfrom
yuxino:codex/task-attachment-fixes
Sep 21, 2026
Merged

vastsa merged 1 commit into
vastsa:mainfrom
yuxino:codex/task-attachment-fixes

Conversation

@yuxino

@yuxino yuxino commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

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 under scratch/<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
  • Candidate: 8ffb30e70cce373857a736a6549233feb806c714.
  • Base: 0111e306c120ad5820688d7608cb37bad8fbcc1f; upstream, fork, and local main matched before publication.
  • GitHub merge candidate c2c03705ce1c207544a7d0f9a110abbf04a259a6 has the same tree as the tested head (0a79f39a7bc3904e5aa3258f16ac497e4a837d93).
  • macOS arm64, Node 24.13.0, pnpm 10.34.5.
  • node scripts/e2e-composer-paste.mjs passed 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.
  • JS build, Desktop typecheck, lint, cargo fmt --check, docs/locale checks, and PR-base check passed. Clippy completed with the existing user_skills.rs:921 warning.
  • Earlier Electron suite attempts intermittently failed at the existing image-preview Tab-focus or pending-paste/session-switch assertions. The unmodified main and final candidate both passed sequential comparison runs. No assertions were weakened; the intermittent failure cause is not established.
  • The native recording verifies the actual attachment workflow and source deletion. A behavior-preserving traversal cleanup and an additional rollback test were validated separately by the final Rust suite. Windows/Linux native validation was not run.

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.
@vastsa
vastsa merged commit 46d4ee4 into vastsa:main Sep 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants