Skip to content

Desktop: confirm quit during training - #7790

Merged
Etherll merged 11 commits into
unslothai:mainfrom
NilayYadav:fix-quit-training-guard
Aug 9, 2026
Merged

Etherll merged 11 commits into
unslothai:mainfrom
NilayYadav:fix-quit-training-guard

Conversation

@NilayYadav

Copy link
Copy Markdown
Collaborator

Quitting with Cmd+Q or the app menu killed a running training job with no warning. The tray "Quit" item asks first; those paths reach the runtime directly and skipped it.

Handles RunEvent::ExitRequested with code: None (user-initiated quit only, so a programmatic exit or updater restart is unaffected) and shows the same confirmation. The dialog blocks, so it runs off the event loop. Also covers quitting mid-install, which had the same gap.

@NilayYadav

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: e47e9508f1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread studio/src-tauri/src/main.rs Resolved

@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: ece43efc75

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread studio/src-tauri/src/main.rs Resolved
@NilayYadav

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 359971dd5c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@NilayYadav

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: de65a00527

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@Etherll

Etherll commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 70e2c8cf08

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

@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: 9da09c7f5f

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

Comment thread studio/src-tauri/src/main.rs Outdated
Comment on lines +1063 to +1066
} else {
// Another quit path already has the dialog up; deny this request
// rather than promise a reply nobody will send.
NS_TERMINATE_CANCEL

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 Keep overlapping system termination pending

When a macOS logout/restart request arrives while a menu or tray quit confirmation already owns QUIT_IN_PROGRESS, spawn_quit_confirmation returns false and this branch returns NSTerminateCancel. AppKit therefore aborts the system operation even if the user accepts the already-visible dialog, because that dialog only calls app.exit and cannot reply to the canceled termination request. The remaining false-result branch is fresh evidence beyond the earlier NSTerminateLater fix; attach the pending system request to the existing confirmation instead of canceling it.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Fixed in 80307ae: overlapping AppKit termination now attaches to the active menu or tray confirmation and receives the same final reply. Completion atomically closes attachment before draining the pending request, and panic paths reply false. Native macOS validation passed 200 Rust tests and all 25 lifecycle cases, including confirm, cancel, overlap, duplicate, and injected panic paths.

@Etherll

Etherll commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

@codex review

1 similar comment
@Etherll

Etherll commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

@codex review

Etherll pushed a commit to Etherll/unsloth that referenced this pull request Aug 8, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 80307ae78a

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

Etherll added 2 commits August 9, 2026 14:06
Preserve the Windows WebView guards and the macOS quit interception setup.
@Etherll
Etherll merged commit 4c6aa87 into unslothai:main Aug 9, 2026
35 of 40 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