Commit Graph
2312 Commits
Author SHA1 Message Date
Palash Debnath d6bd82844c Restart a crashed engine, ask before quitting running work, keep the batch queue across restarts (#4623)
* feat(desktop): restart a crashed engine, ask before quitting running work, keep the batch queue across restarts

- A local engine that crashed after it had started restarts on its own
  (1, 3, 6, 12, 30 s); a sixth crash in ten minutes, or a crash before it
  ever started, stays on the recovery screen.
- A quit the user starts asks first while the engine reports running work;
  confirmed update installs, OS shutdown and relaunches do not ask.
- Unfinished batch jobs keep a record beside their upload and are queued
  again, in order, on the next backend start.
- Interrupted audiobook/story renders are announced once after launch with
  a Resume action.

* changelog: add fragment for #4623

* test(dub): wait for the voice search to take focus

* fix(desktop): close the gaps review found in job resume and the quit prompt

- Quitting during a generation, clone, design or transcription now asks
  first: the engine reports open requests that do work, not just jobs.
- Restart on CPU withdraws a pending automatic restart before it saves the
  device choice, so the engine cannot start on the old device.
- Batch queue records hold only the upload's name, so they carry no home
  path and still restore after the data folder moves.
- A save racing a cancel, a job skipped as cancelled, or a record that
  cannot be deleted no longer brings finished or cancelled work back.
- One malformed record is dropped on its own instead of stopping every
  saved job from restoring.
- A queued or restored job whose speech model was removed fails with the
  enqueue message instead of downloading it.
- The interrupted-render notice retries a failed check a few times.
2026-12-04 03:43:28 +05:30
Palash Debnath aa9b4bc113 Name the missing system library when the audio.cpp self-check fails (#4622)
* fix(audiocpp): name the missing system library when the self-check fails

* docs(changelog): add fragment

* docs(changelog): say the error names the missing library version

* chore: restore the gallery submodule pin
2026-12-03 12:18:05 -08:00
Palash Debnath dc7aa14fc0 Save a diagnostic bundle from a stalled or failed Stories/Audiobook render (#4618)
* feat(longform): save a diagnostic bundle from a stalled or failed render

* docs(changelog): add fragment

* fix(longform): offer the diagnostic bundle only when the backend is local
2026-12-03 12:08:57 -08:00
Palash Debnath bc6d564cfc fix(dev): spawn the real Bun so npm-installed Bun works on Windows (#4603)
* fix(dev): spawn the real Bun so npm-installed Bun works on Windows

bunCommand() prefers the running Bun, then npm_execpath, then the executable behind a Windows npm shim on PATH. A missing Bun gives an install hint from every script that spawns it, and a test guards against bare bun/bunx spawns. Builds on the report and first fix in #4525.

* Add changelog fragment for the Bun spawn fix
2026-12-02 20:25:13 +00:00
Palash Debnath 08aab14ab2 Identify the last completed Stories or Audiobook render after a timeout (#4595)
* Clarify which longform audio remains available after a failed retry

* Record the longform result label fix
2026-12-02 18:51:41 +00:00
Palash Debnath 554b34f6b8 Report which Sortformer piece is missing and document the macOS setup (#4599)
* Report which Sortformer piece is missing and document the macOS setup

* Add changelog fragment for #4599

* Update diarisation status tests for the missing field and cover the model override in the docs

* Re-run CI on the merged branch
2026-12-02 18:20:25 +00:00
Palash Debnath b569856908 Merge train 2026-12-01c: iOS download stall, false crash reports, setup cancel (#4593)
* fix(ios): restart model transfers that stall at 0 B/s (#4587)

Background URLSession retries timed-out tasks silently until the resource
timeout (7 days here) and treats tasks started while the app is in the
background as discretionary. The parallel scheduler only creates the tail
range after the first two 64 MiB ranges finish, which commonly happens while
the app is backgrounded, so Kitten's last range could wait indefinitely at
80%. The transport then reattached that same OS task by key on every retry,
pause/resume and relaunch, so the stall repeated every time.

ModelStore now runs each range wait under a stall watchdog: when the
transport reports no new byte for its idle interval (120 s for the background
transport) during awake time, the wait is abandoned as a retryable network
failure and the next source is tried. The background transport cancels the
abandoned task with resume data instead of suspending it, so the retry starts
a fresh task from the received bytes. Android already fails a stalled read via
OkHttp's 120 s read timeout and moves to the next source.

* Add iOS and Android to the issue forms

Phone reports had to pick a desktop OS and install method; the forms now
offer iOS, Android, the phone app install and on-device compute.

* Name the changelog fragment after the pull request

* fix(diagnostics): do not report Windows shutdown or installer exits as crashes

Windows may end the process as soon as the session-end handler returns, and
installers force-kill the app shortly after asking it to close, so the async
orderly quit often never retired the session marker and the next launch
reported an unclean_exit. Retire this process's own marker synchronously on
session-end and at the start of an orderly quit, and keep liveness refreshes
from restoring it. A process that dies any other way is still reported.

* Name the changelog fragment after the pull request

* fix(setup): keep a cancelled runtime repair cancelled and log why a venv is unusable

Cancel on the setup progress screen calls restart(). When that install was
the automatic repair of an existing runtime (or a first run whose install
marker now counts as an earlier install), start() either launched the same
install again or, once a repair had been attempted this launch, reported
"automatic repair did not finish". The renderer classifies that message as
BROKEN_VENV, so a user's Cancel was reported as a broken environment within
10 s of the restart.

- runtime-repair: a cancelled setup is left to the setup screen (Resume),
  never restarted on the user's behalf or reported as a failed repair.
- backend: restart() during an install marks it cancelled; an explicit
  setup run clears the mark.
- runtime-readiness: report why a project is not usable (missing
  interpreter, missing pyvenv.cfg, unfinished install, other version, or the
  failing import); the supervisor logs it before repairing, so a repair
  that does not help still says why.

* Name the changelog fragment after the pull request

* fix(diagnostics): keep a pending marker write from outliving session end

A marker write that passed the end check before endSession() could still
rename a fresh active marker into place, and the later async removal may
never run once Windows ends the process. Check right before the rename and
remove synchronously as it completes. Document that close to tray followed
by an installer kill, and a windowless app at Windows shutdown, are still
reported, and accept CRLF checkouts in the source-order test.

* fix(setup): address review on the broken-venv recovery

- torch-choice wiring test accepts the readiness reason callback, still
  requiring rememberTorchVariant() right after the ready branch records the
  project; the callback is now a named noteReason(project).
- The "not usable" reason is written to the setup log directly (pushLog only
  feeds it while installing) and stays in the log tail when the automatic
  repair resets it.
- The setup failure handler reads the install marker before writing any
  state and re-checks the generation, so a Cancel during that await keeps
  its Resume screen.
- Only ENOENT/ENOTDIR count as a missing interpreter or pyvenv.cfg; other
  stat errors (EACCES, EPERM, EIO) are named with their code.

* fix(ios): do not count connectivity waits as stalled model transfers

The stall watchdog treated a background task waiting for Wi-Fi (or for any
connection) as stalled, abandoned it and spent all five retry rounds. The
resulting timeout paused the download with an error, so restoring Wi-Fi no
longer resumed it. The watchdog now restarts its interval whenever the
connection the policy requires is unavailable, and counts only steps that
were connected from start to end. The app passes its connectivity state.

* fix(diagnostics): publish the session marker through renameWithRetry

The pending-write guard wrapped node:fs rename directly, which the
rename-retry guard test forbids (Windows antivirus retries). Check
publishability before the plain renameWithRetry and again as it settles;
only microtasks run in between, so an ended session still never keeps
the marker.

* fix(setup): show the unusable-runtime reason only for the runtime it describes

The retained reason now carries its project; setup for a moved runtime
location drops it instead of showing the old location's diagnosis.

* fix(setup): recheck the start generation and keep readiness reasons honest

- start(): read the install, Windows ROCm and interrupted state first, then
  return if a restart() or shutdown() overtook this start, before writing
  any status or starting a repair.
- runtime-readiness: name a build mismatch only when the ready marker
  proves it; keep this decision's Windows ROCm verification failure as the
  reason; otherwise use a neutral reason. No extra native probe runs.

* fix(mobile): demote a stalled model source and qualify resumed bytes

A source that stalled or dropped the connection kept its earlier measured
rate, so when both sources had rates the next range or attempt could wait a
full stall interval on it again. iOS and Android now set that source's rate to
zero on a network failure (not on HTTP retry statuses) and order demoted
sources last until they deliver again.

The docs, contract and changelog no longer claim received bytes are always
kept: completed ranges are, while an abandoned range continues only from
resume data the system provides.

* fix(mobile): end a source's demotion when it delivers again

A demoted source that answered too quickly to sample a rate stayed at
rate 0 and kept going last for later files. A validated answer now clears
the demotion on iOS and Android, with a test on each.

* test(ios): widen the stall window in the demoted-source test

A slow CI runner pushed the mirror's 200 ms answer past the 0.3 s stall
window, scrambling the expected host order.

* test(mobile): keep the demotion-recovery order fixed on slow runners

The recovered source could be sampled as slower than the mirror on a slow
runner; give the mirror a clearly slower measured rate on iOS and Android.
2026-12-02 20:33:55 +05:30
debpalash 9635ef9ab7 fix(setup): hand fake-IP and stalled-lookup networks to the plain model downloader
The segmented downloader's address-pinned transport refused the Hub's own
download URL when the local resolver answered with non-public addresses (a
VPN or proxy app in fake-IP mode answers 198.18.x.x) or did not finish
(resolver only works through the proxy, timeouts). Those UnsafeURLErrors were
terminal, so the install stopped even though the Hub metadata requests had
just succeeded through the same network.

Cancelling a sibling range's wire lookup after one range failed also marked
the policy scope as interrupted, turning an ordinary range failure into a
terminal "destination validation was interrupted" refusal.

Both reached opt-in failure reports as ValueError (UnsafeURLError subclasses
it). Now the wire lookup of the starting origin, or any lookup that does not
complete, raises AcceleratorUnavailable and the install falls back to
snapshot_download at once with the reason logged; wire lookups no longer mark
the interruption scope. A redirect target that resolves privately and an
interrupted redirect check still stop the install.
2026-12-01 16:24:28 +05:30
debpalash 5525daaa22 Merge remote-tracking branch 'origin/main' into fix/4573-asr-release 2026-12-01 13:57:38 +05:30
debpalash 60850b837d fix(asr): list every device the cached aligners occupy; document the dictation exception 2026-12-01 12:57:35 +05:30
debpalash aac725b660 Merge #4582: report the calling tier from GET /api/auth/whoami 2026-12-01 12:30:05 +05:30
debpalash 5d168b03b9 fix(asr): release MLX Whisper weights and word aligners with the warm ASR
Releasing the warm transcription ASR only dropped the instance. MLX
Whisper keeps its weights in a library-level singleton, MLX keeps a buffer
cache, and the wav2vec2 aligners sit in a module-level cache no engine's
unload reached, so after transcription and Unload all the backend kept
~18 GB of GPU memory while listing no loaded model.

- The warm release now frees the shared aligners and, unless dictation
  shares it, the MLX Whisper singleton; engine unloads release aligners.
- Resident aligners are listed as asr-aligner, unloadable, and included
  in Unload all.
- free_vram clears MLX's buffer cache when MLX is loaded.

Fixes #4573
2026-12-01 12:27:25 +05:30
debpalash 6b65c5b18d fix(auth): keep whoami content-free and document the gated answer
Drop the admin session's store id from the whoami response: it is the
hash revocation is keyed on and no client needs it. Document and test that
a remote caller with no credential gets 401 from the credential gate when
an API key or share PIN is configured. Regenerate the mobile OpenAPI
contract and route inventory, and drop the BOM from the changelog fragment.
2026-12-01 12:16:47 +05:30
DeryFerd acc89d5ac4 feat(sharing): rotate the share PIN without dropping the listener
The only way to change a share PIN was to disable sharing and enable it
again: that closes the socket, drops every connected guest and can move the
port, because enable() looks for a free one.

rotate_pin() issues a new PIN on the running listener under the same lifecycle
lock, keeps the port and the address list, republishes the app state, and
resets the PIN guard so a guest locked out under the old PIN starts clean. The
old PIN (and the ov_pin cookie carrying it) fails the next request, which
bounces that guest to the PIN form.

Exposed as POST /system/network/rotate-pin next to enable/disable, so it
inherits the same loopback-only control surface and returns 409 while sharing
is off. docs/sharing.md now says the PIN can be rotated while sharing stays on.

Tests: tests/test_network_share_rotate.py drives the real enable/disable
lifecycle against a fake uvicorn server and asserts the same task and server
object survive rotation, the port and addresses are unchanged, the state is
republished, the guard is reset, and the route answers the new PIN or 409.
2026-12-01 13:28:22 +07:00
DeryFerd eeef486a09 feat(auth): report the calling tier from GET /api/auth/whoami
The capability document advertises the auth routes, and the 403 text already
differs per tier, but a client could only discover its own tier by provoking
an error on a real route. whoami answers the question directly for every
tier, anonymous included, with kind, capabilities, transport and the admin
session's opaque credential id -- never a token, a PIN or a key.

The response runs through the existing /api/auth cache-control rule
(no-store), and the route joins the frozen dependency-free GET inventory with
its reason, so the authz census keeps its guarantee that a new open GET is a
reviewed decision.

Tests: loopback (native capabilities), cookie session (admin_session +
credential_id, no token in the body), API key, and an anonymous remote caller
with no key configured.
2026-12-01 13:27:50 +07:00
debpalash 45e12ccfa8 Merge #4561: feat(api-activity): add a live view for speech requests 2026-12-01 06:31:56 +05:30
debpalash 9d8c6e21c4 Merge #4519: fix(engines): avoid unrelated import probes when opening TTS 2026-12-01 06:31:55 +05:30
debpalash 23c8622d45 Merge #4575: fix(pronunciation): read UTF-16 PLS dictionaries 2026-12-01 06:31:55 +05:30
debpalash 6f509359b1 fix(api-activity): register the route with the repo's guard inventories
Recognise require_admin_diagnostics as an authorization gate in the
route-auth dump, expose the request ID through CORS_EXPOSED_HEADERS,
and count the new router in docs/STRUCTURE.md.
2026-12-01 04:40:40 +05:30
Gabi dfc40e65f1 Merge remote-tracking branch 'origin/main' into fix/nonblocking-engine-inventory 2026-11-30 22:52:02 +01:00
Gabi 08071c0420 Merge remote-tracking branch 'origin/main' into feature/api-activity 2026-11-30 22:52:00 +01:00
Sampson Yu ba8b5d249c fix(pronunciation): read UTF-16 PLS dictionaries 2026-11-30 18:22:40 +00:00
debpalash c596b7b011 Merge #4538: feat(dub): fork a prepared job over shared media 2026-11-30 22:22:00 +05:30
debpalash f88f6a74d0 Merge remote-tracking branch 'origin/main' into design/dubbing-workspace-v2 2026-11-30 20:57:03 +05:30
debpalash aeb674004b Merge #4542 2026-11-30 20:07:51 +05:30
Gabi 57fa48b7b2 Verify API Activity lifecycle, navigation and responsive layouts 2026-11-30 11:50:46 +01:00
Gabi cbcbc0d4c9 Merge current VoiceStudio main into API Activity branch 2026-11-30 11:40:00 +01:00
Gabi 89fcba9819 Add bounded API Activity monitoring for speech requests 2026-11-30 11:38:02 +01:00
Palash Debnath 6a8086fdfe fix(dub): verify the published mix and retain valid cue reviews 2026-11-30 02:20:16 -08:00
Palash Debnath 9c49ca209c fix(dub): wait for current plans and retain corrected source text 2026-11-30 01:57:13 -08:00
Palash Debnath 85c5507729 fix(dub): refresh takes and cues for the active language 2026-11-30 00:28:51 -08:00
Palash Debnath ab8cc0fe6d fix(dub): keep playback and silence tied to their source 2026-11-30 00:14:03 -08:00
Palash Debnath d4a13680f3 fix(dub): reject superseded preview muxes and preserve draft edits 2026-11-29 23:51:43 -08:00
Palash Debnath 42a0772d62 fix(dub): bind preview playback to published mix timing 2026-11-29 23:32:07 -08:00
Palash Debnath 9bad87c4df fix(dub): keep review and narration controls scoped to the draft 2026-11-29 23:10:48 -08:00
Palash Debnath 5ead098059 fix(dub): keep project saves and keyboard focus on the right view 2026-11-29 22:51:44 -08:00
Palash Debnath cf9f92d494 fix(dub): retain silent translations across language changes 2026-11-29 22:36:55 -08:00
DeryFerd 163951d911 fix(security): protect the share-PIN cookie like ov_session
NetworkAccessMiddleware wrote the share PIN into ov_pin as
\ov_pin=<pin>; Path=/; SameSite=Lax\: readable by any script in the share
origin, sendable cross-site, and not Secure behind a TLS proxy. The PIN is a
credential for the whole sharing session, so it now gets what ov_session
already had: HttpOnly, SameSite=Strict, and Secure when effective_scheme()
reports an https client hop.

A matching value no longer skips the reissue on an https hop. A guest who
started over http keeps that cookie when the same host is later reached over
TLS, and without the reissue it never gains Secure and stays sendable over
plain http.

docs/api-auth.md documents the flags. tests/test_network_middleware.py pins
HttpOnly/Strict over http, Secure behind X-Forwarded-Proto: https, and the
http-to-https upgrade for an already-present cookie.
2026-11-30 13:22:40 +07:00
Palash Debnath 3af876085d fix(dub): lock active edits and play saved cue audio offline 2026-11-29 22:21:55 -08:00
Palash Debnath 0dfe083b1a fix(dub): refresh published mixes and keep cue actions scoped 2026-11-29 21:50:05 -08:00
Palash Debnath 7ff959c589 fix(dub): preserve source cues and translation drafts 2026-11-29 21:32:11 -08:00
Palash Debnath be405c19b4 fix(dub): keep monitor actions tied to their language 2026-11-29 21:13:06 -08:00
Palash Debnath b65c485f15 fix(dub): preserve workspace state during playback and review 2026-11-29 20:54:59 -08:00
Palash Debnath 4098ba18e9 fix(dub): keep the compact voice picker inside its dialog 2026-11-29 20:29:22 -08:00
Palash Debnath c49a60d0c3 Merge remote-tracking branch 'origin/main' into review/dubbing-workspace-v2 2026-11-29 20:20:23 -08:00
Palash Debnath 6ad98a4acc chore(deps): update concurrently and Playwright (#4545)
Upgrade concurrently and Playwright with the Bun lockfile and Nix dependency hash. Compare packaged diagnostics file IDs at full precision on Windows and cover it with a regression.
2026-11-30 09:50:01 +05:30
Palash Debnath adcb2aca9b fix(dub): preserve playback handoffs and short cue boundaries 2026-11-29 19:40:36 -08:00
Palash Debnath d144ac1aab fix(dub): retain verification marks for the measured language 2026-11-29 19:20:38 -08:00
Palash Debnath e066726aa4 Merge remote-tracking branch 'origin/main' into review/dubbing-workspace-v2 2026-11-29 18:51:53 -08:00
Palash Debnath be33abe9d3 Improve desktop library, creation and keyboard workflows (#4531)
Polish the library, transcription and workflow workspaces. Keep sidebar focus visible, fit wide workflows when the canvas is measurable, and cover the updated behavior in Electron smokes.
2026-11-30 08:21:23 +05:30