Skip to content

fix(desktop): surface actionable errors when session cleanup hits a blocked file#6088

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

fix(desktop): surface actionable errors when session cleanup hits a blocked file#6088
SivanCola merged 2 commits into
main-v2from
codex/session-trash-friendly-errors

Conversation

@SivanCola

Copy link
Copy Markdown
Collaborator

Summary

  • Follow-up to fix(desktop): make session trash tolerate missing artifacts #6085. That PR made session trash tolerate missing artifacts; this one covers the remaining real blockers: raw OS errors — Windows sharing violations while antivirus/sync tools hold a transcript, access denied, disk full — previously reached the UI toast verbatim (e.g. The process cannot access the file because it is being used by another process.).
  • Add friendlySessionFileError, which classifies OS-level errnos (platform-specific: sharing/lock violation, access denied, disk full on Windows; EBUSY/ETXTBSY, EACCES/EPERM, ENOSPC/EDQUOT elsewhere) and rewrites them into sanitized, path-free messages with retry guidance, following the errSessionBusyElsewhere precedent. The original error is logged via slog.Warn so diagnostics keep the path and errno.
  • Wire it at the UI-facing App entry points — TrashTopic, DeleteTopic, DeleteSession, RestoreSession, PurgeTrashedSession — via thin exported wrappers. Unrecognized errors (validation errors, already-sanitized busy errors, not-exist) pass through unchanged.
  • Add unit coverage: each blocked-file class maps to its sanitized message and never leaks the path; nil, plain, busy, and not-exist errors pass through untouched.

Verification

  • cd desktop && go test . -run "TestFriendlySessionFileError"
  • cd desktop && go test .
  • cd desktop && GOOS=windows GOARCH=amd64 go build .
  • git diff --check

Cache impact

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

…locked file

Raw OS errors from session trash/restore/purge — Windows sharing
violations while antivirus or sync tools hold a transcript, access
denied, disk full — previously reached the UI toast verbatim. Map them
at the App entry points (TrashTopic, DeleteTopic, DeleteSession,
RestoreSession, PurgeTrashedSession) to sanitized, path-free messages
with retry guidance, following the errSessionBusyElsewhere precedent.
The original error is logged so diagnostics keep the path and errno;
unrecognized errors pass through unchanged.
@SivanCola SivanCola requested a review from esengine as a code owner July 6, 2026 09:28
@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
@SivanCola SivanCola merged commit f50babf into main-v2 Jul 6, 2026
14 checks passed
@SivanCola SivanCola deleted the codex/session-trash-friendly-errors branch July 6, 2026 12:36
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