Skip to content

fix(desktop): retry transient clipboard image writes - #2189

Open
Alx8g wants to merge 3 commits into
CapSoftware:mainfrom
Alx8g:fix/retry-clipboard-image-writes
Open

fix(desktop): retry transient clipboard image writes#2189
Alx8g wants to merge 3 commits into
CapSoftware:mainfrom
Alx8g:fix/retry-clipboard-image-writes

Conversation

@Alx8g

@Alx8g Alx8g commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Transient clipboard contention no longer drops an otherwise successful screenshot automation.

The desktop host now retries failed image clipboard writes with a short, bounded exponential backoff. Raw files and rendered project outputs share the same path. Project rendering happens once; each attempt only rebuilds clipboard image data. The clipboard lock is released before waiting, so unrelated operations are not held behind the backoff.

This follows a transient Windows clipboard ownership failure observed in production, where an immediate retry succeeded. A focused test covers the retry bounds, and the existing source-selection tests remain unchanged.

Rust formatting and diff checks pass. Local Cargo tests did not start because Git Bash exited the Visual Studio environment wrapper before Cargo; upstream CI is the compile and test gate. No native clipboard acceptance run was performed for this branch.

Greptile Summary

This PR adds bounded retries for transient desktop clipboard image-write failures while releasing the clipboard lock during backoff.

  • Retries image writes up to four times with 50, 100, and 200 ms delays.
  • Uses the same retry path for file-backed and rendered screenshot images.
  • Renders screenshot projects once, rebuilding only clipboard image data for each attempt.
  • Adds a focused unit test covering retry count and delay bounds.

Confidence Score: 5/5

The PR appears safe to merge, with no actionable defects identified in the bounded clipboard retry implementation.

The retry loop remains bounded, releases the clipboard lock before sleeping, preserves platform-specific clipboard method resolution, and renders project output only once.

Important Files Changed

Filename Overview
apps/desktop/src-tauri/src/automation.rs Adds a bounded clipboard image-write retry helper and test without introducing a concrete correctness, security, or platform-build defect.

Reviews (1): Last reviewed commit: "fix(desktop): retry transient clipboard ..." | Re-trigger Greptile

@superagent-security

Copy link
Copy Markdown

🚨 Contributor flagged. Click here for more info: Superagent Dashboard

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.

1 participant