Skip to content

test(shell): 报告剪贴板 owner 的首次失败步骤 (#85) - #218

Merged
JavaZeroo merged 1 commit into
mainfrom
fix/owner-failure-step
Oct 30, 2026
Merged

JavaZeroo merged 1 commit into
mainfrom
fix/owner-failure-step

Conversation

@JavaZeroo

Copy link
Copy Markdown
Owner

问题

剪贴板 owner 的失败文案用的是当前步骤(step_),而 win32_error 用的是首次失败的错误码(native_error_)。所以上一条样本:

step=DestroyWindow-cleanup win32_error=5 worker_error=5

看起来像 DestroyWindow 失败(错误码 5),但 5 其实是更早那次失败的错误码,DestroyWindow 只是清理时最后更新到的步骤——真正的失败步骤被掩盖了。

修改

失败文案改为同时给出两个字段:

failure_step=<首次失败所在步骤> state_step=<当前/清理步骤> win32_error=... worker_error=...

failure_step_ 本来就已经被 record_failure() 记录了,只是没有输出。

边界

  • 只改异常文案,不改 JSON 结构字段(failure_step/secondary_failure_step 等仍按原样产出);
  • 不改变清理顺序与判据。

Refs #85 #99

The message used the current cleanup step together with the first error code, which made a stale cleanup step look like the failing call; it now prints failure_step and state_step separately.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

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 ✅ Completed 2026-10-30T00:17:18.174810Z 0a90489 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 chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0a9048948c

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

std::string ready_failure(DWORD wait_status) const {
return std::string("clipboard owner failed its bounded ready handshake: mode=")+
(delayed_?"delayed":"occupied")+" step="+step_.load()+
(delayed_?"delayed":"occupied")+" failure_step="+failure_step_.load()+

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Handle an unset failure step when readiness times out

If the ready handshake times out before the worker records a failure, failure_step_ is still nullptr. The constructor explicitly calls ready_failure() when ready_status != WAIT_OBJECT_0, even when error_ is zero, so concatenating this pointer into a std::string invokes undefined behavior instead of reporting the blocked step. This can crash the scenario before its diagnostic is emitted and before stop() runs. Load the pointer once and substitute the current step or a non-null sentinel when no failure has been recorded.

Useful? React with 👍 / 👎.

@JavaZeroo
JavaZeroo merged commit e8da6d9 into main Oct 30, 2026
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