Repository navigation
feat(desktop): Linux support on desktop/windows (consolidate #9503 #9963 #8415) - #10096
Conversation
2b3fb87 to
d365dfe
Compare
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for this — the consolidation approach (platform seam on desktop/windows instead of a forked tree, with co-author credit for the three community PRs) is the right call, and the Linux adapters degrade gracefully throughout. The architecture is sound.
One blocker before this can land: the Typecheck · Lint · Test CI check is failing because of two ESLint errors this PR introduces:
src/main/usage/nativeForeground.ts:45:19 error A `require()` style import is forbidden @typescript-eslint/no-require-imports
src/main/usage/userAssistRegistry.ts:46:19 error A `require()` style import is forbidden @typescript-eslint/no-require-imports
The lazy require('koffi') is the right idea (it keeps nativeForeground importable off-Windows), but it trips the @typescript-eslint/no-require-imports rule. The usual fix is a scoped eslint-disable on each line:
// eslint-disable-next-line @typescript-eslint/no-require-imports
const koffi = require('koffi') as typeof import('koffi')That clears the two errors (the 384 prettier warnings are pre-existing in untouched files and remain non-blocking). Once CI goes green this is in good shape for a maintainer to merge.
A couple of non-blocking notes for a human maintainer:
LINUX.mdis agent-/contributor-facing guidance, so it will shape how both AI coding agents and humans set up and reason about the Linux build here. The content looks accurate and source-backed (graceful degradation paths, XWayland default, snap-confinement rationale all check out against the code). Worth a maintainer skim to bless it as canonical for thedesktop/windowsLinux story.- The OCR helper and
linuxForegroundshell-out paths all use argument arrays withexecFileSync(no shell injection), enforce timeouts, and clean temp files infinally— good defensive posture.
The feature scope is coherent (one Linux desktop surface); no split needed. Human maintainer review requested before merge.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
…o-require-imports Clears the 2 ESLint errors blocking #10096 CI (nativeForeground.ts:45, userAssistRegistry.ts:46). The lazy require keeps nativeForeground importable off-Windows; scoped disable is the maintainer-suggested fix.
…10110) ## Summary Adds a scoped `// eslint-disable-next-line @typescript-eslint/no-require-imports` above the two lazy `require('koffi')` calls (nativeForeground.ts:45, userAssistRegistry.ts:46) so the **Desktop Windows CI / Typecheck · Lint · Test** check goes green on #10096. The lazy require is the right idea (keeps `nativeForeground` importable off-Windows); it just trips the `no-require-imports` rule. This is the exact fix the maintainer requested in the #10096 review. ## Test plan - `cd desktop/windows && npx eslint src/main/usage/nativeForeground.ts src/main/usage/userAssistRegistry.ts` → no `no-require-imports` errors. - Part of the consolidated Linux PR #10096 (supersedes #9503/#9963/#8415). ## Notes Pushed from the `consolidation/linux-electron` HEAD. Intended to be merged into that branch (or squashed into its feat commit) so #10096 can land. <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/10110?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
|
Current head already includes e4ef1b1 for the lazy |
Linux support evidence updateThe current lazy-
The current Windows-oriented checks and focused mocked tests do not validate the claimed AppImage/deb/X11 runtime surface. |
|
Added the maintained Ubuntu validation route in 08b388c: AppImage/deb packaging, helper inclusion/dependency inspection, Xvfb launch, real X11 foreground + Tesseract OCR helper smoke, and Wayland-degradation contracts. Local typecheck, 605 tests, and Linux packaging pass; native user-session/Wayland evidence remains unavailable because the documented Linux host is unreachable. |
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for pushing this forward — the current head resolves the earlier lazy-koffi lint blocker, and the new Ubuntu package/helper smoke path is a solid step for Linux packaging + OCR coverage.
One remaining blocker before this should be treated as supported Linux desktop behavior: the final CI workflow no longer exercises real X11 foreground detection. Patch 08 added an openbox/xterm title smoke, but the current head removes openbox, xterm, x11-utils, and OMI_HELPER_EXPECT_TITLE, while linuxHelper.integration.test.ts now only checks the helper's protocol shape + OCR. That leaves src/main/usage/linuxForeground.ts/nativeForeground.ts covered by parsers and mocks, not by a real xprop + /proc/<pid>/exe foreground smoke under Xvfb.
Because desktop/windows/LINUX.md is contributor- and agent-facing guidance, it will shape how human contributors and AI coding/review agents reason about Linux support in this repo. The doc currently says app-usage tracking works on Linux via X11; please either:
- restore a maintained Ubuntu/Xvfb smoke that proves the real foreground path (for example install
x11-utilsplus a tiny X client/window manager and assert the observed title/process through the canonicalnativeForeground/linuxForegroundseam), or - narrow the Linux doc/status wording so foreground tracking is clearly marked as unit-tested/parser-covered but not yet runtime-smoked.
No split needed — this is a cohesive Linux desktop seam. Once that evidence/docs gap is closed, this should be ready for human maintainer review rather than another architecture debate.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
…o-require-imports Clears the 2 ESLint errors blocking #10096 CI (nativeForeground.ts:45, userAssistRegistry.ts:46). The lazy require keeps nativeForeground importable off-Windows; scoped disable is the maintainer-suggested fix.
20746d4 to
7b218e1
Compare
…o-require-imports Clears the 2 ESLint errors blocking #10096 CI (nativeForeground.ts:45, userAssistRegistry.ts:46). The lazy require keeps nativeForeground importable off-Windows; scoped disable is the maintainer-suggested fix.
7b218e1 to
16c76d7
Compare
There was a problem hiding this comment.
The Linux support is well-guarded, safe in how it runs external tools, and degrades gracefully, and the privacy-safe default is a nice touch. Two small fixes: the Linux package is missing one dependency the window-detection feature needs, and a few files still load the Windows-only module even off Windows.
| - tesseract-ocr | ||
| - tesseract-ocr-eng | ||
| - libnotify4 | ||
| - libxss1 |
There was a problem hiding this comment.
🤖 x11-utils (which provides xprop) is missing from depends. Active-window / usage tracking and the helper's window-info op call xprop, and LINUX.md lists active-window detection as a working feature — but a .deb install on a minimal system without x11-utils silently loses it. Since the deb already depends on tesseract for OCR, adding x11-utils here keeps the xprop path complete too. Degrades gracefully, so non-blocking.
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Addressed remaining review blockers on
Ready for maintainer re-review. |
|
Follow-up: rebased onto current
SHA: see latest head. |
Consolidate Linux desktop work as platform seams on desktop/windows (not a forked desktop/linux tree), on main's electron-builder.config.mjs. - X11 active-window via xprop + /proc; Tesseract OCR helper - XWayland default + PipeWire; Wayland Rewind default off - AppImage+deb (no snap); deb depends include x11-utils - Lazy-require koffi so Linux import never loads Win32 native - LINUX.md: foreground unit/parser-covered, not yet Xvfb-smoked Failure-Class: none Co-authored-by: velinxs <[email protected]> Co-authored-by: ZachL111 <[email protected]> Co-authored-by: palontologist <[email protected]> Co-authored-by: Cursor <[email protected]>
50d79b8 to
4a81034
Compare
Allow committed asarUnpack globs to list optional platform-native clipboard siblings while each host only installs one. Drift fails only when fresh globs are missing from the committed list; completeness skips optional siblings absent on the current OS. Failure-Class: none Co-authored-by: Cursor <[email protected]>
Make helperProcess spawn assertions platform-aware so Ubuntu CI passes, and assert x11-utils is declared in the packaged .deb depends. Co-authored-by: Cursor <[email protected]>
|
Addressed the remaining review blockers on Git-on-my-level (X11 foreground evidence) — chose the doc-narrowing path over restoring openbox/xterm Xvfb smoke (lighter, less flaky). skander (x11-utils deb depends) — verified Typecheck · Lint · Test — fixed @Git-on-my-level ready for re-review. |
Failure-Class: none Co-authored-by: Cursor <[email protected]>
|
Thanks for the follow-up — the prior Linux support blockers look addressed on the current head:
This is a positive signal on the implementation direction: keeping Linux as a One small docs-accuracy nit before treating Leaving this for human maintainer review before merge because it is a nontrivial desktop-platform feature and the current head still has unrelated Desktop Swift checks failing/cancelled. No split needed; the PR is cohesive around the Linux desktop seam. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
Resolved on current head c6161ae: lazy-koffi lint fixed; Linux docs now mark foreground tracking as parser/unit-covered rather than runtime-smoked; x11-utils is declared and verified in package metadata. Superseded by latest maintainer-bot comment.
electron-builder.config.mjs declares a `publish` block (GitHub provider), so electron-builder auto-publishes whenever it detects CI. The config comment spells out the resulting invariant: every build command must pass `--publish never`. `build:linux`, added with Linux support in #10096, did not — so the "Linux package · helper smoke" job of Desktop Windows CI has failed on every commit since d660a1a with: Error: GitHub Personal Access Token is not set, neither programmatically, nor using env "GH_TOKEN" That job is a required check on every PR touching desktop/windows/**, so main has been red and the lane blocking since 2026-07-25 01:23 UTC. Add the flag to build:linux (build:mac had the same latent gap; no CI lane runs it, but the invariant is the same) and add a guard test so a platform build script cannot ship without it again. No release lane calls build:linux or build:mac — the Windows release workflow invokes electron-builder directly and already passes --publish never. Failure-Class: none Verified: pnpm vitest scripts/build-scripts-publish.test.mjs 4/4 pass; with the flag reverted on build:linux the guard fails exactly on that script (1 failed | 3 passed). prettier --check clean. End-to-end proof is the Linux package job on this PR, which runs the identical `pnpm run build:linux` command that is failing on main. Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Summary
Consolidates the three open Linux desktop PRs into one landable path:
desktop/windows(+473)desktop/Linuxtree (+24k)desktop/linuxtree (+58k, ~75% Windows copy)Architecture: one Electron tree (
desktop/windows) withprocess.platformbranches. Nodesktop/linux/desktop/Linuxfork — those drift from Windows immediately and double maintenance.What lands
From #9503
linuxForeground.tsviaxprop+/proc)win-ocr-helperstdio protocol (resources/linux-ocr-helper/omi-ocr-helper)OMI_OZONE=waylandoverride) + PipeWire capturerFrom #8415
PulseaudioLoopbackForScreenSharefor system-audio loopback.debdepends:tesseract-ocr,tesseract-ocr-eng,libnotify4,libxss1Fix on top of #9503
require('koffi')so Linux import ofnativeForegroundnever loads Win32 native module (unit tests were broken off-Windows)Tests
Product invariants
None. Path globs under
desktop/windowsfor Linux seams only.Credits
Consolidated from community PRs (code selected into
desktop/windowsseams; forked trees not re-merged):desktop/linuxfork not adoptedGit trailers on the feat commit:
Co-authored-byfor all three.Failure-Class: none
Closes #9503
Closes #9963
Closes #8415