mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-25 17:54:34 +08:00
fix: preserve complete session loading error details
This commit is contained in:
1 parent
83c28c026f
commit
80fcaa7ea2
3 files changed
+11
-5
No files matched your search
@@ -243,8 +243,9 @@ describe('runAgentCore runtime contract', () => {
|
||||
})
|
||||
)
|
||||
assert.equal(result.error, undefined)
|
||||
assert.equal(captured?.messages[0].content[0].type, 'text')
|
||||
assert.equal(captured?.messages[0].content[0].text, historyText)
|
||||
const firstBlock = captured?.messages[0].content[0]
|
||||
assert.ok(typeof firstBlock === 'object' && firstBlock.type === 'text')
|
||||
assert.equal(firstBlock.text, historyText)
|
||||
assert.equal(outputBudget, 2048, 'Preserve the configured output budget when the history and answer both fit')
|
||||
})
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
import * as fs from 'fs'
|
||||
import * as path from 'path'
|
||||
import { extractErrorInfo, extractErrorStack } from '../ai/ai-logger'
|
||||
import { extractErrorInfo } from '../ai/ai-logger'
|
||||
|
||||
type LogLevel = 'DEBUG' | 'INFO' | 'WARN' | 'ERROR'
|
||||
|
||||
@@ -92,7 +92,7 @@ function formatData(data: unknown): string {
|
||||
if (data === undefined) return ''
|
||||
if (data instanceof Error) {
|
||||
const info = extractErrorInfo(data)
|
||||
const stack = extractErrorStack(data)
|
||||
const stack = data.stack
|
||||
return JSON.stringify(info) + (stack ? `\n${stack}` : '')
|
||||
}
|
||||
if (typeof data === 'string') return data
|
||||
|
||||
@@ -611,7 +611,12 @@ function getAvatarColorClass(session: AnalysisSession, isActive: boolean) {
|
||||
>
|
||||
<template v-if="!isCollapsed">
|
||||
<p class="text-sm text-gray-600 dark:text-gray-300">{{ t('layout.sessionLoadFailed') }}</p>
|
||||
<p v-if="loadError" class="mt-1 line-clamp-2 text-xs text-gray-400">{{ loadError }}</p>
|
||||
<p
|
||||
v-if="loadError"
|
||||
class="mt-2 text-left text-xs leading-relaxed break-all whitespace-pre-wrap text-gray-400 select-text"
|
||||
>
|
||||
{{ loadError }}
|
||||
</p>
|
||||
<UButton size="xs" variant="soft" class="mt-3" @click="sessionStore.loadSessions()">
|
||||
{{ t('common.retry') }}
|
||||
</UButton>
|
||||
|
||||
Reference in new issue
Block a user