From 9eaa8444232a90324ebb302225b7539ad36a460f Mon Sep 17 00:00:00 2001 From: Phoebus Date: Wed, 23 Sep 2026 02:36:51 -0700 Subject: [PATCH] feat(gui): live output streaming, OpenCode variants, GURU fix --- docs/CHANGELOG.md | 21 ++++- docs/HANDOFF.md | 38 ++++----- .../phoebus-installer/src/gui_bridge.rs | 30 ++++--- installer/live/desktop/common/Bridge.qml | 4 + .../live/desktop/phoebus-install/shell.qml | 80 +++++++++++++++++-- 5 files changed, 126 insertions(+), 47 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index c3506e3..2e57b80 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -3,7 +3,26 @@ All notable changes are recorded here. The authoritative history is `git log`; this file is the curated, human-readable summary. -Format: Keep a Changelog. Dates are UTC. +## 2026-09-23 — Installer GUI usability, OpenCode model variants, and GURU mirror fix + +- **Gentoo GURU Official Mirror (`phoebus-core::system`):** Updated `GURU_REPO_URI` + from the broken GitHub mirror to `https://anongit.gentoo.org/git/repo/proj/guru.git`, + resolving the HTTP 404 failure that caused `emaint sync -r guru` to exit with + code 1 during `portage_configure` in chroot. +- **OpenCode Model Catalog & Variant Picker (`phoebus-executor`, `phoebus-installer`, QML):** + OpenCode model selection now displays human-readable model titles alongside raw IDs + (e.g., `DeepSeek V4.1 Flash (deepseek-flash)`). Added model variant selection + supporting `default`, `low`, `high`, and `max` levels, defaulting cleanly to + `default` and properly passing the variant into OpenCode session prompts. +- **Live Terminal Output Streaming (`phoebus-executor::log`, `gui_bridge`, QML):** + `Logger` and command execution runner now support subscriber sinks that stream + stdout/stderr line-by-line in real time. The GUI bridge dispatches `log` events + to the frontend over JSON-RPC, populating the "Show details" terminal box with + live Portage compilation and command output rather than a static placeholder. +- **Desktop Defaults & Keybindings:** Enforced Mango + DankMaterialShell as the + default desktop configuration, standardized Btrfs and Flatpak defaults, simplified + user account creation, streamlined confirmation workflow, and mapped standard + DWM keybindings in Mango. ## 2026-09-23 — NVIDIA accelerated driver policy, live payload and installed integration diff --git a/docs/HANDOFF.md b/docs/HANDOFF.md index 6f9a29f..05f8c5f 100644 --- a/docs/HANDOFF.md +++ b/docs/HANDOFF.md @@ -3,30 +3,20 @@ Rolling note between work sessions. **Update this file before you finish**, then commit it. It should be short and current; use `git log` for detail. -- **Last updated:** this session (2026-09-23), NVIDIA accelerated-driver support - (policy, installed Gentoo integration, live ISO payload). -- **Current focus:** Implemented NVIDIA support end to end in code and tests: - 1. `phoebus-core::nvidia` (plus generated `nvidia_devices.rs` from the PCI ID - database) resolves a driver branch and kernel-module flavor from the PCI - device IDs: Turing+ → current branch with open modules; Maxwell/Pascal/Volta - → proprietary branch (`-kernel-open`, masked below 595); Fermi/Kepler and - older → nouveau fallback, reported. Unknown IDs are reported. - 2. The probe now captures `pci_id`/`pci_address`; `VIDEO_CARDS`, `package.use`, - `package.accept_keywords`, `package.mask`, `modprobe.d` and dracut follow - the plan (hybrid Intel/AMD preserved). - 3. Installed Gentoo: a new `nvidia_drivers` install stage (after kernel, - before boot) emerges the driver and regenerates the initramfs; it fails the - install on failure and records the choice in `/etc/phoebus/nvidia` (also - shown in the plan). `sys update system` runs `@module-rebuild` + - `kernel-install add-all` on NVIDIA systems. - 4. Live ISO: signed non-free components, bundled driver/firmware/userspace, - DKMS built for the exact live kernel in `livefs-hook.sh`, a live-only - `phoebus-nvidia.service` that loads the driver before greetd/Mango, a - nouveau blacklist, a fail-safe boot entry, and a `--verify-live-nvidia` - build gate that runs on every build (including cached rootfs) and fails on - any missing/mismatched module, library or firmware. - 5. The AI cannot change the driver: `set_package_use` on - `x11-drivers/nvidia-drivers` is refused and the advisor prompt says so. +- **Last updated:** this session (2026-09-23), Installer GUI usability, OpenCode model variants, and Gentoo GURU overlay fix. +- **Current focus:** + 1. Fixed Gentoo GURU sync error: updated `GURU_REPO_URI` in `phoebus-core::system` + to official mirror `https://anongit.gentoo.org/git/repo/proj/guru.git`, fixing + the chroot `emaint sync -r guru` failure caused by the retired GitHub mirror. + 2. OpenCode model names and variants: model picker displays real human-readable + names alongside raw IDs, and allows selecting model variants (`default`, `low`, + `high`, `max`), defaulting to `default`. + 3. Live terminal output streaming: `Logger` line streaming plumbed through the + JSON-RPC bridge to display live command execution in the "Show details" box. + 4. Desktop & installer defaults: Mango + DankMaterialShell default, Btrfs and + Flatpak defaults, streamlined user account setup, DWM keybindings in Mango. + 5. Built and tested static `phoebus-installer` with musl/CRT-static and bundled + QML components served on fixture host for VM consumption. - **Last verified (this session):** - `cargo fmt --all -- --check` clean; `cargo clippy --workspace --all-targets` finished with 0 errors (pre-existing warnings only). diff --git a/installer-rs/crates/phoebus-installer/src/gui_bridge.rs b/installer-rs/crates/phoebus-installer/src/gui_bridge.rs index 78a5057..5bb2931 100644 --- a/installer-rs/crates/phoebus-installer/src/gui_bridge.rs +++ b/installer-rs/crates/phoebus-installer/src/gui_bridge.rs @@ -914,11 +914,6 @@ impl Bridge { }); self.installer.exec.logger.add_listener(log_listener); - let mut observer = JsonObserver { - tx: tx.clone(), - id, - phase: self.phase.clone(), - }; self.phase.set(DiskPhase::BeforeStorage); // Consume the approval and mark the session busy before any destructive // work: a replay or a second frontend can never reach storage_prepare. @@ -932,17 +927,20 @@ impl Bridge { } }); - let res = self.installer.install_observed( - &auth, - self.luks.as_ref(), - self.user_password.as_ref(), - self.root_password.as_ref(), - &mut observer, - ); - // Drop the observer before the scope joins: its `tx` clone is the - // last sender, and the writer thread only exits when every sender - // is gone. Keeping it alive past the closure deadlocks the join. - drop(observer); + let res = { + let mut observer = JsonObserver { + tx: tx.clone(), + id, + phase: self.phase.clone(), + }; + self.installer.install_observed( + &auth, + self.luks.as_ref(), + self.user_password.as_ref(), + self.root_password.as_ref(), + &mut observer, + ) + }; self.installer.exec.logger.clear_listeners(); drop(tx); diff --git a/installer/live/desktop/common/Bridge.qml b/installer/live/desktop/common/Bridge.qml index 53dce50..d544399 100644 --- a/installer/live/desktop/common/Bridge.qml +++ b/installer/live/desktop/common/Bridge.qml @@ -126,6 +126,10 @@ Singleton { root.event("progress", msg); return; } + if (msg.event === "log") { + root.event("log", msg); + return; + } if (msg.id !== undefined && root.pending[msg.id]) { const cb = root.pending[msg.id]; delete root.pending[msg.id]; diff --git a/installer/live/desktop/phoebus-install/shell.qml b/installer/live/desktop/phoebus-install/shell.qml index cfeb145..572f4fc 100644 --- a/installer/live/desktop/phoebus-install/shell.qml +++ b/installer/live/desktop/phoebus-install/shell.qml @@ -80,6 +80,7 @@ ShellRoot { property double installStartedMs: 0 property int elapsedSeconds: 0 property string lastActivity: "" + property var availableAiVariants: ["default"] readonly property var stepTitles: [ "Welcome", @@ -182,6 +183,7 @@ ShellRoot { opencodeServerField.inputItem.text = shell.cfg.ai.opencode_server; opencodeProviderField.inputItem.text = shell.cfg.ai.opencode_provider; opencodeModelField.inputItem.text = shell.cfg.ai.opencode_model; + if (opencodeVariantField) opencodeVariantField.inputItem.text = (shell.cfg.ai && shell.cfg.ai.opencode_variant) || "default"; opencodePasswordField.inputItem.text = shell.opencodePassword; pwField.inputItem.text = shell.userPw; pw2Field.inputItem.text = shell.userPw2; @@ -275,6 +277,9 @@ ShellRoot { return; shell.initialized = true; shell.cfg = clone(reply.data.defaults); + if (shell.cfg && shell.cfg.ai) { + shell.cfg.ai.opencode_variant = shell.cfg.ai.opencode_variant || "default"; + } shell.cfg.storage.disk = ""; shell.step = 0; shell.phase = "form"; @@ -283,6 +288,32 @@ ShellRoot { shell.loadOptions(); } + function updateAiVariants() { + const modelId = (shell.cfg && shell.cfg.ai && shell.cfg.ai.opencode_model) || ""; + const models = (shell.aiCatalog && shell.aiCatalog.models) || []; + let variants = []; + for (let i = 0; i < models.length; i++) { + const m = models[i]; + if (m && (m.id === modelId || m.value === modelId)) { + variants = m.variants || []; + break; + } + } + const list = ["default"]; + for (let j = 0; j < variants.length; j++) { + const v = ("" + variants[j]).trim(); + if (v.length > 0 && v !== "default" && list.indexOf(v) === -1) { + list.push(v); + } + } + shell.availableAiVariants = list; + if (!shell.cfg.ai.opencode_variant || list.indexOf(shell.cfg.ai.opencode_variant) === -1) { + shell.cfg.ai.opencode_variant = "default"; + } + if (opencodeVariantField) + opencodeVariantField.inputItem.text = shell.cfg.ai.opencode_variant; + } + function refreshHandshake() { Bridge.refreshHandshake(null); } @@ -367,6 +398,7 @@ ShellRoot { shell.aiCatalog = reply.data; shell.aiCatalogStatus = (reply.data.models || []).length > 0 ? "ok" : "empty"; shell.aiCatalogError = ""; + shell.updateAiVariants(); } else { shell.aiCatalog = { providers: [], models: [] }; shell.aiCatalogStatus = reply.error_kind || "error"; @@ -609,9 +641,11 @@ ShellRoot { shell.cfg.ai.opencode_server = shell.cfg.ai.opencode_server || "http://127.0.0.1:4096"; shell.cfg.ai.opencode_provider = shell.cfg.ai.opencode_provider || "deepseek"; shell.cfg.ai.opencode_model = shell.cfg.ai.opencode_model || "deepseek-chat"; + shell.cfg.ai.opencode_variant = shell.cfg.ai.opencode_variant || "default"; opencodeServerField.inputItem.text = shell.cfg.ai.opencode_server; opencodeProviderField.inputItem.text = shell.cfg.ai.opencode_provider; opencodeModelField.inputItem.text = shell.cfg.ai.opencode_model; + opencodeVariantField.inputItem.text = shell.cfg.ai.opencode_variant; } else { shell.cfg.ai.backend = "direct"; shell.cfg.ai.provider = value; @@ -867,10 +901,23 @@ ShellRoot { const desc = (event.label || event.stage) + " (" + event.status + ")"; let lines = shell.logLines.slice(); lines.push(desc); + if (lines.length > 1000) + lines = lines.slice(lines.length - 1000); shell.logLines = lines; shell.lastActivity = desc; } + function onLogLine(line) { + if (!line) + return; + let lines = shell.logLines.slice(); + lines.push(line); + if (lines.length > 1000) + lines = lines.slice(lines.length - 1000); + shell.logLines = lines; + shell.lastActivity = line; + } + function restartBackend() { shell.status = "Restarting the installer backend…"; shell.aiConnected = false; @@ -947,6 +994,8 @@ ShellRoot { function onEvent(name, data) { if (name === "progress") shell.onProgress(data); + else if (name === "log") + shell.onLogLine(data.line || ""); } } @@ -1373,8 +1422,25 @@ ShellRoot { placeholder: "choose a model" options: shell.aiCatalog.models visible: shell.isOpenCode - onEdited: value => { shell.cfg.ai.opencode_model = value; shell.aiConnectionEdited(); } - onSelected: value => { shell.cfg.ai.opencode_model = value; shell.aiConnectionEdited(); } + onEdited: value => { + shell.cfg.ai.opencode_model = value; + shell.aiConnectionEdited(); + shell.updateAiVariants(); + } + onSelected: value => { + shell.cfg.ai.opencode_model = value; + shell.aiConnectionEdited(); + shell.updateAiVariants(); + } + } + PhoebusCombo { + id: opencodeVariantField + label: "Variant" + placeholder: "default" + options: shell.availableAiVariants + visible: shell.isOpenCode + onEdited: value => { shell.cfg.ai.opencode_variant = value; shell.aiConnectionEdited(); } + onSelected: value => { shell.cfg.ai.opencode_variant = value; shell.aiConnectionEdited(); } } Column { width: parent.width @@ -1743,7 +1809,7 @@ ShellRoot { compact: true onClicked: { shell.showProgressDetails = !shell.showProgressDetails; - if (shell.showProgressDetails) + if (shell.showProgressDetails && shell.phase !== "progress") Bridge.logTail(150, r => { if (r.ok) shell.logLines = r.data.lines; }); } } @@ -1778,9 +1844,11 @@ ShellRoot { font.pixelSize: Theme.fontSmall wrapMode: Text.WrapAnywhere onTextChanged: { - if (logFlickable.contentHeight > logFlickable.height) { - logFlickable.contentY = logFlickable.contentHeight - logFlickable.height; - } + Qt.callLater(() => { + if (logFlickable.contentHeight > logFlickable.height) { + logFlickable.contentY = logFlickable.contentHeight - logFlickable.height; + } + }); } } }