Skip to content

fix(shell): short retry window for clipboard writes (#38) - #192

Merged
JavaZeroo merged 1 commit into
mainfrom
fix/clipboard-write-retry
Oct 29, 2026
Merged

JavaZeroo merged 1 commit into
mainfrom
fix/clipboard-write-retry

Conversation

@JavaZeroo

Copy link
Copy Markdown
Owner

内容

把上一 PR 的"读重试"推广到写路径(复制),用更短窗口以保住失败边界契约:

  • ClipboardAccess 改为接受 (attempts, first_delay_ms);
  • 读(粘贴):5 次,退避 20/40/60/80 ms;
  • 写(复制):3 次,退避 10/20 ms(≤60 ms);
  • 失败时仍抛 ClipboardError("OpenClipboard", 5),状态栏文案与窗口标题不变。

为什么失败边界契约仍然成立

#85 的复制失败用例由自有意持有的剪贴板所有者制造(scenario 在阶段之间一直持有),持续时长远大于 60 ms;重试只会让"瞬时占用"不再报错,不会把"持续拒绝"变成成功。

本地验证

clipboard_policy_test.exe -> clipboard owner policy checks passed (exit 0)
test_actions 本地场景     -> Ran 1 test in 5.018s OK

风险与验证计划

Refs #38 #85

ClipboardAccess takes explicit attempts and delay; reads keep five attempts, writes use three short ones (<=60ms) so micro-contention stops failing the copy while the owned negative fixture still produces the same OpenClipboard: 5 status.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-29T16:38:58.615815Z
We couldn’t complete this review. Comment @codex review to try again.
3fe57d6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@JavaZeroo
JavaZeroo merged commit 2aa0723 into main Oct 29, 2026
9 of 10 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.

1 participant