Skip to content

fix(app): always finish akou quit on Linux, even when a stop is still flushing or a teardown step fails - #367

Merged
GeiserX merged 2 commits into
mainfrom
fix/linux-quit-after-call
Oct 9, 2026
Merged

GeiserX merged 2 commits into
mainfrom
fix/linux-quit-after-call

Conversation

@GeiserX

@GeiserX GeiserX commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Problem

On Linux, akou quit after a call sometimes never finished. The G1 gate caught it once in two runs (#351). The app logged quitting, then the call's ended 51 ms later, then nothing. It never wrote its quit line, runtime.json stayed, and the app kept running until the CLI killed it.

Cause

Two defects in the quit path let that happen.

  • A call still stopping was not waited for. The hotkey's second press stops the call, and the stop waits for the live recognizer to flush its open lines. The quit only waited for calls that were live or had a stop in its pending set, and a stop in progress was in neither. So the quit closed the recognizer under that call, which released the flush, and the call ended in the middle of the teardown. New per-step logs on four Linux runs show it: the call's ended lands while the API server is stopping, after the recognizer was closed.
  • No step of the teardown had a deadline or a guard. ElectroBun's main process catches every unhandled rejection and only prints it to stderr. So a step that threw stopped the quit silently, and a step that never settled held it forever. Either way the app stayed alive with its runtime.json. The watchdog stayed quiet because the app's thread kept running, which matches the failing run.

The failing run logged no step, so which step stopped it cannot be named from its log. The four runs below did not hang again.

Fix

  • The call controller's idle wait now includes a stop in progress. The quit lets that call end on its own flush before anything closes.
  • Every quit step runs through quitStep. A step that throws, or outlives its budget, is named in app.log and the quit goes on. The budget is 3 s, or 15 s for stopping the live call. So runtime.json always goes and closed always resolves.
  • The wait after aborting a final pass now has a deadline too.
  • The G1 gate keeps the CLI's answer, the process list and the launcher's output when a quit does not finish, so a next occurrence says where it stopped.

tests/quit-steps.e2e.test.ts has three tests, and all three were red on main:

  • A stop whose flush is held across the quit. On main the recognizer closed before call.ended.
  • A window whose close never settles. On main the quit hung.
  • An API server whose stop throws. On main the quit rejected and runtime.json stayed.

The trap is in docs/TRAPS.md as "A quit that stops on one step".

Linux G1 gate runs

Runs of the release workflow's app-desktop (ubuntu-24.04) job, with the G1 shell gate:

At the PR head fee1904, four runs. G1 passed on Linux x64 every time. Every quit finished: the window start, the headless start, the login item start and the last start, so 16 quits after a call. No run recorded a quit failure. The app log lines the artifact keeps name no failed or slow step. Windows passed on all four too.

Before the fix, five runs on main with only per-step quit logging added also passed, so the hang is rare. Their logs show the call ending mid-teardown, the ordering the fix removes:

Closes #351.

…ling step cannot leave akou running (#351)

On Linux, `akou quit` right after a hotkey stop once logged `quitting` and the call's `ended`,
then nothing: no quit line, runtime.json left behind, the app alive.

The quit skipped a call still in `stopping` (its live recognizer flushing), so it closed the
recognizer under that call and the call ended in the middle of the teardown. And every teardown
step was awaited with no deadline and no guard, while ElectroBun's main process only prints an
unhandled rejection: one step that threw or never settled stopped the quit silently.

The call controller's idle wait now includes a stop in progress, so the quit lets such a call end
before anything closes. Every quit step runs through quitStep: an error or a step past its budget
(3 s, 15 s for the live call) is named in app.log and the quit goes on, so runtime.json always
goes and `closed` always resolves.
@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 44 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: eeca0c08-148a-401c-b275-23e1ee18c8f4

📥 Commits

Reviewing files that changed from the base of the PR and between dcdf2a3 and fee1904.


📒 Files selected for processing (6)
  • docs/TRAPS.md
  • scripts/gates/g1-shell.ts
  • src/main/call/call.ts
  • src/main/index.ts
  • tests/api-helpers.ts
  • tests/quit-steps.e2e.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 31e3716 into main Oct 9, 2026
111 of 113 checks passed
@GeiserX
GeiserX deleted the fix/linux-quit-after-call branch October 9, 2026 12:25
GeiserX added a commit that referenced this pull request Oct 9, 2026
…is run's evidence

A screenshot left in --shots by an earlier run passed for the current one when screencapture
failed; the file is now removed first and a capture counts only when screencapture exits 0. The
macOS probe reported an unreadable status-item list as no items; it is now an error, as an
unreadable extras menu bar already was. The G1 notes say the no-grant evidence had its paths
shortened by hand, and that #367 fixes the Linux quit hang behind #351.
GeiserX added a commit that referenced this pull request Oct 9, 2026
… the quit fix and macOS passes on the runner (#371)

G1 was Partial for two reasons: macOS had never been run, and on Linux `akou quit` hung after a call on one run of two. Both are now answered, so the row can say Pass.

- Linux: after the quit fix in #367, G1 passed every phase on four runs in a row, with no quit failure. Their results are committed unchanged as `docs/gates/g1-linux-367-1.json` to `-4.json`.
- macOS: the committed result and shots now come from the run on the last commit of #362, where every shot is a capture of one window. Three earlier runs passed too.
- Windows passed on both of its runs.

The summary row, the G1 section's verdict, the two ROADMAP lines and the stable-release evidence test now carry G1 as passed. That test goes red if the row is put back to Partial.

Still open, and not blocking the row: a complete run on a real Mac with akou's Accessibility grant on. Without the grant the hotkey registers and never fires, which is the platform rule DK-K1 describes.

Runs:
https://github.com/GeiserX/akou/actions/runs/37922595750
https://github.com/GeiserX/akou/actions/runs/37922606346
https://github.com/GeiserX/akou/actions/runs/37922614113
https://github.com/GeiserX/akou/actions/runs/37922622120
https://github.com/GeiserX/akou/actions/runs/37950658117
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.
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.

Linux: akou quit can hang after a call ends (G1 gate, 1 of 2 runs)

1 participant