Skip to content

move process end and priority off the UI thread - #43

Merged
cursor[bot] merged 1 commit into
mainfrom
cursor/process-actions-off-ui
Nov 3, 2026
Merged

cursor[bot] merged 1 commit into
mainfrom
cursor/process-actions-off-ui

Conversation

@JamesLinYJ

Copy link
Copy Markdown
Owner

Summary

End Process, End Process Tree, and Set Priority no longer call TerminateProcess, walk the process tree, or call SetPriorityClass on the UI thread.

  • Confirmation dialogs stay on the UI thread and keep the existing text.
  • After confirmation, the verified ProcIdentity and the action go to one persistent SingleFlightWorker. Clicks do not spawn a thread, and a second confirmed action is queued behind the one already running.
  • The worker re-opens the target with open_process_for_identity and requires both pid and creation_time_100ns before it acts. An unknown or mismatched identity does not terminate a process, walk a tree, or change priority.
  • A tree that only partly ends still uses the existing partial-failure dialog.
  • Completion reuses PWM_PROC_WORKER_COMPLETE and is drained next to the process sampler. No new window message is added.
  • The worker is dropped with the page and is not joined on the UI thread.
  • Debug, Open File Location, and Affinity are unchanged. No new user-visible strings.

Test plan

  • cargo check --all-targets --locked
  • cargo clippy --all-targets --locked -- -D warnings
  • cargo fmt --all -- --check
  • cargo test --all-targets --locked — not run here. This environment has no link.exe, so the Windows MSVC test binary cannot be linked. Resource compilation also needs llvm-rc, which was not installed.
  • On Windows, end a process and a process tree, including a tree that only partly terminates, and change priority. Confirm the UI stays responsive and the existing dialogs still appear.
Open in Web Open in Cursor 

Confirm End Process, End Process Tree, and Set Priority on the UI thread,
then run them on one persistent SingleFlightWorker. Re-open each target
with pid and creation time before TerminateProcess, the tree walk, or
SetPriorityClass. A partial tree failure still uses the existing dialog.

Co-authored-by: jameslincn <jameslincn@outlook.sg>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 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-11-03T05:15:42.687700Z d001b5a 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.

@cursor
cursor Bot merged commit 0251106 into main Nov 3, 2026
3 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.

2 participants