diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-30 17:37:46 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-30 17:37:46 +0100 |
| commit | ab537892a9337a13c4d802185e5565ca70027679 (patch) | |
| tree | 8d662736881cc058fa35f2fc42d0926c41fefa66 /desktop/modules/ai | |
| parent | 412dec827b5d87c4138491faf49a0babb229f7e2 (diff) | |
| download | quickshell-ab537892a9337a13c4d802185e5565ca70027679.tar.gz quickshell-ab537892a9337a13c4d802185e5565ca70027679.zip | |
ai: drop local chat
local-chat (llamachat) is archived and uninstalled, superseded by
desktop-assistant, so its row could only ever read stopped and its
buttons called a command that no longer exists. Also folds the control
comment that described llamachat's restart dance down to one line.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/modules/ai')
| -rw-r--r-- | desktop/modules/ai/AiModule.qml | 8 | ||||
| -rw-r--r-- | desktop/modules/ai/README.md | 5 | ||||
| -rwxr-xr-x | desktop/modules/ai/ai-state.sh | 11 | ||||
| -rwxr-xr-x | desktop/modules/ai/test-ai-state.sh | 15 |
4 files changed, 9 insertions, 30 deletions
diff --git a/desktop/modules/ai/AiModule.qml b/desktop/modules/ai/AiModule.qml index 4c50224..32e9712 100644 --- a/desktop/modules/ai/AiModule.qml +++ b/desktop/modules/ai/AiModule.qml @@ -40,21 +40,15 @@ Module { llama: "llama.cpp", sd: "stable-diffusion.cpp", assistant: "Desktop assistant", - chat: "Local chat", }) readonly property string assistantSh: Quickshell.env("HOME") + "/Programming/GIT/desktop-assistant/assistant.sh" - // Each project's own control. llamachat has no restart, and --quit answers before the app is gone, so a --daemon - // straight after would find it still running and do nothing: wait for - // --ping to fail first, up to 5s. + // Each project's own control. readonly property var controls: ({ assistant: { start: [assistantSh, "start"], stop: [assistantSh, "stop"], restart: [assistantSh, "restart"] }, - chat: { start: ["llamachat", "--daemon"], stop: ["llamachat", "--quit"], - restart: ["sh", "-c", "llamachat --quit; for _ in $(seq 50); do " - + "llamachat --ping || break; sleep 0.1; done; exec llamachat --daemon"] }, }) function canStart(app) { return controls[app.name] !== undefined; } diff --git a/desktop/modules/ai/README.md b/desktop/modules/ai/README.md index d87087a..61a1dfe 100644 --- a/desktop/modules/ai/README.md +++ b/desktop/modules/ai/README.md @@ -32,11 +32,8 @@ written in the last 5s. A step slower than that reads idle. | App | Status | Start | Stop | Restart | | --- | --- | --- | --- | --- | | desktop-assistant | `assistant.sh status` | `assistant.sh start` | `assistant.sh stop` | `assistant.sh restart` | -| local chat | `llamachat --ping` | `llamachat --daemon` | `llamachat --quit` | quit, wait for `--ping` to fail (5s at most), `--daemon` | -Restart shows only while an app is running. llamachat's `--quit` answers -before the app has exited, so a `--daemon` sent straight after finds it still -running and does nothing; hence the wait. +Restart shows only while an app is running. Each runs detached, so no exit code comes back; the next poll shows whether it worked. `assistant.sh status` fails when the daemon is down. diff --git a/desktop/modules/ai/ai-state.sh b/desktop/modules/ai/ai-state.sh index a4406ce..9ee0d51 100755 --- a/desktop/modules/ai/ai-state.sh +++ b/desktop/modules/ai/ai-state.sh @@ -12,17 +12,16 @@ # GNU General Public License for more details. # # One sweep of the local AI stack for the drawer's AI page. Always prints -# these four lines, tab separated, and exits 0: +# these three lines, tab separated, and exits 0: # # engine<TAB>llama<TAB>up|down<TAB>idle|busy<TAB>model # engine<TAB>sd<TAB>up|down<TAB>idle|busy<TAB>model, "(sd-cli)" for a CLI run # app<TAB>assistant<TAB>running|stopped<TAB>- -# app<TAB>chat<TAB>running|stopped<TAB>- # # An empty value is "-". A probe that fails reads as down or stopped, not as # an error: every row is something that may simply not be running. # -# The test stubs curl, pgrep and llamachat on PATH and points +# The test stubs curl and pgrep on PATH and points # AI_ASSISTANT and AI_SD_LOG at fixtures; see test-ai-state.sh. set -u @@ -84,12 +83,6 @@ apps() { else row app assistant stopped - fi - - if llamachat --ping >/dev/null 2>&1; then - row app chat running - - else - row app chat stopped - - fi } llama diff --git a/desktop/modules/ai/test-ai-state.sh b/desktop/modules/ai/test-ai-state.sh index aac83fb..e4a6b0d 100755 --- a/desktop/modules/ai/test-ai-state.sh +++ b/desktop/modules/ai/test-ai-state.sh @@ -11,8 +11,8 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# The one runnable check for ai-state.sh. It puts stub curl, pgrep -# and llamachat on PATH and a stub assistant.sh beside them, then runs +# The one runnable check for ai-state.sh. It puts stub curl and pgrep +# on PATH and a stub assistant.sh beside them, then runs # the real script, so nothing here touches the live stack. T_* variables pick # the state each stub reports. # @@ -61,11 +61,6 @@ case "$*" in esac STUB -cat > "$stub/llamachat" <<'STUB' -#!/bin/bash -[[ "$1" == --ping && -n "${T_CHAT:-}" ]] -STUB - cat > "$stub/assistant.sh" <<'STUB' #!/bin/bash [[ "$1" == status && -n "${T_ASSIST:-}" ]] @@ -96,7 +91,7 @@ run() { bash "$here/ai-state.sh" } -apps_down="$(l app assistant stopped -; l app chat stopped -)" +apps_down="$(l app assistant stopped -)" want="$(l engine llama down idle -; l engine sd down idle -) $apps_down" @@ -130,8 +125,8 @@ check "sd-cli running" "$(l engine sd up busy "Krea-2-Turbo-Q6_K.gguf (sd-cli)") got="$(run T_CLI=1 T_SD=1 | sed -n 2p)" check "sd-cli wins over an idle web UI" "$(l engine sd up busy "Krea-2-Turbo-Q6_K.gguf (sd-cli)")" "$got" -want="$(l app assistant running -; l app chat running -)" -got="$(run T_ASSIST=1 T_CHAT=1 | tail -n2)" +want="$(l app assistant running -)" +got="$(run T_ASSIST=1 | tail -n1)" check "every app running" "$want" "$got" printf '\n%d passed, %d failed\n' "$pass" "$fail" |
