Skip to content

fix(desktop): make session trash tolerate missing artifacts#6085

Merged
SivanCola merged 2 commits into
main-v2from
codex/session-trash-missing-path
Jul 6, 2026
Merged

fix(desktop): make session trash tolerate missing artifacts#6085
SivanCola merged 2 commits into
main-v2from
codex/session-trash-missing-path

Conversation

@SivanCola

@SivanCola SivanCola commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fix desktop topic/session trash cleanup when a session transcript or sidecar disappears before or during the move. Previously this could surface the raw Windows error The system cannot find the path specified and leave the sidebar topic feeling stuck.
  • Make trash cleanup idempotent: if the source path is already gone, treat that artifact as already removed and continue moving any remaining artifacts. Real blocking errors, such as inaccessible destinations or busy live sessions, still propagate.
  • When the source vanishes mid-copy, drop the partially written destination before treating the artifact as already moved, so the trash never keeps a truncated transcript that a later restore would resurrect. Real copy failures still propagate and leave the source untouched.
  • Add regression coverage for copy fallback missing-source races, for removing a stale topic whose session path no longer exists, and for partial-destination cleanup when the source vanishes mid-copy.

Verification

  • cd desktop && go test . -run "Test(MovePathIfExistsCopyFallback|CopyFallbackTreatsMissingSourceAsAlreadyMoved|CopyFallbackRemovesPartialTargetWhenSourceVanishesMidCopy|CopyFallbackKeepsErrorWhenSourceStillExists|TrashTopicRemovesStaleMissingSession|TrashTopicMovesRelatedSessionsToTrash|TrashTopicValidTrashRemovesEmptyLiveStub)"
  • cd desktop && go test . -run "Test(DeleteSessionFile|MovePathIfExists|CopyAndRemove|CopyFallback|TrashTopic|Restore.*Session|PurgeTrashedSession)"
  • cd desktop && go test .
  • git diff --check

Cache impact

Cache-impact: none, desktop session cleanup only; this does not change provider-visible prompts, tool schemas, request serialization, or model context construction.
Cache-guard: cd desktop && go test . plus focused session trash regression tests listed above.
System-prompt-review: N/A

@SivanCola SivanCola requested a review from esengine as a code owner July 6, 2026 08:24
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development desktop Wails desktop app (desktop/**) labels Jul 6, 2026
If the source disappears while the copy fallback is running, copyAndRemove
now removes the partially written destination before treating the artifact
as already moved, so the trash never keeps a truncated transcript that a
later restore would resurrect. Real copy failures still propagate and leave
the source untouched.
@SivanCola SivanCola merged commit bb0dd15 into main-v2 Jul 6, 2026
16 checks passed
@SivanCola SivanCola deleted the codex/session-trash-missing-path branch July 6, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant