fix(desktop): surface actionable errors when session cleanup hits a blocked file#6088
Merged
Merged
Conversation
…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.
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.
Summary
The process cannot access the file because it is being used by another process.).friendlySessionFileError, which classifies OS-level errnos (platform-specific: sharing/lock violation, access denied, disk full on Windows;EBUSY/ETXTBSY,EACCES/EPERM,ENOSPC/EDQUOTelsewhere) and rewrites them into sanitized, path-free messages with retry guidance, following theerrSessionBusyElsewhereprecedent. The original error is logged viaslog.Warnso diagnostics keep the path and errno.TrashTopic,DeleteTopic,DeleteSession,RestoreSession,PurgeTrashedSession— via thin exported wrappers. Unrecognized errors (validation errors, already-sanitized busy errors, not-exist) pass through unchanged.Verification
cd desktop && go test . -run "TestFriendlySessionFileError"cd desktop && go test .cd desktop && GOOS=windows GOARCH=amd64 go build .git diff --checkCache 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 focusedTestFriendlySessionFileErrortests listed above.System-prompt-review: N/A