fix(webui): capture all-channel chat history and correct input source

- handleChat now injects with source=webui so the LLM no longer sees
  cli as the input channel
- subscribe to EventRawInput/EventAgentOutput to persist every
  conversation turn from all channels (cli/qq/webui), replacing the
  manual webui-only addChatMsg to avoid duplicates
- ChatMsg gains a source field; GUI shows a channel badge for
  non-webui messages
This commit is contained in:
root
2026-08-01 14:06:18 +08:00
parent dbbd73b930
commit 94312d714a
3 changed files with 41 additions and 3 deletions

View File

@ -371,6 +371,9 @@ function renderChat() {
});
}
var body = rc + tcs + '<div class="text">' + c + '</div>';
if (m.source && m.source !== 'webui') {
body = '<div class="msg-source">' + escHtml(__('通道','Channel')) + ': ' + escHtml(m.source) + '</div>' + body;
}
if (role === 'system') {
html += '<div class="msg msg-system"><div class="msg-bubble">' + body + '</div></div>';
} else {