Skip to content

fix(cli): let akou start wait out a new bundle's slow first launch instead of failing at 3 s - #360

Merged
GeiserX merged 2 commits into
mainfrom
fix/start-launch-wait
Oct 9, 2026
Merged

GeiserX merged 2 commits into
mainfrom
fix/start-launch-wait

Conversation

@GeiserX

@GeiserX GeiserX commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Problem

The first akou start after installing a new build failed with "akou did not answer within 3 s of launching", while app.log showed the app starting a moment later (#356). The first open of a new bundle is slow: Gatekeeper assesses it, and the wrapper unpacks the app over itself and opens it again. The CLI gave up at 3 s. The wrapper then stayed behind, idle and with no child. While it ran, every later open -a took it for the running app and started nothing, so the CLI could not start akou until that process was stopped.

Fix

  • The CLI keeps waiting, up to 20 s, while the launch is still in progress. It counts as in progress while the program the CLI ran is alive, a process holds the app lock, or a process of the bundle is running.
  • When none of those is alive for half a second, it fails at once. The error still names launch.log and app.log, and now says how the launched program ended.
  • Once the app answers, it stops the bundle's launchers that have nothing below them. It never stops the app's own launcher, nor the process asking or anything above it.
  • APP_LOCK moves to app-info.ts, so the client reads the lock without loading the app. The design's 3 s cold target is unchanged. Only the point where the CLI gives up moves.

Tests

Red before the fix, green after, in tests/cli-launch.e2e.test.ts:

  • An app that answers 4 s after launch is waited for.
  • A fake bundle whose wrapper unpacks, relaunches and stays: the CLI waits past open. Afterwards the wrapper is gone, and the app and its launcher are still running.
  • Positive controls: a launched program that exits, and an open that starts nothing. Both fail in under 2 s, naming both logs.

Also added:

  • A second launch whose own program exits at once keeps waiting while the first app holds the lock. This guards concurrent launches against the fail-fast path.
  • strayLaunchers unit cases in tests/cli-heal.e2e.test.ts, including the process asking and its ancestors.

The two bundle tests need ps and skip on Windows. check:win32 maxSkip goes from 92 to 94.

Not verified: a real first open of a freshly installed signed DMG bundle. The wrapper's behaviour is modelled on the process table recorded in docs/gates/dc-k1-accessibility-grant.md and the G3 and G7 notes.

Closes #356

… up at 3 s

The first open of a newly installed bundle takes longer than 3 s: Gatekeeper
assesses it, and the wrapper unpacks the app over itself and opens it again.
`akou start` gave up at 3 s while the app was about to answer, and the wrapper
stayed behind, idle, so every later `open -a` took it for the running app.

The CLI now waits up to 20 s while the launch is still in progress (the
program it ran, a process holding the app lock, or a process of the bundle is
alive), fails within half a second once none is, and once the app answers
stops the bundle's launchers that have nothing below them, never the app's.

APP_LOCK moves to app-info.ts so the client reads the lock without loading
the app.

Closes #356
@coderabbitai

coderabbitai Bot commented Oct 9, 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 53 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: 2f7171b2-00bb-4a51-9374-d9f4ec5f6400

📥 Commits

Reviewing files that changed from the base of the PR and between 121d948 and 360075a.


📒 Files selected for processing (10)
  • docs/TRAPS.md
  • src/main/app-info.ts
  • src/main/cli/client.ts
  • src/main/cli/heal.ts
  • src/main/index.ts
  • tests/cli-heal.e2e.test.ts
  • tests/cli-launch.e2e.test.ts
  • tests/fixtures/fake-bundle.ts
  • tests/fixtures/slow-app.ts
  • tests/floors.json


  • 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 1f06887 into main Oct 9, 2026
29 checks passed
@GeiserX
GeiserX deleted the fix/start-launch-wait branch October 9, 2026 15:17
GeiserX added a commit that referenced this pull request Oct 9, 2026
…aker and akou start and akou quit finish (#374)

## Problem

On 0.6.4, with the Nemotron diarizer on, every call line waited about 2 s for its speaker before it reached the transcript. The first `akou start` after an install gave up at 3 s while the app was still coming up. `akou quit` on Linux could hang after a call. All three are fixed on main and no release carries them yet.

## What 0.6.5 ships

- A call line is written when its segment closes, and its speaker follows as a correction to the same line (#359).
- `akou start` waits up to 20 s for a slow first launch and stops the idle launcher afterwards (#360).
- `akou quit` always finishes on Linux (#367).
- A search hit names the speaker who said the matched word (#365).
- A file job without speaker labels fetches, and is admitted for, only the models it runs (#364).
- Three messages no longer point at a command that cannot help (#366).
- Behind the scenes: G1 and G3 pass, G4, G6 and G7 stay Partial (#354, #357, #358, #362, #363, #371, #372), the dictation audio tests wait for the write (#361), and `glama.json` (#373).

The Known limitations list in CHANGELOG.md names what the reviews left open: late first lines after a cold start, the four-core x64 line latency, a launcher left by an earlier failed launch, the silent wait in `akou quit`, and two search citation cases.

## The bump

- `scripts/stamp-version.ts --set 0.6.5` wrote the 11 stamped places.
- By hand: the install line in README.md, the image tags and the `--branch` line in docs/server.md and docs/server-hardware.md, and the "Known in" line in docs/troubleshooting.md. The menu bar item still moves, since nothing touched it after 0.6.4.
- docs/gates and docs/ROADMAP.md keep the versions their evidence ran on.
- `stamp-version.ts --check --tag v0.6.5` passes, and `--tag v0.6.6` fails as the control.

The tag is pushed after the merge.
GeiserX added a commit that referenced this pull request Oct 10, 2026
…er the watchdog reopens it (#384)

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 #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).
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.

akou start gives a freshly installed app 3 s to answer, so the first launch of a new build fails while the app is still coming up

1 participant