feat(autostart): add autostart_on_first_run config option - #131
Conversation
When enabled, aw-qt registers itself as a login item on first launch, recording a marker in the data dir so a user who later disables start-at-login from the tray is never overridden. Failures write no marker and retry on the next launch. Off by default; intended for Research Edition builds, where participant machines must resume tracking after reboots without setup steps.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Greptile SummaryAdds a configurable first-launch flow that enables OS start-at-login outside testing mode and records successful activation so later user changes are preserved.
Confidence Score: 4/5The marker-write failure path should be fixed before merging because it can terminate aw-qt after successfully changing the user's OS login registration. The new startup path handles registration failures but not the equally fallible marker persistence step, allowing filesystem errors to abort application initialization and leave retry state inconsistent. Files Needing Attention: aw_qt/autostart.py, aw_qt/main.py Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Load aw-qt configuration] --> B{autostart_on_first_run and not testing?}
B -- No --> G[Continue application startup]
B -- Yes --> C{Platform supported?}
C -- No --> G
C -- Yes --> D{Marker exists?}
D -- Yes --> G
D -- No --> E[Enable OS start-at-login]
E --> F[Write success marker]
F --> G
Reviews (1): Last reviewed commit: "feat(autostart): add autostart_on_first_..." | Re-trigger Greptile |
| except AutostartError as e: | ||
| logger.warning( | ||
| f"Could not enable autostart on first run (will retry next launch): {e}" | ||
| ) |
There was a problem hiding this comment.
When OS autostart is enabled successfully but the marker cannot be written, the unhandled filesystem exception terminates aw-qt before its manager or tray starts. No marker remains, so a later launch also retries registration and can override a subsequent user disable.
Knowledge Base Used:
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3459be9edc
ℹ️ 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".
| if config.autostart_on_first_run and not testing: | ||
| autostart.ensure_enabled_on_first_run() |
There was a problem hiding this comment.
Preserve the selected profile in the login command
When a custom section such as [aw-qt-research] enables this option and aw-qt is launched with --profile research, this call registers the profile-agnostic command produced by autostart._command(); export_profile() only changes the current process environment, which is not retained by the OS login item. After reboot, the login item therefore starts the default profile rather than the research profile, potentially recording experiment data into the wrong instance. Pass the profile through to the registered command/environment or restrict this option to DEFAULT_PROFILE.
Useful? React with 👍 / 👎.
Adds an
autostart_on_first_runconfig key (defaultfalse) to[aw-qt]. When true, aw-qt enables OS-level start-at-login (via the #127 machinery) on first launch and drops a marker file in the data dir so the user's later choice is always respected: disabling from the tray never gets overridden, and a failed enable writes no marker so it retries next launch. Skipped under--testingand on unsupported platforms.Motivation: Research Edition study deployments (participants must survive reboots with zero setup; see the #127 motivation). The research CI build will flip this default to
truevia the existing config-patching step in the bundle repo — follow-up PR there.Tests cover: enable+marker, marker-prevents-reenable, failure-no-marker-no-raise, unsupported-noop.