← Back to Pull requests

fix: keep Launch at Login off until approval is granted #1173

Closed
SebTardif closed this pull request without merging on Nov 14, 2026 09:26 UTC
View on GitHub
SebTardif SebTardif commented on Nov 06, 2026 21:47 UTC
Author

What Problem This Solves

Turning on Launch at Login called register() and left the switch on even when macOS still required approval. Turning it on again then called register() on a service that was already pending, so the Login Items handoff could fail. After the user approved Peekaboo, the switch stayed off until settings were loaded again.

Evidence

The switch now reads the current Service Management status before it registers. .notRegistered registers. .requiresApproval opens Login Items and does not call register() again. .enabled leaves the registration alone. Turning the switch off unregisters an enabled or pending service. When General settings appears or becomes active, the switch is set from the current status, so an approval turns it on.

on + notRegistered -> register
on + requiresApproval -> openLoginItems
on + enabled -> none
off + enabled -> unregister
off + requiresApproval -> unregister
off + notRegistered -> none

Real behavior proof

  • Behavior or issue addressed: A pending Launch at Login registration could not open Login Items again, and approval did not turn the switch back on.

  • Real environment tested: macOS, Swift tools, patched LaunchAtLoginRegistration.action and GeneralSettingsView at cc4325f22f6432dd36eb5073b2bed335d1f7dff5. The menu bar switch was not toggled. System Settings was not opened.

  • Exact steps or command run after this patch: Ask action for turning the switch on and off against .notRegistered, .requiresApproval, and .enabled.

  • Evidence after fix: the actions the switch takes:
  • on + notRegistered -> register
    on + requiresApproval -> openLoginItems
    on + enabled -> none
    off + enabled -> unregister
    off + requiresApproval -> unregister
    off + notRegistered -> none
    

  • Observed result after fix: A pending registration opens Login Items without another register(). An enabled service is not registered again. Turning the switch off unregisters it.

  • What was not tested: Approving Peekaboo in the Login Items pane and watching the switch flip after returning to the app.
  • Diff: 147 lines (+145 / -2) across 4 files Reviewer: SebTardif Review duration: 10779m
    All Vouch review confidence checks passed
    Residual risk 0.08 = Change Risk (0.51) × (1 − Review Confidence (0.85)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.51 · 147 lines diff across 4 files
    0.51
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.74 · 5 substantive comment(s)
    0.74
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    84%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.299
    Self Review self_review
    0.140
    Real PR Conversation Timeline
    12 items
    clawsweeper[bot] clawsweeper[bot] commented on Nov 06, 2026 21:47 UTC
    Bot

    <!-- clawsweeper-pr-ack:opened item=1173 -->
    🦞👀
    ClawSweeper picked this up.

    Pull request received. I will update this pull request when review starts.

    <!-- clawsweeper-review-progress:start -->

    ClawSweeper review complete

    ClawSweeper finished reviewing this revision. The review result is being finalized.

    View the workflow run.
    <!-- clawsweeper-review-progress:end -->

    cursor[bot] cursor[bot] commented on Nov 06, 2026 21:47 UTC
    Bot

    PR Summary

    <!-- CURSOR_SUMMARY -->
    Medium Risk
    Touches launch-at-login registration and persistent preferences against Service Management; wrong status handling could leave the toggle out of sync with macOS, but scope stays in settings UI—not auth or sensitive data.

    Overview
    Launch at Login now tracks Service Management status instead of blindly registering.

    PeekabooSettings.launchAtLogin consults LaunchAtLoginRegistration.action: only calls register() when appropriate, opens System Settings Login Items when approval is pending (without duplicating register()), unregisters when turning off unless already unregistered, and reverts the persisted toggle when registration does not reach .enabled. New helpers refreshLaunchAtLoginFromService, applyLaunchAtLoginServiceStatus, and setLaunchAtLogin keep the toggle in sync without recursive saves.

    General settings keeps the switch updated while the user approves in System Settings. GeneralSettingsView refreshes on appear, when the scene becomes active, when the app becomes active, and via a background poll (watchLoginItemsApproval) while LaunchAtLoginApprovalWatch says approval may still be pending.

    Unit tests cover the registration action matrix and approval-watch behavior; CHANGELOG notes the user-facing fix.

    <sup>Reviewed by Cursor Bugbot for commit ea81282395fe8d4f9440eb9da4f8f385d35b85e9. Bugbot is set up for automated code reviews on this repo. Configure here.</sup>
    <!-- /CURSOR_SUMMARY -->

    cursor[bot] cursor[bot] commented on code on Nov 06, 2026 21:51 UTC
    Code Review
    Apps/Mac/Peekaboo/Core/Settings.swift:1
    @@ -162,6 +172,16 @@ final class PeekabooSettings {
                     do {
                         if self.launchAtLogin {
                             try SMAppService.mainApp.register()
    +                        let status = SMAppService.mainApp.status
    +                        if !LaunchAtLoginRegistration.accepted(status) {
    +                            self.isLoading = true
    +                            self.launchAtLogin = false
    +                            self.isLoading = false
    +                            self.save()
    +                            if LaunchAtLoginRegistration.needsLoginItemsApproval(status) {
    +                                SMAppService.openSystemSettingsLoginItems()
    +                            }
    +                        }

    Retry enable reverts registered login item

    Medium Severity

    <!-- DESCRIPTION START -->
    After register() returns .requiresApproval, launchAtLogin is forced off while the login item stays registered. Turning the switch on again calls register() on that already registered service, which fails with kSMErrorAlreadyRegistered or kSMErrorLaunchDeniedByUser. The catch path then snaps the toggle back off and does not open Login Items, so the same-session enable flow cannot complete.
    <!-- DESCRIPTION END -->

    <!-- BUGBOT_BUG_ID: ccd650bd-6af3-4cfc-b120-d8f7c91f153d -->

    <!-- LOCATIONS START
    Apps/Mac/Peekaboo/Core/Settings.swift#L172-L184
    Apps/Mac/Peekaboo/Core/Settings.swift#L187-L193
    LOCATIONS END -->
    <details>
    <summary>Additional Locations (1)</summary>

  • Apps/Mac/Peekaboo/Core/Settings.swift#L187-L193
  • </details>

    <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjgzNGZhNjhkLTAxMDEtNGQ5OC1hYTdmLTRjYmYzZjEyMzI3NyIsImVuY3J5cHRpb25LZXkiOiJoeGxzOG0yMDJCNDVGaDRpSGpwNkVrcGd6NUFib0RONm9faDB3NHhxR1pzIiwiYnJhbmNoIjoiZml4L2xhdW5jaC1hdC1sb2dpbi1hcHByb3ZhbCIsInJlcG9Pd25lciI6Im9wZW5jbGF3IiwicmVwb05hbWUiOiJQZWVrYWJvbyIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjgzNGZhNjhkLTAxMDEtNGQ5OC1hYTdmLTRjYmYzZjEyMzI3NyIsImVuY3J5cHRpb25LZXkiOiJoeGxzOG0yMDJCNDVGaDRpSGpwNkVrcGd6NUFib0RONm9faDB3NHhxR1pzIiwiYnJhbmNoIjoiZml4L2xhdW5jaC1hdC1sb2dpbi1hcHByb3ZhbCIsInJlcG9Pd25lciI6Im9wZW5jbGF3IiwicmVwb05hbWUiOiJQZWVrYWJvbyIsInByTnVtYmVyIjoxMTczLCJjb21taXRTaGEiOiIxM2I5Y2I2MzJiNDA0NGNjMTg5N2EzODAzNDgzNzY0MjI1MGVkMTNmIiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div>

    <sup>Reviewed by Cursor Bugbot for commit 13b9cb632b4044cc1897a38034837642250ed13f. Configure here.</sup>

    cursor[bot] cursor[bot] commented on Nov 06, 2026 21:51 UTC
    Reviewer

    <!-- BUGBOT_REVIEW -->
    <!-- BUGBOT_REVIEW_STALE -->
    Stale Bugbot comment from a previous run.

    clawsweeper[bot] clawsweeper[bot] commented on Nov 06, 2026 22:01 UTC
    Bot

    Codex review: needs real behavior proof before merge.

    What this changes

    The PR makes Launch at Login reflect macOS approval status and refreshes the switch when Settings becomes active.

    Example: Peekaboo's login registration has status requiresApproval.

  • Before: Enabling the switch calls register again instead of reopening Login Items.

  • After: Enabling the switch opens Login Items, and returning after approval refreshes it to on.
  • Review scores

    | Measure | Result | What it means |
    |---|---|---|
    | Overall readiness | 🧂 unranked krab (1/6) | The focused implementation addresses the earlier findings, but helper-only output does not satisfy the required real-app proof. |
    | Proof confidence | 🧂 unranked krab (1/6) | Real behavior proof is necessary before merge. See [Before merge](#before-merge). |
    | Patch quality | 🐚 platinum hermit (4/6) | No actionable review findings were identified. |

    Product

    Kind: Bug fix · Worth it: Yes · Fix scope: Complete
    User problem: The switch can imply startup is enabled while approval is pending and can fail to guide the user back to Login Items.
    Reason: The repair makes the existing control match the same Service Management state already used when settings load.

    Merge readiness

    ⛔ Blocked before merge - 1 item remains

    This PR addresses a current-main settings bug and resolves both earlier source findings; no new concrete correctness defect was found.

    Priority: P2
    Reviewed head: cc4325f22f6432dd36eb5073b2bed335d1f7dff5

    Before merge

  • Add real behavior proof - The supplied action-matrix output tests LaunchAtLoginRegistration rather than the shipped Mac settings flow. Provide a recording or redacted logs showing initial registration, pending approval reopening Login Items without another registration, approval followed by an enabled switch on return, and successful disabling; include fresh-install and latest-stable upgrade runs preserving existing settings and registration state, and redact personal data, credentials, IPs, and non-public endpoints. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Findings

    None.

    Tests

  • Low-value test Apps/Mac/PeekabooTests/Services/SettingsServiceTests.swift: The added test asserts helper mappings without exercising the settings setter, registration effects, or activation refresh; replace it with coverage through the production settings owner.

  • Missing end-to-end proof: Show the Mac app registering, reopening pending approval, reflecting approval after returning, and disabling registration, including fresh-install and latest-stable upgrade cases; no base-failing production-owner regression is demonstrated.
  • <details>
    <summary><strong>Agent review details</strong></summary>

    How this fits together

    The Mac app's General settings sends switch changes to PeekabooSettings, which calls Service Management and persists the displayed state in UserDefaults.

    flowchart LR
      A[General settings switch] --> B[PeekabooSettings]
      B --> C[Status action mapping]
      C --> D[macOS Service Management]
      D --> E[Login Items approval]
      E --> F[Settings activation refresh]
      F --> B
      B --> G[UserDefaults]
    

    Technical review

    Best possible solution:

    Keep Service Management authoritative and validate the complete approval flow through the Mac app before merging.

    Do we have a high-confidence way to reproduce the issue?

    Current-main source shows unconditional registration and no post-registration approval check; no app reproduction was run during this read-only review.

    Is this the best way to solve the issue?

    The change repairs the existing settings owner and preserves the established enabled-status contract without adding a preference or alternate registration path.

    AGENTS.md: found and applied where relevant.

    Codex review notes: model internal, reasoning medium; reviewed against 85368531db7d.

    Provenance checked

  • Launch at Login setter and loading guard keeps the original intent (026add4b8fcee3c00b8fdc7f51ef1d9384cc4fd3: Prevent recursive saves and startup crashes while loading or reverting the setting.)

  • General settings lifecycle keeps the original intent (https://github.com/openclaw/Peekaboo/pull/261: Restructure Settings while retaining persisted preference keys and existing controls.)
  • Testing

    Proof path: unit tests only.

    Security

    None.

    Evidence

    What I checked:

  • Current-main bug: The existing setter calls register whenever the switch is enabled, without checking pending approval or the resulting service status. (Apps/Mac/Peekaboo/Core/Settings.swift:163, 85368531db7d)

  • Earlier findings addressed: The reviewed head checks pending status before registration and refreshes service state on General settings appearance and scene activation; these changes address both findings from the earlier review. (Apps/Mac/Peekaboo/Core/Settings.swift:201, cc4325f22f64)

  • Existing persistence contract: Loading already derives launchAtLogin from Service Management's enabled status; the patch retains the same Boolean key and loading guard rather than introducing a new stored format. (Apps/Mac/Peekaboo/Core/Settings.swift:492, cc4325f22f64)

  • Behavior provenance: Commit 026add4b added the loading guard to prevent recursive saves and startup crashes; this PR preserves that safeguard. The settings UI restructuring in https://github.com/openclaw/Peekaboo/pull/261 retained the existing preference contract. (Apps/Mac/Peekaboo/Core/Settings.swift:195, 026add4b8fce)

  • Contributor evidence boundary: The full PR body explicitly says the switch was not toggled and System Settings was not opened; its terminal output exercises only the action helper. All four prepared images were inspected and depict Cursor action buttons. (cc4325f22f64)

  • Repository policy applied: Read the full root AGENTS.md; no nested AGENTS.md, maintainer-notes directory, or pr-simplify skill was found. The review remained read-only and the checkout remained clean. (AGENTS.md:1, cc4325f22f64)
  • Preflight source

    Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

    Labels

    Label changes:

    No label changes.

    Label justifications:

  • P2: The bug affects an optional startup preference and its approval handoff, with limited impact on the rest of the app.

  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.

  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.
  • Rank-up moves

    Optional improvements that raise the rating; they are not merge blockers.

  • Replace helper-only assertions with a production-owner regression that fails on the base and passes on the head.
  • Rating scale

    6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

    Workflow

    ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

    History

    <details>
    <summary>Review history (1 earlier review cycle)</summary>

    <!-- clawsweeper-review-history v=1 total=1 -->

  • reviewed 2026-11-06T22:00:55.944Z sha 13b9cb632b4044cc1897a38034837642250ed13f :: needs real behavior proof before merge. :: [P2] Handle pending registration before calling register again | [P2] Refresh the switch when Login Items approval completes
  • </details>

    </details>

    _Reviewed November 6, 2026, 5:49 PM ET / 22:49 UTC (Revision 2)._

    <!-- clawsweeper-verdict:needs-human item=1173 sha=cc4325f22f6432dd36eb5073b2bed335d1f7dff5 confidence=high updated_at=2026-11-06T22:48:01Z reviewed_at=2026-11-06T22:49:37.418Z lease_owner=github-run-42307283552-1 lease_comment_id=6697714143 source_revision=dc875861edf43665a8576261523b602be1dae8bb02cd9753ab8b1203030b6e39 hold=proof findings=0 -->
    <!-- clawsweeper-review-state:blocked item=1173 sha=cc4325f22f6432dd36eb5073b2bed335d1f7dff5 v=1 -->

    <!-- clawsweeper-review-version item=1173 reviewed_at=2026-11-06T22:49:37.418Z sha=cc4325f22f6432dd36eb5073b2bed335d1f7dff5 source_revision=dc875861edf43665a8576261523b602be1dae8bb02cd9753ab8b1203030b6e39 lease_owner=github-run-42307283552-1 lease_comment_id=6697714143 v=1 -->

    <!-- clawsweeper-review item=1173 -->

    SebTardif SebTardif commented on Nov 06, 2026 22:46 UTC
    Author

    @clawsweeper re-review

    A status that already requires approval opens Login Items without calling register again, and Settings rereads the service status when the window becomes active.

    clawsweeper[bot] clawsweeper[bot] commented on Nov 06, 2026 22:47 UTC
    Bot

    <!-- clawsweeper-command-ack:6697712253 -->
    <!-- clawsweeper-command-status:1173:re_review:command-6697712253-mw5kdueo-ff24232217550e6d18252d09878e7b3fa41df5e4e894e39afef134954b49c6e5 -->
    🦞👀
    Exact review queued.

    <!-- clawsweeper-command-progress:start -->
    Re-review progress:

  • State: Complete

  • Detail: The durable review result and its route handoff completed.

  • Run: https://github.com/openclaw/clawsweeper/actions/runs/42307702939

  • Updated: 2026-11-06T22:51:04.598Z

  • <!-- clawsweeper-command-progress:end -->

    cursor[bot] cursor[bot] commented on Nov 06, 2026 22:52 UTC
    Reviewer

    <!-- BUGBOT_REVIEW -->
    Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

    <!-- BUGBOT_FIX_ALL -->
    <a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9BTExfSU5fQ1VSU09SIiwiZGF0YSI6eyJyZWRpc0tleSI6ImJ1Z2JvdC1tdWx0aTpiODM1YjU3Ni0wYmYzLTRjMTMtYjhjMy04N2ZlZWE1OTdiOTYiLCJlbmNyeXB0aW9uS2V5IjoiYzZxbkxleWl3NjJsYkpKZ09meG56TFRjMURqcXpjT1ZaV2NTMmRoLWVuMCIsImJyYW5jaCI6ImZpeC9sYXVuY2gtYXQtbG9naW4tYXBwcm92YWwiLCJyZXBvT3duZXIiOiJvcGVuY2xhdyIsInJlcG9OYW1lIjoiUGVla2Fib28iLCJwcm92aWRlciI6ImdpdGh1YiJ9fQ" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix All in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>
    <!-- /BUGBOT_FIX_ALL -->

    <!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_BEGIN -->
    <sup>❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.</sup>
    <!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_END -->

    <sup>Reviewed by Cursor Bugbot for commit cc4325f22f6432dd36eb5073b2bed335d1f7dff5. Configure here.</sup>

    cursor[bot] cursor[bot] commented on code on Nov 06, 2026 22:52 UTC
    Code Review
    Apps/Mac/Peekaboo/Features/Settings/SettingsWindow.swift:1
    @@ -163,10 +164,16 @@ struct GeneralSettingsView: View {
             }
             .formStyle(.grouped)
             .onAppear {
    +            self.settings.refreshLaunchAtLoginFromService()
                 guard !self.didLoadUpdaterState else { return }
                 self.updater.automaticallyChecksForUpdates = self.autoUpdateEnabled
                 self.didLoadUpdaterState = true
             }
    +        .onChange(of: self.scenePhase) { _, phase in
    +            if phase == .active {
    +                self.settings.refreshLaunchAtLoginFromService()
    +            }
    +        }

    Switch stays off after login approval

    Medium Severity

    <!-- DESCRIPTION START -->
    On macOS, scenePhase typically stays .active when switching to System Settings and back, so onChange never calls refreshLaunchAtLoginFromService while General settings remains open. After Login Items approval the switch stays off until the view appears again, which is the original stale-switch failure.
    <!-- DESCRIPTION END -->

    <!-- BUGBOT_BUG_ID: c08a9513-8bad-4ccf-9b8e-b5ac938094c8 -->

    <!-- LOCATIONS START
    Apps/Mac/Peekaboo/Features/Settings/SettingsWindow.swift#L171-L176
    Apps/Mac/Peekaboo/Features/Settings/SettingsWindow.swift#L101-L102
    LOCATIONS END -->
    <details>
    <summary>Additional Locations (1)</summary>

  • Apps/Mac/Peekaboo/Features/Settings/SettingsWindow.swift#L101-L102
  • </details>

    <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjRiYjYwNDYwLWVjYjAtNDYxMS1iMGRjLWEwMmVjMmM5MjU5MSIsImVuY3J5cHRpb25LZXkiOiJtX3dQMmM2SFVMTlFDNExNZUhSTEpsUVZjTjBiOGsxbGwxOFJTS25WYnUwIiwiYnJhbmNoIjoiZml4L2xhdW5jaC1hdC1sb2dpbi1hcHByb3ZhbCIsInJlcG9Pd25lciI6Im9wZW5jbGF3IiwicmVwb05hbWUiOiJQZWVrYWJvbyIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjRiYjYwNDYwLWVjYjAtNDYxMS1iMGRjLWEwMmVjMmM5MjU5MSIsImVuY3J5cHRpb25LZXkiOiJtX3dQMmM2SFVMTlFDNExNZUhSTEpsUVZjTjBiOGsxbGwxOFJTS25WYnUwIiwiYnJhbmNoIjoiZml4L2xhdW5jaC1hdC1sb2dpbi1hcHByb3ZhbCIsInJlcG9Pd25lciI6Im9wZW5jbGF3IiwicmVwb05hbWUiOiJQZWVrYWJvbyIsInByTnVtYmVyIjoxMTczLCJjb21taXRTaGEiOiJjYzQzMjVmMjJmNjQzMmRkMzZlYjUwNzNiMmJlZDMzNWQxZjdkZmY1IiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div>

    <sup>Reviewed by Cursor Bugbot for commit cc4325f22f6432dd36eb5073b2bed335d1f7dff5. Configure here.</sup>

    SebTardif SebTardif commented on code on Nov 06, 2026 23:30 UTC
    Code Review
    Apps/Mac/Peekaboo/Features/Settings/SettingsWindow.swift:1
    @@ -163,10 +164,16 @@ struct GeneralSettingsView: View {
             }
             .formStyle(.grouped)
             .onAppear {
    +            self.settings.refreshLaunchAtLoginFromService()
                 guard !self.didLoadUpdaterState else { return }
                 self.updater.automaticallyChecksForUpdates = self.autoUpdateEnabled
                 self.didLoadUpdaterState = true
             }
    +        .onChange(of: self.scenePhase) { _, phase in
    +            if phase == .active {
    +                self.settings.refreshLaunchAtLoginFromService()
    +            }
    +        }

    @cursor

    On macOS, scenePhase typically stays .active when switching to System Settings and back, so onChange never calls refreshLaunchAtLoginFromService while General settings remains open.

    Yes. While approval is pending, General rereads Service Management, and it rereads again when the app becomes active. An enabled status turns the switch on without another register(). The Login Items approval test covers that on ea8128239. The Login Items pane was not opened.

    steipete steipete commented on Nov 14, 2026 09:26 UTC
    Contributor

    Thanks! This fix landed as part of #1171, which merged with your credit. Closing this one as folded in.

    Reviewers
    Assignees
    SebTardif SebTardif
    Labels
    risk: low confidence: 84.6% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 51.3% (MEDIUM) · Higher = larger blast radius
    51.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 84.6% · Lower = rushed or shallow review
    84.6%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 7.9% · Safe to merge
    7.9%