Skip to content

Fix: unify autostart to one per-user Run entry#29

Merged
agr77one merged 1 commit into
mainfrom
fix/autostart-single-source
Jul 1, 2026
Merged

Fix: unify autostart to one per-user Run entry#29
agr77one merged 1 commit into
mainfrom
fix/autostart-single-source

Conversation

@agr77one

@agr77one agr77one commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Unifies autostart to a single per-user Run entry — three independent registrations had drifted out of sync.

The bug

  • Daemon (_act_set_autostart, what the dashboard's "Launch Flowkey when I sign in" toggle drives): HKCU\...\Run\FastFlowPrompt
  • install.ps1 (source install): HKCU\...\Run\Flowkeydifferent value name, same key path. The dashboard toggle couldn't see or manage this entry, and enabling it afterward added a second, redundant one.
  • installer.iss (packaged installer, optional "autostart" task): HKLM\...\Run\Flowkey — a third, machine-wide mechanism in a different hive.

Any combination could double-launch grammarFix.ahk + the daemon at logon.

The fix

  • install.ps1: $RunKeyName"FastFlowPrompt" (matches ffp_daemon._AUTOSTART_VALUE_NAME exactly).
  • installer.iss: removed the "autostart" Task and its [Registry] HKLM entry entirely — the packaged installer no longer offers machine-wide autostart; added an [UninstallRun] step that cleans up the per-user HKCU value.
  • first_run.py: removed the dead var_autostart_hint (never rendered/read; its comment was now flatly wrong).
  • installer/README.md: corrected the uninstaller description.
  • New test_installer_autostart.py cross-references the daemon's actual constant (not a hardcoded string), so this can't silently drift again.

Also in this PR

Removed the Serena MCP server (unregistered globally + deleted the project's local .serena/ cache) and a stale, long-superseded codex/add-autohotkey-runtime branch on origin — both artifacts of an external agent that had been operating on this project (and had, separately, wiped this repo's local .git earlier in the session — recovered in a prior PR).

Gates: ruff clean · 323 pytest passed (+3) · node --check app.js · AHK parse-check.

🤖 Generated with Claude Code

Three independent autostart registrations had drifted out of sync:
- daemon (ffp_daemon._act_set_autostart): HKCU\...\Run\FastFlowPrompt --
  what the dashboard's "Launch Flowkey when I sign in" toggle reads/writes.
- installer/install.ps1 (source install): HKCU\...\Run\Flowkey -- same key
  path, DIFFERENT value name, so the dashboard toggle couldn't see or manage
  it, and toggling it on added a second, redundant entry.
- installer/installer.iss (packaged installer): optional machine-wide
  HKLM\...\Run\Flowkey via an install-time "autostart" task -- a third,
  independent mechanism in a different hive entirely.

Any combination of these could double-launch grammarFix.ahk + the daemon at
logon. Fix: unify everyone on the one HKCU\...\Run\FastFlowPrompt entry the
daemon owns.

- install.ps1: $RunKeyName "Flowkey" -> "FastFlowPrompt" (matches
  ffp_daemon._AUTOSTART_VALUE_NAME exactly).
- installer.iss: removed the "autostart" Task and its HKLM [Registry] entry
  entirely (the installer no longer offers machine-wide autostart); added an
  [UninstallRun] step that removes the per-user HKCU value on uninstall.
- first_run.py: removed the dead, now-inaccurate var_autostart_hint
  (declared, never rendered/read; its comment claimed "installer owns Run
  key", which is no longer even conceptually true).
- installer/README.md: corrected the uninstaller description.

New test_installer_autostart.py cross-references ffp_daemon's actual
constant (not a hardcoded string) so install.ps1 and installer.iss can never
silently drift from the daemon again.

Also: removed the Serena MCP server (unregistered globally + deleted the
project's local .serena/ cache) and a stale, long-superseded
codex/add-autohotkey-runtime branch on origin -- both were artifacts of an
external agent that had been operating on this project.

Gates: ruff clean, 323 pytest passed (+3), node --check, AHK parse-check.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@agr77one agr77one merged commit 7835d4b into main Jul 1, 2026
5 checks passed
@agr77one agr77one deleted the fix/autostart-single-source branch July 1, 2026 15:30

@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: 73272ad4c3

ℹ️ 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 installer/install.ps1
# install used to register a DIFFERENT value name ("Flowkey") here, so the
# dashboard toggle couldn't see it (and enabling the toggle added a second,
# redundant Run entry -> double launch at logon). See SPEC.md B6 / T10.
$RunKeyName = "FastFlowPrompt"

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 Remove the legacy Flowkey Run value during upgrades

When a user who installed from source with the previous script reruns installer/install.ps1 to upgrade, their HKCU ...\Run\Flowkey value is still present. This line makes the script write FastFlowPrompt instead, but step 5 only adds the new value and never deletes Flowkey, so Windows will launch both commands at sign-in and the dashboard can only toggle the new one. Please migrate/remove the old value before setting $RunKeyName and in -Uninstall.

Useful? React with 👍 / 👎.

Comment thread installer/installer.iss
; reg.exe exits non-zero when the value is absent; that's fine, Inno
; doesn't treat a nonzero [UninstallRun] exit as fatal.
Filename: "{sys}\reg.exe"; \
Parameters: "delete ""HKCU\Software\Microsoft\Windows\CurrentVersion\Run"" /v ""FastFlowPrompt"" /f"; \

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 Clean up the legacy HKLM autostart on installer upgrades

For machines that installed a previous package with the old autostart task selected, upgrading to this installer leaves HKLM\...\Run\Flowkey in place because the new script has no install-time migration for that legacy value. This cleanup only deletes the per-user HKCU\...\Run\FastFlowPrompt; after the upgrade, logon still starts the machine-wide entry that the dashboard cannot see, and enabling the per-user toggle double-launches again. Add an install/uninstall migration that deletes the legacy HKLM value.

Useful? React with 👍 / 👎.

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