fix(autosend): invio dettatura robusto e visibile (v0.3.1)
L'auto-invio poteva non scattare senza alcun segnale. Cause eliminate:
- il testo viene passato esplicitamente (sendText) invece di rileggerlo
dal campo; il focus tastiera non viene piu' forzato prima dell'invio
- l'opzione vale "on" salvo disattivazione esplicita (undefined -> on)
- ChatModel::send non rifiuta piu' in silenzio: avviso a schermo
("No session open" / "Wait for the current reply") + log [chat]
- log [hermes] sul percorso trascrizione/auto-invio per la diagnosi
dal terminale
This commit is contained in:
@@ -48,6 +48,6 @@ speaks (validated live against a real instance).
|
||||
|
||||
## Status
|
||||
|
||||
Version 0.3.0 — protocol and C++ core validated against a real `hermes-webui`
|
||||
Version 0.3.1 — protocol and C++ core validated against a real `hermes-webui`
|
||||
(login, sessions, streaming chat, TTS, STT, voice dialog); on-device testing
|
||||
still ongoing.
|
||||
|
||||
+3
-3
@@ -76,12 +76,12 @@ richiede il probe WebUI su :8899). Esito 12/09/2026: unit 9/9, live completo OK.
|
||||
|
||||
```bash
|
||||
cd ~/workspace
|
||||
tar czf harbour-hermes-0.3.0.tar.gz \
|
||||
--transform 's,^harbour-hermes,harbour-hermes-0.3.0,' \
|
||||
tar czf harbour-hermes-0.3.1.tar.gz \
|
||||
--transform 's,^harbour-hermes,harbour-hermes-0.3.1,' \
|
||||
--exclude='.git' harbour-hermes
|
||||
```
|
||||
|
||||
Lo spec si aspetta la directory `harbour-hermes-0.3.0/` (pattern degli altri
|
||||
Lo spec si aspetta la directory `harbour-hermes-0.3.1/` (pattern degli altri
|
||||
progetti: cercato in modo robusto anche per i sorgenti live di sfdk).
|
||||
|
||||
## 5. Dipendenze lato server (WebUI)
|
||||
|
||||
+29
-12
@@ -227,7 +227,10 @@ Page {
|
||||
}
|
||||
return
|
||||
}
|
||||
if (appSettings.ttsAutoRead)
|
||||
var autoRead = appSettings.ttsAutoRead
|
||||
if (autoRead === undefined || autoRead === null)
|
||||
autoRead = false
|
||||
if (autoRead)
|
||||
page.readLast()
|
||||
}
|
||||
onNotice: page.showNotice(text)
|
||||
@@ -237,20 +240,28 @@ Page {
|
||||
target: api
|
||||
onTranscriptionReady: {
|
||||
page.voiceErrors = 0
|
||||
var t = (text === undefined || text === null) ? "" : String(text)
|
||||
var autoSend = appSettings.dictationAutoSend
|
||||
if (autoSend === undefined || autoSend === null)
|
||||
autoSend = true
|
||||
console.log("[hermes] trascrizione: " + t.length + " char, voiceMode="
|
||||
+ page.voiceMode + ", autoSend=" + autoSend)
|
||||
if (page.voiceMode) {
|
||||
if (text.trim().length === 0) {
|
||||
if (t.trim().length === 0) {
|
||||
voiceRetry.restart()
|
||||
return
|
||||
}
|
||||
input.text = text
|
||||
page.voiceState = "sending"
|
||||
page.doSend()
|
||||
page.sendText(t)
|
||||
return
|
||||
}
|
||||
input.text = text
|
||||
input.focus = true
|
||||
if (appSettings.dictationAutoSend)
|
||||
page.doSend()
|
||||
input.text = t
|
||||
if (autoSend) {
|
||||
console.log("[hermes] auto-invio dettatura")
|
||||
page.sendText(t)
|
||||
} else {
|
||||
input.focus = true
|
||||
}
|
||||
}
|
||||
onTranscriptionFailed: {
|
||||
page.showNotice(error)
|
||||
@@ -372,15 +383,21 @@ Page {
|
||||
return qsTr("Voice mode on")
|
||||
}
|
||||
|
||||
function doSend() {
|
||||
var t = input.text
|
||||
if (t.trim().length === 0)
|
||||
// Invio del testo esplicito (non rilegge il campo: nessuna race con la UI).
|
||||
function sendText(t) {
|
||||
var s = String(t).trim()
|
||||
if (s.length === 0)
|
||||
return
|
||||
input.text = ""
|
||||
chat.send(t)
|
||||
console.log("[hermes] sendText: " + s.length + " char, chat.busy=" + chat.busy)
|
||||
chat.send(s)
|
||||
scrollDebounce.restart()
|
||||
}
|
||||
|
||||
function doSend() {
|
||||
sendText(input.text)
|
||||
}
|
||||
|
||||
function readLast() {
|
||||
var t = chat.lastAssistantText()
|
||||
if (t.length === 0) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Name: harbour-hermes
|
||||
Summary: Client for the Hermes Web UI with voice
|
||||
Version: 0.3.0
|
||||
Version: 0.3.1
|
||||
Release: 1
|
||||
Group: Qt/Qt
|
||||
License: MIT
|
||||
@@ -24,6 +24,11 @@ Sessions list, chat with live streaming replies, voice dictation
|
||||
(server-side TTS), plus a hands-free conversation mode.
|
||||
|
||||
%changelog
|
||||
* Sat Sep 12 2026 Carlo Baratto <carlo@carlobaratto.it> - 0.3.1-1
|
||||
- Auto-invio dettatura piu' robusto: il testo viene passato esplicitamente
|
||||
(niente rilettura del campo), l'opzione vale "on" salvo disattivazione
|
||||
esplicita, niente focus tastiera prima dell'invio; i rifiuti di invio
|
||||
ora sono visibili (avviso a schermo + log [chat]/[hermes])
|
||||
* Sat Sep 12 2026 Carlo Baratto <carlo@carlobaratto.it> - 0.3.0-1
|
||||
- Nessuna configurazione cablata nel binario: indirizzo server, voce,
|
||||
engine e preset sono impostazioni dell'app (default neutri; vuoto =
|
||||
|
||||
+15
-1
@@ -1,5 +1,6 @@
|
||||
#include "chatmodel.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QTimer>
|
||||
|
||||
ChatModel::ChatModel(ApiClient *api, QObject *parent)
|
||||
@@ -81,8 +82,21 @@ void ChatModel::resync()
|
||||
void ChatModel::send(const QString &text)
|
||||
{
|
||||
const QString trimmed = text.trimmed();
|
||||
if (trimmed.isEmpty() || m_sessionId.isEmpty() || m_busy)
|
||||
if (trimmed.isEmpty())
|
||||
return;
|
||||
// Rifiuti VISIBILI: prima erano silenziosi, e l'invio automatico poteva
|
||||
// "non fare nulla" senza che si capisse il perché.
|
||||
if (m_sessionId.isEmpty()) {
|
||||
qDebug() << "[chat] send rifiutato: nessuna sessione aperta";
|
||||
emit notice(QStringLiteral("No session open"));
|
||||
return;
|
||||
}
|
||||
if (m_busy) {
|
||||
qDebug() << "[chat] send rifiutato: un turno e' gia' in corso";
|
||||
emit notice(QStringLiteral("Wait for the current reply"));
|
||||
return;
|
||||
}
|
||||
qDebug() << "[chat] invio:" << trimmed.size() << "caratteri";
|
||||
m_finalizedThisRun = false;
|
||||
appendMessage(QStringLiteral("user"), trimmed, false);
|
||||
beginAssistant();
|
||||
|
||||
+2
-2
@@ -19,9 +19,9 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
|
||||
// AppConfigLocation = ~/.config/harbour/hermes (zona persistente della sandbox).
|
||||
app->setOrganizationName(QStringLiteral("harbour"));
|
||||
app->setApplicationName(QStringLiteral("hermes"));
|
||||
app->setApplicationVersion(QStringLiteral("0.3.0"));
|
||||
app->setApplicationVersion(QStringLiteral("0.3.1"));
|
||||
|
||||
qDebug() << "harbour-hermes v0.3.0 build" << __DATE__ << __TIME__;
|
||||
qDebug() << "harbour-hermes v0.3.1 build" << __DATE__ << __TIME__;
|
||||
|
||||
Settings settings;
|
||||
ApiClient api(&settings);
|
||||
|
||||
Reference in New Issue
Block a user