hex/src/meeting
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Dax 72ac81ad61
fix(meetings): finish recordings across quits and update restarts (#1900)
* fix(meetings): recover recordings lost to a quit or update restart

Rune ends a quitting app with `_exit` unless it is told the app has work
after its loop, so every in-app quit (Quit Hex, `hex quit`, Restart to
update) skipped Hex's drain since the Nov 14 Rune bump. A meeting
recording was killed mid-write: zeroed WAV headers, no `final.pending`,
and nothing to recover at the next launch.

- `rune::orderly_exit()` in the macOS, Windows, and Linux app loops, so
  the existing teardown runs on every quit; the AppKit terminate path
  still drains from its will-terminate notification.
- macOS joins the meeting controller before installing a staged update
  and before the other workers, and a recording gets 30 s to finalise
  rather than 5.
- `meeting::recording()` is a process-wide flag the updater reads.
  Restart to update refuses with a reason, re-checks before swapping,
  and keeps the release staged.
- Launch recovery selects every unlocked unfinished meeting, not just
  `final.pending`; repairs zeroed or wrong WAV RIFF/data sizes from the
  file length, fills sample counts and duration from the audio, and runs
  the existing final pass so the transcript, Markdown export, and notes
  are written. Failed and completed meetings are untouched.

Checks: `a_zeroed_wav_header_is_repaired_from_its_file_length`,
`a_stranded_recording_is_selected_for_recovery`,
`recovery_fills_the_manifest_from_the_repaired_audio`,
`the_flag_holds_until_the_recorder_drops_it`,
`restart_to_update_waits_while_a_meeting_records`.

* fix(meetings): settle recovery attempts and keep retention honest

Reviews of #1900:
- a recovery that dies during the final pass leaves recovery.attempt;
  the next launch marks the meeting Interrupted ("recovery did not
  finish") and never retries that audio. final.pending folders that
  already have a transcript are finished too.
- a repaired, unfinalised track overwrites list_all's relabel with the
  audio's real duration and ended_at.
- retention only waits for stranded meetings while recovery can run
  (Meetings on, model installed); the MCP query uses the same rule.
- repair only rewrites a zero or overlong data chunk, so a trailing
  chunk or pad byte is never read as audio.
- the macOS status item dims Restart to update while a meeting records.
- finish_restart keeps Ready only when an update is staged.
- macOS installs a staged update before joining the controller when
  nothing records; Windows arms a 20 s teardown deadline; Linux writes
  its reopen marker only after a restart is accepted.
- the recording flag is a counter, tested without assuming idleness.

* fix(meetings): bound recovery retries and harden quits

- recovery.attempt now counts attempts: a pass that dies is retried once,
  then the meeting is marked Interrupted ("recovery did not finish") and
  that audio is never handed to Hex again. The pass holds the meeting
  busy flag, so the quit deadline and Restart to update wait for it.
- a finished meeting with a stale attempt marker keeps its final.pending,
  which the ordinary final pass then exports; settling no longer deletes
  it.
- pending recoveries stop between meetings when a recording starts and
  are offered again once Hex is idle.
- an empty finalised track is not "unfinalised"; the audio's duration
  wins whenever repair changed the manifest's track counts.
- can_recover reads meetings.enabled and the model from settings.json in
  readers (`hex mcp`, `hex meetings`), matching the app.
- updater: State::Applied is never overwritten by a later check, and a
  restart check that races a quit never swaps a second time.
- macOS installs the staged bundle before joining the meeting
  controller, marks quitting before any drain, and extends the 5 s exit
  deadline to 30 s from the quit's start while meeting audio is in
  flight. `meeting::record` refuses once quitting.
- Windows marks quitting after the loop, bounds teardown at 20 s (30 s
  while meeting audio is in flight) and exits 1 when the window failed;
  Linux marks quitting before joining meetings and removes a reopen
  marker when a restart is refused.

* fix(updater): keep the staged update installable when a late download is dropped

- check() now returns the state the locks actually show when it discards a
  release during a quit: Applied only if one was installed, else Ready while
  an older update is staged, else Current. install_on_quit therefore still
  installs the staged update a plain quit is about to apply.
- after waiting for meeting audio, the macOS exit deadline gives the rest of
  the drain up to 5 s more, inside the 30 s bound from the quit's start.
  Windows polls meeting audio to 30 s instead of choosing a bound once.
- the Restart to update refusal reads "Hex is finishing a meeting; restart to
  update when it's done", true for a recording and a launch recovery.
- a recording refused because Hex is quitting removes the empty folder it
  created (and only when it holds nothing but the lock file).
- docs: the macOS drain installs before joining the controller, and the
  deadline/discarded-release wording matches the code.
2026-11-16 12:30:57 -05:00
..
watcher fix(meetings): start the call named before a call-switch stop (#1899) 2026-11-16 11:02:27 -05:00
capture.rs fix(hud): keep the dictation and meeting overlays dark (#1834) 2026-11-16 00:22:48 -08:00
chapters.rs feat(meetings): graduate meeting labs into normal behaviour and Meetings settings (#1821) 2026-11-16 00:51:48 -08:00
chapters_tests.rs meetings: labs toggle to write notes to their own file (#1620) 2026-11-09 23:42:56 -05:00
chunk_level.rs meetings: raise quiet microphone chunks before transcription (#1876) 2026-11-15 23:55:43 -05:00
delta.rs feat(meetings): a minimal meeting pill that opens into copy new, copy all and an agent prompt (#1766) 2026-11-12 21:43:07 -08:00
detection.rs fix(meetings): start the call named before a call-switch stop (#1899) 2026-11-16 11:02:27 -05:00
echo.rs Fold meeting_* into meeting/ 2026-10-31 14:32:07 -07:00
echo_replay_tests.rs meetings: raise quiet microphone chunks before transcription (#1876) 2026-11-15 23:55:43 -05:00
export_name.rs feat(meetings): graduate meeting labs into normal behaviour and Meetings settings (#1821) 2026-11-16 00:51:48 -08:00
finish.rs meetings: import audio files (labs) (#1462) 2026-11-06 15:25:22 -05:00
finished_events.rs feat(meetings): graduate meeting labs into normal behaviour and Meetings settings (#1821) 2026-11-16 00:51:48 -08:00
generator.rs use OpenCode's default model for meeting summaries (#1844) 2026-11-14 22:53:32 -05:00
import.rs meetings: labs toggle to write notes to their own file (#1620) 2026-11-09 23:42:56 -05:00
linux.rs fix(meetings): restart a linux output capture that ends while its sink is still listed (#1842) 2026-11-14 22:22:44 -05:00
live_replay_tests.rs meetings: labs toggle to write notes to their own file (#1620) 2026-11-09 23:42:56 -05:00
loopback_route.rs windows meetings: loop back only the call app's outputs (#1605) 2026-11-09 16:43:46 -05:00
macos.rs meetings: open the transcript folder instead of selecting it (#1680) 2026-11-11 00:00:08 -05:00
mcp.rs chore(fixtures): remove personal data from preview fixtures (#1676) 2026-11-10 20:11:38 -08:00
notes.rs feat(meetings): graduate meeting labs into normal behaviour and Meetings settings (#1821) 2026-11-16 00:51:48 -08:00
notes_file.rs feat(meetings): graduate meeting labs into normal behaviour and Meetings settings (#1821) 2026-11-16 00:51:48 -08:00
query.rs fix(meetings): finish recordings across quits and update restarts (#1900) 2026-11-16 12:30:57 -05:00
query_tests.rs fix(captures): keep delayed replies with their original request (#1759) 2026-11-12 17:43:27 -08:00
recording.rs fix(meetings): finish recordings across quits and update restarts (#1900) 2026-11-16 12:30:57 -05:00
recovery.rs fix(meetings): finish recordings across quits and update restarts (#1900) 2026-11-16 12:30:57 -05:00
retention.rs fix(meetings): finish recordings across quits and update restarts (#1900) 2026-11-16 12:30:57 -05:00
runtime.rs fix(meetings): withdraw the left-the-call notice when the call comes back (#1854) 2026-11-15 09:40:24 -05:00
sweep.rs meetings: import audio files (labs) (#1462) 2026-11-06 15:25:22 -05:00
tests.rs feat(meetings): a minimal meeting pill that opens into copy new, copy all and an agent prompt (#1766) 2026-11-12 21:43:07 -08:00
transcript.rs feat(meetings): graduate meeting labs into normal behaviour and Meetings settings (#1821) 2026-11-16 00:51:48 -08:00
warning.rs fix: keep recovering a digitally silent meeting microphone (#1713) (#1714) 2026-11-12 02:43:23 -05:00
watcher.rs fix(meetings): finish recordings across quits and update restarts (#1900) 2026-11-16 12:30:57 -05:00
windows.rs meetings: capture every linux output, not just the default (#1804) 2026-11-13 16:44:57 -05:00