Repository navigation
fix(installer): create gaia shim in ~/.local/bin for AppImage users - #942
Conversation
|
@claude review this PR. |
PR reviewThanks for tackling the post-AppImage 🔴 PID-reuse safety bug in
|
Head branch was pushed to by a user without write access
I addressed the feedback fixed PID cmdline validation, removed duplicate console.log, and updated the issue link to Closes #782. |
There was a problem hiding this comment.
@theonlychant — verified the fix commit (ce84e17) at HEAD: duplicate console.log is gone, the doc step is correctly renumbered to 5, both new doc sections use ## ATX headings, the Closes #782 link is in place, the shim writer rejects suspicious verifiedBin paths, and the pidfile reader now validates the cmdline before signalling. Approving.
Optional follow-up (not blocking)
The cmdline match in main.cjs:268-279 accepts "python" as a standalone keyword. After PID reuse onto an unrelated python process (Jupyter kernel, ML run, LSP server) the AppImage would still SIGTERM it on next launch. Low-probability scenario — needs a hard Electron crash that skips the exit-handler cleanup, plus PID wrap, plus the reused PID belonging to something the user cares about — but a one-line tightening would close it:
const cmd = raw; // /proc/<pid>/cmdline, NUL-separated
const looksLikeGaiaBackend =
cmd.includes("gaia") && (cmd.includes("chat") || cmd.includes("--ui-port"));
if (looksLikeGaiaBackend) isBackend = true;The legitimate backend is always spawned as gaia chat --ui --ui-port <port> (main.cjs:260), so the gaia + chat pair is a tight marker. The "gaia-desktop" clause is also redundant since it's a substring of "gaia".
Worth a follow-up PR; not worth blocking this one.
ok I am on it |
Signed-off-by: theonlychant <[email protected]>
Signed-off-by: theonlychant <[email protected]>
|
Ok you can look at it again now |
itomek
left a comment
There was a problem hiding this comment.
Verified at HEAD — every finding from the prior review is addressed:
main.cjs:268-279cmdline check now uses the tightgaia+ (chat|--ui-port) match (closes the prior PID-reuse-onto-Jupyter-or-LSP concern)- duplicate
console.logremoved - doc step renumbered to
5., both new sections use##ATX headings Closes #782is in the bodyinstallBackendshim creation rejects suspicious paths via the/^[\w\-./]+$/.test(verifiedBin)guard before writing the wrapper
Nothing further from me — approving.
Generated by Claude Code
## Why this matters Ships the v0.17.6 patch: a new Email Triage Agent with Gmail (every email body stays on local Lemonade), the OAuth PKCE foundation that backs it, settings UI card layout, and a sweep of installer fixes that close the remaining first-launch failures uncovered after v0.17.5. Custom Python agents that follow the template's `super().__init__(**kwargs)` pattern no longer crash on the first message in the Agent UI. Full notes: `docs/releases/v0.17.6.mdx`. ## What's New - **Email Triage Agent with Gmail** ([amd#965](amd#965)) — `EmailTriageAgent` with 25 tools across read / organize / reply / delete / calendar mixins. Every email body processed locally on Lemonade; seven destructive tools confirmation-gated; three layers of prompt-injection defense; SQLite undo log via `DatabaseMixin`. - **OAuth PKCE foundation for Google connections** ([amd#926](amd#926)) — Self-contained `gaia.connections` module: refresh tokens in the OS keychain (Keychain / DPAPI / SecretService), per-agent grants in `~/.gaia/connections/grants.json`, async token cache with refresh rotation. Baseline for the v0.17.7 connectors framework. - **Settings UI card layout** ([amd#969](amd#969)) — Outlined cards with accent left-stripe replace margin-separated blocks across all settings sections; light + dark themes both updated. ## Bug Fixes - **Custom Python agents crashed on first message** ([amd#974](amd#974), closes [amd#973](amd#973)) — `python_factory` now introspects the target class's `__init__` chain and only forwards kwargs the chain accepts, so the bare `super().__init__(**kwargs)` template pattern no longer crashes with `unexpected keyword argument 'rag_documents'`. - **Windows installer failed at `ensure-uv`** ([amd#968](amd#968), closes [amd#966](amd#966)) — `uv` binary now bundled for `win-x64`; packaged Windows rescue installer included. - **macOS installer failed at `ensure-uv` on clean Apple Silicon** ([amd#967](amd#967), closes [amd#941](amd#941)) — Pinned `uv` v0.5.14 (`aarch64-apple-darwin`) shipped in the DMG; new `dmg-structural-smoke` CI job blocks future drift. - **AppImage users hit `gaia: command not found`** ([amd#942](amd#942), closes [amd#782](amd#782)) — Startup writes a `~/.local/bin/gaia` shim so `gaia` is on PATH after first launch (skips creation if already present). - **Windows fell back to Qwen instead of Gemma 4 default** ([amd#949](amd#949), closes [amd#948](amd#948)) — Model-resolution logic fixed so Gemma loads correctly on Windows. ## Tooling & Docs - **`gaia-release` skill** ([amd#939](amd#939)) — Phased release flow with hard gates before every irreversible step; encodes the manual pre-tag verification that caught two release-blocking bugs in v0.17.4. - **Internal-task issue template** ([amd#906](amd#906)) — Third issue template for agent-assignable internal work. - **Outlook via Power Automate plan** ([amd#954](amd#954)) — Enterprise-bypass spec for v0.17.7 Outlook integration. - **PR description guidance sharpened** ([amd#947](amd#947)) — `CLAUDE.md` "tight and value-focused" rule with anti-patterns. - **Stale `macOS uv fetch removed` orphan comment removed** ([amd#975](amd#975)). ## Thanks External contributors in this release: - [@theonlychant](https://github.com/theonlychant) — installer fixes ([amd#968](amd#968), [amd#942](amd#942), [amd#949](amd#949)) - [@BlueriteSoul](https://github.com/BlueriteSoul) — reported AppImage `gaia: command not found` ([amd#782](amd#782)) - [@nuts23](https://github.com/nuts23) — reported Windows Gemma/Qwen fallback ([amd#948](amd#948)) ## Release checklist - [x] `util/validate_release_notes.py docs/releases/v0.17.6.mdx --tag v0.17.6` passes - [x] `src/gaia/version.py` → `0.17.6` - [x] `src/gaia/apps/webui/package.json` → `0.17.6` - [x] Navbar label in `docs/docs.json` → `v0.17.6 · Lemonade 10.2.0` - [x] All 14 commits in the range (v0.17.5..HEAD) are represented in the notes - [ ] Review from @kovtcharov-amd addressed
The issue
Summary
Creates a
gaiashell shim at~/.local/bin/gaiaduring AppImagestartup so users can run
gaiafrom any terminal without manuallymodifying their PATH.
Why
After installing via AppImage, users are prompted to run
gaia initbut get
gaia: command not foundbecause the AppImage does not placea binary on PATH. This fix creates a lightweight shim pointing to the
verified gaia binary, only on POSIX systems and only if no existing
gaiabinary or shim is present - - so it never clobbers system packages.Linked issue
Closes #782
Changes
backend-installer.cjs(lines 1137–1168)$XDG_BIN_HOMEor~/.local/bin/gaiagaiaalready exists on PATH or shim already existsTest plan
gaiaaccessible from terminal after AppImage launchgaiaalready exists on PATHChecklist
Closes #N/Fixes #N/Refs #N).