Skip to content

fix(shell): retry clipboard reads briefly before failing (#38) - #191

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

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

Conversation

@JavaZeroo

Copy link
Copy Markdown
Owner

内容

托管机上剪贴板可能被短暂占用(Explorer/相邻进程),一次 OpenClipboard 失败就当成"永久拒绝"会表现为粘贴不发生、场景等到超时(stage 35 形状)。

改动:

  • 读路径(read_unicode_clipboard → 粘贴):遇到 ERROR_ACCESS_DENIED 时最多重试 5 次、退避 20/40/60/80 ms(总计 ≤200 ms),仍失败才抛错;
  • 写路径(复制)保持立即失败,因为 [R2][回归] 定位 hosted 选择复制夹具的 OpenClipboard 5 #85 的复制失败边界契约断言的是第一次 OpenClipboard 结果;
  • 错误类型/消息格式不变(仍是 OpenClipboard: <code>),现有失败路径断言不受影响。

本地验证

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

影响与边界

  • 最坏情况给读路径增加 200 ms,只用于"确实被占用"的情形;
  • 不改写路径、不改错误码/文案、不改任何失败边界断言;
  • 仍需 hosted 复现作业验证是否降低 stage 35 频率(下一步)。

Refs #38 #85

Hosted desktops can hold the clipboard for a few milliseconds; reads now retry five times with a short backoff on ERROR_ACCESS_DENIED, while writes keep the immediate failure the copy boundary contract asserts.
@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:21:43.960869Z
We couldn’t complete this review. Comment @codex review to try again.
4a69077 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 46ed2f3 into main Oct 29, 2026
15 of 16 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