fix(tui): show content filter finishes

This commit is contained in:
James Long 2026-07-02 03:09:59 +00:00 committed by 𝓛𝓲𝓽𝓽𝓵𝓮 𝓕𝓻𝓪𝓷𝓴
commit cbe1b7d67e
3 changed files with 39 additions and 20 deletions

View file

@ -297,6 +297,7 @@ export function SessionTurn(
const error = createMemo(
() => assistantMessages().find((m) => m.error && m.error.name !== "MessageAbortedError")?.error,
)
const contentFiltered = createMemo(() => assistantMessages().some((m) => m.finish === "content-filter"))
const showAssistantCopyPartID = createMemo(() => {
const messages = assistantMessages()
@ -315,6 +316,7 @@ export function SessionTurn(
return undefined
})
const errorText = createMemo(() => {
if (contentFiltered()) return "The response was blocked by the provider's content filter"
const msg = error()?.data?.message
if (typeof msg === "string") return unwrap(msg)
if (msg === undefined || msg === null) return ""
@ -525,7 +527,7 @@ export function SessionTurn(
</div>
</div>
</Show>
<Show when={error()}>
<Show when={error() || contentFiltered()}>
<Card variant="error" class="error-card">
{errorText()}
</Card>