show chat run errors as agent messages (#887)

This commit is contained in:
ekko
2026-05-21 09:05:17 +08:00
committed by GitHub
parent 40109e9c42
commit 3612a76735
6 changed files with 157 additions and 46 deletions
@@ -34,6 +34,7 @@ const { t } = useI18n();
const toast = useMessage();
const isSystem = computed(() => props.message.role === "system");
const isAgentError = computed(() => props.message.role === "assistant" && props.message.systemType === "error");
const effectiveHeadingIdPrefix = computed(() => props.headingIdPrefix || `msg-${props.message.id}`);
const isCommandMessage = computed(() => props.message.role === "command" || props.message.systemType === "command");
@@ -790,6 +791,7 @@ onBeforeUnmount(() => {
class="message-bubble"
:class="{
system: isSystem,
'agent-error': isAgentError,
command: isCommandMessage,
'command-error': isCommandError,
'speech-playing': isPlayingThisMessage && !isPausedThisMessage,
@@ -1043,6 +1045,12 @@ onBeforeUnmount(() => {
background-color: $msg-assistant-bg;
border-radius: 10px;
}
.message-bubble.agent-error {
color: $error;
background-color: rgba(var(--error-rgb), 0.06);
border: 1px solid rgba(var(--error-rgb), 0.2);
}
}
&.tool {
@@ -1120,6 +1128,20 @@ onBeforeUnmount(() => {
background-color: rgba(var(--warning-rgb), 0.06);
}
&.agent-error {
color: $error;
background-color: rgba(var(--error-rgb), 0.06);
border: 1px solid rgba(var(--error-rgb), 0.2);
:deep(.markdown-body),
:deep(.markdown-body p),
:deep(.markdown-body li),
:deep(.markdown-body strong),
:deep(.markdown-body code) {
color: $error;
}
}
&.speech-playing {
box-shadow:
0 0 0 2px #ff6b6b,