feat(gui): live output streaming, OpenCode variants, GURU fix

This commit is contained in:
Phoebus 2026-09-23 02:36:51 -07:00
parent b4a6b5df80
commit 9eaa844423
5 changed files with 126 additions and 47 deletions

View file

@ -3,7 +3,26 @@
All notable changes are recorded here. The authoritative history is `git log`; All notable changes are recorded here. The authoritative history is `git log`;
this file is the curated, human-readable summary. 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 ## 2026-09-23 — NVIDIA accelerated driver policy, live payload and installed integration

View file

@ -3,30 +3,20 @@
Rolling note between work sessions. **Update this file before you finish**, then 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. commit it. It should be short and current; use `git log` for detail.
- **Last updated:** this session (2026-09-23), NVIDIA accelerated-driver support - **Last updated:** this session (2026-09-23), Installer GUI usability, OpenCode model variants, and Gentoo GURU overlay fix.
(policy, installed Gentoo integration, live ISO payload). - **Current focus:**
- **Current focus:** Implemented NVIDIA support end to end in code and tests: 1. Fixed Gentoo GURU sync error: updated `GURU_REPO_URI` in `phoebus-core::system`
1. `phoebus-core::nvidia` (plus generated `nvidia_devices.rs` from the PCI ID to official mirror `https://anongit.gentoo.org/git/repo/proj/guru.git`, fixing
database) resolves a driver branch and kernel-module flavor from the PCI the chroot `emaint sync -r guru` failure caused by the retired GitHub mirror.
device IDs: Turing+ → current branch with open modules; Maxwell/Pascal/Volta 2. OpenCode model names and variants: model picker displays real human-readable
→ proprietary branch (`-kernel-open`, masked below 595); Fermi/Kepler and names alongside raw IDs, and allows selecting model variants (`default`, `low`,
older → nouveau fallback, reported. Unknown IDs are reported. `high`, `max`), defaulting to `default`.
2. The probe now captures `pci_id`/`pci_address`; `VIDEO_CARDS`, `package.use`, 3. Live terminal output streaming: `Logger` line streaming plumbed through the
`package.accept_keywords`, `package.mask`, `modprobe.d` and dracut follow JSON-RPC bridge to display live command execution in the "Show details" box.
the plan (hybrid Intel/AMD preserved). 4. Desktop & installer defaults: Mango + DankMaterialShell default, Btrfs and
3. Installed Gentoo: a new `nvidia_drivers` install stage (after kernel, Flatpak defaults, streamlined user account setup, DWM keybindings in Mango.
before boot) emerges the driver and regenerates the initramfs; it fails the 5. Built and tested static `phoebus-installer` with musl/CRT-static and bundled
install on failure and records the choice in `/etc/phoebus/nvidia` (also QML components served on fixture host for VM consumption.
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 verified (this session):** - **Last verified (this session):**
- `cargo fmt --all -- --check` clean; `cargo clippy --workspace --all-targets` - `cargo fmt --all -- --check` clean; `cargo clippy --workspace --all-targets`
finished with 0 errors (pre-existing warnings only). finished with 0 errors (pre-existing warnings only).

View file

@ -914,11 +914,6 @@ impl Bridge {
}); });
self.installer.exec.logger.add_listener(log_listener); 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); self.phase.set(DiskPhase::BeforeStorage);
// Consume the approval and mark the session busy before any destructive // Consume the approval and mark the session busy before any destructive
// work: a replay or a second frontend can never reach storage_prepare. // work: a replay or a second frontend can never reach storage_prepare.
@ -932,17 +927,20 @@ impl Bridge {
} }
}); });
let res = self.installer.install_observed( let res = {
let mut observer = JsonObserver {
tx: tx.clone(),
id,
phase: self.phase.clone(),
};
self.installer.install_observed(
&auth, &auth,
self.luks.as_ref(), self.luks.as_ref(),
self.user_password.as_ref(), self.user_password.as_ref(),
self.root_password.as_ref(), self.root_password.as_ref(),
&mut observer, &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);
self.installer.exec.logger.clear_listeners(); self.installer.exec.logger.clear_listeners();
drop(tx); drop(tx);

View file

@ -126,6 +126,10 @@ Singleton {
root.event("progress", msg); root.event("progress", msg);
return; return;
} }
if (msg.event === "log") {
root.event("log", msg);
return;
}
if (msg.id !== undefined && root.pending[msg.id]) { if (msg.id !== undefined && root.pending[msg.id]) {
const cb = root.pending[msg.id]; const cb = root.pending[msg.id];
delete root.pending[msg.id]; delete root.pending[msg.id];

View file

@ -80,6 +80,7 @@ ShellRoot {
property double installStartedMs: 0 property double installStartedMs: 0
property int elapsedSeconds: 0 property int elapsedSeconds: 0
property string lastActivity: "" property string lastActivity: ""
property var availableAiVariants: ["default"]
readonly property var stepTitles: [ readonly property var stepTitles: [
"Welcome", "Welcome",
@ -182,6 +183,7 @@ ShellRoot {
opencodeServerField.inputItem.text = shell.cfg.ai.opencode_server; opencodeServerField.inputItem.text = shell.cfg.ai.opencode_server;
opencodeProviderField.inputItem.text = shell.cfg.ai.opencode_provider; opencodeProviderField.inputItem.text = shell.cfg.ai.opencode_provider;
opencodeModelField.inputItem.text = shell.cfg.ai.opencode_model; 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; opencodePasswordField.inputItem.text = shell.opencodePassword;
pwField.inputItem.text = shell.userPw; pwField.inputItem.text = shell.userPw;
pw2Field.inputItem.text = shell.userPw2; pw2Field.inputItem.text = shell.userPw2;
@ -275,6 +277,9 @@ ShellRoot {
return; return;
shell.initialized = true; shell.initialized = true;
shell.cfg = clone(reply.data.defaults); 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.cfg.storage.disk = "";
shell.step = 0; shell.step = 0;
shell.phase = "form"; shell.phase = "form";
@ -283,6 +288,32 @@ ShellRoot {
shell.loadOptions(); 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() { function refreshHandshake() {
Bridge.refreshHandshake(null); Bridge.refreshHandshake(null);
} }
@ -367,6 +398,7 @@ ShellRoot {
shell.aiCatalog = reply.data; shell.aiCatalog = reply.data;
shell.aiCatalogStatus = (reply.data.models || []).length > 0 ? "ok" : "empty"; shell.aiCatalogStatus = (reply.data.models || []).length > 0 ? "ok" : "empty";
shell.aiCatalogError = ""; shell.aiCatalogError = "";
shell.updateAiVariants();
} else { } else {
shell.aiCatalog = { providers: [], models: [] }; shell.aiCatalog = { providers: [], models: [] };
shell.aiCatalogStatus = reply.error_kind || "error"; 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_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_provider = shell.cfg.ai.opencode_provider || "deepseek";
shell.cfg.ai.opencode_model = shell.cfg.ai.opencode_model || "deepseek-chat"; 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; opencodeServerField.inputItem.text = shell.cfg.ai.opencode_server;
opencodeProviderField.inputItem.text = shell.cfg.ai.opencode_provider; opencodeProviderField.inputItem.text = shell.cfg.ai.opencode_provider;
opencodeModelField.inputItem.text = shell.cfg.ai.opencode_model; opencodeModelField.inputItem.text = shell.cfg.ai.opencode_model;
opencodeVariantField.inputItem.text = shell.cfg.ai.opencode_variant;
} else { } else {
shell.cfg.ai.backend = "direct"; shell.cfg.ai.backend = "direct";
shell.cfg.ai.provider = value; shell.cfg.ai.provider = value;
@ -867,10 +901,23 @@ ShellRoot {
const desc = (event.label || event.stage) + " (" + event.status + ")"; const desc = (event.label || event.stage) + " (" + event.status + ")";
let lines = shell.logLines.slice(); let lines = shell.logLines.slice();
lines.push(desc); lines.push(desc);
if (lines.length > 1000)
lines = lines.slice(lines.length - 1000);
shell.logLines = lines; shell.logLines = lines;
shell.lastActivity = desc; 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() { function restartBackend() {
shell.status = "Restarting the installer backend…"; shell.status = "Restarting the installer backend…";
shell.aiConnected = false; shell.aiConnected = false;
@ -947,6 +994,8 @@ ShellRoot {
function onEvent(name, data) { function onEvent(name, data) {
if (name === "progress") if (name === "progress")
shell.onProgress(data); shell.onProgress(data);
else if (name === "log")
shell.onLogLine(data.line || "");
} }
} }
@ -1373,8 +1422,25 @@ ShellRoot {
placeholder: "choose a model" placeholder: "choose a model"
options: shell.aiCatalog.models options: shell.aiCatalog.models
visible: shell.isOpenCode visible: shell.isOpenCode
onEdited: value => { shell.cfg.ai.opencode_model = value; shell.aiConnectionEdited(); } onEdited: value => {
onSelected: value => { shell.cfg.ai.opencode_model = value; shell.aiConnectionEdited(); } 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 { Column {
width: parent.width width: parent.width
@ -1743,7 +1809,7 @@ ShellRoot {
compact: true compact: true
onClicked: { onClicked: {
shell.showProgressDetails = !shell.showProgressDetails; 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; }); Bridge.logTail(150, r => { if (r.ok) shell.logLines = r.data.lines; });
} }
} }
@ -1778,9 +1844,11 @@ ShellRoot {
font.pixelSize: Theme.fontSmall font.pixelSize: Theme.fontSmall
wrapMode: Text.WrapAnywhere wrapMode: Text.WrapAnywhere
onTextChanged: { onTextChanged: {
Qt.callLater(() => {
if (logFlickable.contentHeight > logFlickable.height) { if (logFlickable.contentHeight > logFlickable.height) {
logFlickable.contentY = logFlickable.contentHeight - logFlickable.height; logFlickable.contentY = logFlickable.contentHeight - logFlickable.height;
} }
});
} }
} }
} }