Skip to content

fix(app): stop a leftover install launcher from keeping akou down after the watchdog reopens it - #384

Merged
GeiserX merged 3 commits into
mainfrom
fix/watchdog-reopen-stray-launcher
Oct 10, 2026
Merged

GeiserX merged 3 commits into
mainfrom
fix/watchdog-reopen-stray-launcher

Conversation

@GeiserX

@GeiserX GeiserX commented Oct 10, 2026

Copy link
Copy Markdown
Owner

Last night the watchdog ended a hung 0.6.5 and opened akou again, and nothing came up. The app stayed down for eight hours. A launcher with no app under it had been alive since the install, and open -a activated that instead of starting the app. The same leftover launcher showed up after installing 0.6.2, 0.6.4 and 0.6.5.

Where it comes from: the release wrapper unpacks the app, opens it, then shows an "Installation complete" panel and waits for a click on Close. Until someone clicks, it is that launcher. ElectroBun's wrapper exits by itself when ELECTROBUN_INSTALLER_UI_AUTOCLOSE=1 is set.

What changes:

  • The build writes that variable into the wrapper's Info.plist, so the wrapper exits after the first open however it was opened.
  • The watchdog's reopen stops leftover launchers of the bundle, opens with open -n -a, waits for the new app to answer, tries once more, and writes the outcome to app.log.
  • The app stops leftover launchers of its own bundle when it starts. That covers wrappers from 0.6.5 and older.
  • The cleanup akou start got in fix(cli): let akou start wait out a new bundle's slow first launch instead of failing at 3 s #360 never stopped a real wrapper. The wrapper keeps an exited, unreaped open child, and any child counted as "has an app". The test wrapper now has that child too.
  • The release job opens the built zip for the first time and fails if a launcher is left.

Measured on GitHub's macOS runner with the signed 0.6.5. Without the variable the wrapper stays and a second open starts nothing; with it the wrapper is gone within 10 s:
https://github.com/GeiserX/akou/actions/runs/38039278420

The new first-open check fails on 0.6.5, as it should:
https://github.com/GeiserX/akou/actions/runs/38041558121

Not covered: akou start with a leftover launcher and no app still waits 20 s and fails (akou-an0).

…f akou

The release wrapper unpacks the app on its first open, opens it again and
then waits on an "Installation complete" panel for a click on Close. While
it waits it is a launcher with no app below it, and open, the Dock and
Finder take it for the running app and start nothing. When the watchdog
ended a hung app and ran open -a, that is what happened, and akou stayed
down until someone noticed.

- The build writes ELECTROBUN_INSTALLER_UI_AUTOCLOSE=1 into the wrapper's
  LSEnvironment, so the wrapper exits once it has opened the unpacked app.
- The watchdog's reopen is a process of its own: it stops the bundle's
  launchers left with nothing below them, opens with open -n -a, waits for
  the new app to answer, tries once more, and writes the outcome to app.log.
- The app stops such launchers of its own bundle when it starts.
- A child that exited and was never reaped is not a process below a
  launcher. The real wrapper always has one, the open it ran, so the
  cleanup akou start had never stopped a real wrapper.
- The release job opens the built zip for the first time and fails when a
  launcher is left behind.
@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 18 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: GeiserX/akou/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5bb89801-a5ff-41c3-a833-687547f749dc

📥 Commits

Reviewing files that changed from the base of the PR and between d406195 and 5d4b5e7.


📒 Files selected for processing (20)
  • .github/workflows/release.yml
  • docs/TRAPS.md
  • docs/ux/DESKTOP.md
  • scripts/build-app.ts
  • scripts/first-open.ts
  • scripts/patch-plist.sh
  • scripts/post-wrap.ts
  • scripts/smoke-app.ts
  • src/main/cli/client.ts
  • src/main/cli/heal.ts
  • src/main/index.ts
  • src/main/watchdog.ts
  • tests/api-helpers.ts
  • tests/cli-heal.e2e.test.ts
  • tests/cli-launch.e2e.test.ts
  • tests/fixtures/fake-bundle.ts
  • tests/fixtures/watchdog-app.ts
  • tests/floors.json
  • tests/shell.test.ts
  • tests/watchdog.test.ts

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@GeiserX
GeiserX merged commit 8bf9797 into main Oct 10, 2026
48 checks passed
@GeiserX
GeiserX deleted the fix/watchdog-reopen-stray-launcher branch October 10, 2026 11:17
GeiserX added a commit that referenced this pull request Oct 10, 2026
… and stop ending an app that came back (#385)

The app stopped answering four times in three days on my Mac, and the watchdog ended it each time without leaving a sample. The hangs folder held nothing, and the log did not say why.

The watchdog gave `sample` 5 s and waited on it. Under load that was never enough, and a sample that was cut short said nothing. Twice the app's thread wrote to the log again while the watchdog waited, and it was ended anyway.

What changes:

- The sample runs beside the watchdog for up to 20 s. The log then says where the file is and where the main thread was, or why there is no sample.
- A second line gives the load average and how late the watchdog's own ticks ran. Ticks seconds late mean the whole process was starved, not one thread stuck.
- A thread that answers before the sample is done is not ended.

The cause of the four hangs is not found. What the logs show: three came within about a minute of a load average of 60 to 97 on that Mac, and the fourth three and a half minutes before one. A scratch app idle for 13 minutes on a generated library of 5,000 calls never answered slower than 10 ms, so a library scan is not it as far as measured. The next hang will carry the evidence.

Stacked on #384, which changes the same file. Merge that one first; this diff then shrinks to its own commit.
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.

1 participant