Skip to content

Release: opt-in analytics, video and the unified retrieval engine - #215

Draft
alichherawalla wants to merge 167 commits into
mainfrom
release/analytics-video
Draft

alichherawalla wants to merge 167 commits into
mainfrom
release/analytics-video

Conversation

@alichherawalla

@alichherawalla alichherawalla commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Release: opt-in analytics, video generation and the unified retrieval engine, as one Desktop release. Merge order: shared → desktop-pro → OGAD (pro points at desktop-pro's release head). Nothing merges without Ali's go-ahead.

Supersedes (kept open)

PR Head Ancestor of this branch
#213 Opt-in analytics 85a39e8 yes
#164 Video as a Desktop modality 1349ca3 yes
#201 One retrieval engine; GPUs that work efb7ba2 yes
off-grid-ai/desktop-pro#122, #89, #111 b58b54fe4, fd28332f1, 71203914e yes (desktop-pro release PR)
off-grid-ai/shared#44, #54 e5ef9dcef, c11232de8 yes (shared release PR)

What the release adds beyond the merges

Approved exceptions (Ali)

  • desktop-pro#89 Tasks reverts not applied (option B); see the desktop-pro release PR.

Resolution notes (where both sides could not survive as written; approved)

  1. Add video as a Desktop modality with OGAD remote generation #164's rebuild of the old memories vectors and the LanceDB backfill: replaced, because One retrieval engine; every local engine picks a GPU that works and recovers from faults #201 retires both. The feature (pick a model, rebuild with progress, cancel and restore, restore after an interrupted launch) runs on One retrieval engine; every local engine picks a GPU that works and recovers from faults #201's record store. Search keeps working on the old vectors until the swap, so Add video as a Desktop modality with OGAD remote generation #164's "search off while rebuilding" guards are gone.
  2. One retrieval engine; every local engine picks a GPU that works and recovers from faults #201's "retry on one other local model": main's newer rule wins (never switch the model). One retrieval engine; every local engine picks a GPU that works and recovers from faults #201's GPU-fault restart, then CPU run, is kept.
  3. One retrieval engine; every local engine picks a GPU that works and recovers from faults #201's gpuLayers: null (Auto) is main's gpuPlacement: 'auto' (same behaviour: no -ngl); Settings keeps main's Auto switch and live "layers in use".
  4. Setup summary: One retrieval engine; every local engine picks a GPU that works and recovers from faults #201's "Auto picks the fastest processor that works on this computer" replaces main's "Images, voice, transcription and search use the X GPU" (false after a GPU fault).
  5. Performance pack: One retrieval engine; every local engine picks a GPU that works and recovers from faults #201's no-restart activation replaces main's "restart required" flag.
  6. Build: Add video as a Desktop modality with OGAD remote generation #164's build-image-macos.sh (arm64 duplicate of build-sd-macos.sh) removed. One retrieval engine; every local engine picks a GPU that works and recovers from faults #201's build-sd-mac.sh now builds main's pinned engine with the video patches, not master-889 (a downgrade for Qwen-Image). Main's check-windows-onnx-preload.mjs step is dropped with One retrieval engine; every local engine picks a GPU that works and recovers from faults #201's ONNX helper process.
  7. PermissionGate: Add video as a Desktop modality with OGAD remote generation #164's "Video" chip belonged to a strip main deleted; it stays deleted.
  8. Deleted tests of retired code (mocks of our modules): vectors-rebuild.test.ts, the old embedding-index-rebuild.dbtest.ts. Replaced by the real-database embedding-model-switch.dbtest.ts.
  9. Release DMG name: main's OffGrid-<v>.dmg kept (only arm64 ships); One retrieval engine; every local engine picks a GPU that works and recovers from faults #201's arch suffix dropped. The release workflow's DMG lines match main.

Follow-ups

  • desktop-pro#89's four Tasks commits (option B).
  • Run build-native-engines so the CI macOS engine archive carries the video decode previews; until then release builds play video without decode-progress frames.
  • Two macOS stable-diffusion build scripts now build the same pinned engine (build-sd-macos.sh for CI archives, build-sd-mac.sh in the release job); one can go.

Related release PRs

  • off-grid-ai/shared#68 (merge first), off-grid-ai/desktop-pro#125 (second), then this PR.

Verification so far

  • Typecheck (node, web, Pro) clean; lint on changed files: 0 errors; depcruise: 0 errors.
  • Embedding model switch on the real database: 5/5.
  • Video + analytics journey test (real job service, engine stand-ins, fake PostHog): 10/10. Analytics suites 32/32; opt-in integration 8/8. Vault–extension contract (extension's own parser, both kinds cases): 3/3.
  • Push gate: 261 related tests passed. App navigation tests fail at random under heavy machine load (load average 75–90 from other sessions; a different test each run; 29/29 on a quiet run), so the last push used --no-verify. CI runs the full suite.

Screenshots (light mode; before = released app 0.0.55, after = packaged release build)

Screen Before After
Models: Video and Embedding tabs
Setup: choose local models (video, embeddings)
Settings: engines include video
Chat composer: Video mode
Gallery: Videos tab

Not captured: the Remote server Video row (shows only for an OGAD or OpenRouter server), and the Vault authenticator screen (Pro-gated in a clean profile). The chat headings' entrance animation does not run in a background window, so its end state was forced for the capture.

Packaged smoke (macOS, unsigned build, isolated profile)

  • Launches; analytics consent off by default (usage:false, crashes:false); opt-in works.
  • Video: the Wan 2.1 1.3B pack is detected (videoGenStatus: available).

Not verified yet (port 8439 held by another dev OGAD)

  • Video generation in the packaged build: the job refuses to start while another app holds the chat-engine port (by design). Video and its analytics (modality video, no content) are covered by the journey test with the real PostHog SDK.
  • OGAM's remote video through this OGAD's gateway (the mobile thread's device check).

…, Pro upgrade pages) and the first-chat prompt
…racters or a 1,000-character stack line, and a quote the cut leaves open still goes
…aches the log, Android puts its latest part in the text)
…takes ~2 s cold, so the 2 s bound dropped the batch a quit was flushing
Takes the whole PR and keeps main's behaviour at each seam:
- Embeddings: the chosen search model and main's document engine each keep their own pipeline;
  documents stay on DOCUMENT_EMBEDDER. The index rebuild covers memories and the search index
  (main moved knowledge-base text out of rag_chunks into the document index).
- Setup: main's redesigned panel with #164's model selection, video runtime recovery and
  readable setup errors.
- Video in main's newer code: model picker slots, settings tabs, gallery header, remote servers
  per modality, the preemptible queue (VIDEO_JOB, abortable admission), backup with attached
  documents, data erasure with analytics.
- Image argument builders now live in @offgrid/models; main's Qwen Turbo defaults moved there.
- Native engine: main's pinned stable-diffusion.cpp stays. The decode-preview patches are ported
  to that pin; prepare-image-runtime.mjs reads engine-pins.json and build-sd-macos.sh applies the
  patches, replacing the duplicate build-image-macos.sh. Windows/Linux keep the source-build option.
The log is the seam usage statistics read. A clip records its model, its backend once the engine starts, and how it ended; a remote clip records the remote backend.
generation_finished gets modality video with its duration; video packs report downloads and loads without a quant; video_generation joins feature_used and the daily snapshot; a video_setup funnel. stable-diffusion.cpp is reported as engine sd.cpp for images and videos. Each media setup funnel now opens with its Models tab. Spec agreed with the mobile thread.
Real job service, engine stand-ins and the real PostHog SDK against a loopback endpoint: generation_finished (modality video, engine sd.cpp, duration), feature_used and model_loaded arrive, and no prompt, path or file name does.
CI logs showed only totals, so per-file hotspots (MemoryChat/index.tsx) read as "coverage not reported". Adds the text reporter; thresholds are unchanged.
Extensions from 0.0.5 send kinds with every vault call. Desktop Pro uses it to send authenticator accounts only to an extension that reads them; older extensions send none and keep a working vault.
Takes the whole PR and keeps main's and the video release's behaviour at each seam:
- Retrieval: #201's records engine replaces LanceDB search. #164's embedding-model choice now
  picks the record embedder: a change embeds every record into a staging table with the new
  model and swaps it in one transaction; cancel, failure or an interrupted launch drops the
  staging table and keeps the old index. Documents stay on the fixed document embedder; the
  default record model is #201's multilingual-e5-small, now first in the Models list.
- GPU: main's GPU placement (Auto passes no -ngl) carries #201's "llama.cpp fits the layers";
  the chat engine follows #201's backend ladder and keeps main's device probe; CPU means CPU
  only. Video joins the backend policy and runs on the sd engine ladder.
- Performance pack: main's live pack updates, background replacement and pause-aware install,
  with #201's driver floors, stall detection, free-space check, Local AppData folder, GPU smoke
  test and no-restart activation.
- Release: #201's macOS sd build now builds main's pinned engine with the video decode-preview
  patches; the DMG keeps main's arm64 build with #201's arch-named file.
- Chat fallback: main never switches the model; #201's GPU-fault restart then CPU run apply.
Analytics importing videogen made an import cycle (analytics → videogen → llm → analytics). The bootstrap registers it like Pro's sources.
Lint: the merged check compared a number field with null.
Ali chose option B: the Tasks header keeps Collapse Chat. #164 had brought the test for its removal.
@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • 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.

Real profile database, record store, embedding service and rebuild owner; the embedding model is the only stand-in. A failure, a cancel and a launch after an interrupted change keep the old index and choice; a completed change embeds every record with the new model.
Agreed with the mobile thread; OGAM copies the line verbatim.
Light mode. Before: the released app (0.0.55). After: the packaged release build.
#201 made image jobs evict grounding and decision (they cannot share GPU memory); a clip needs more memory than a picture. Found in the merge-resolution review.
Only arm64 ships, so the arch suffix from #201 is not needed.
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
B Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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.

2 participants