mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-05 00:47:48 +08:00
feat: Antigravity 端点签名迁移至 gemini:chat,流式 usage 提取重构与请求详情自动刷新
- Antigravity 端点签名从 gemini:cli 统一为 gemini:chat,保留向后兼容,含 DB 迁移 - 流式处理中 usage/completion/text 提取抽离为 _update_ctx_from_provider_event, 支持 envelope 解包后提取,避免格式转换流程中重复计数 - 新增 has_format_conversion 属性,区分真正的格式转换与 envelope rewrite, 修正 usage 展示层的格式转换标记 - 请求详情抽屉对未完成请求支持自动轮询刷新,关闭时自动停止 - 按次计费样式调整;实际成本仅在倍率非 1.0 时显示;缓存日志降级为 trace
This commit is contained in:
@@ -642,19 +642,28 @@ const navigateGroup = (direction: number) => {
|
||||
}
|
||||
|
||||
// 加载请求追踪数据
|
||||
const loadTrace = async () => {
|
||||
const isSilentRefresh = ref(false)
|
||||
const loadTrace = async (silent = false) => {
|
||||
if (!props.requestId) return
|
||||
|
||||
loading.value = true
|
||||
isSilentRefresh.value = silent
|
||||
|
||||
if (!silent) {
|
||||
loading.value = true
|
||||
}
|
||||
error.value = null
|
||||
|
||||
try {
|
||||
trace.value = await requestTraceApi.getRequestTrace(props.requestId)
|
||||
} catch (err: any) {
|
||||
error.value = err.response?.data?.detail || err.message || '加载失败'
|
||||
if (!silent) {
|
||||
error.value = err.response?.data?.detail || err.message || '加载失败'
|
||||
}
|
||||
log.error('加载请求追踪失败:', err)
|
||||
} finally {
|
||||
loading.value = false
|
||||
if (!silent) {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -662,6 +671,12 @@ const loadTrace = async () => {
|
||||
watch(groupedTimeline, (newGroups) => {
|
||||
if (!newGroups || newGroups.length === 0) return
|
||||
|
||||
// 静默刷新时不重置选中状态
|
||||
if (isSilentRefresh.value) {
|
||||
isSilentRefresh.value = false
|
||||
return
|
||||
}
|
||||
|
||||
// 查找成功的组
|
||||
const successIdx = newGroups.findIndex(g => g.primaryStatus === 'success')
|
||||
if (successIdx >= 0) {
|
||||
@@ -712,6 +727,8 @@ watch(() => props.requestId, () => {
|
||||
loadTrace()
|
||||
}, { immediate: true })
|
||||
|
||||
defineExpose({ refresh: () => loadTrace(true) })
|
||||
|
||||
// 格式化时间(详细)
|
||||
const formatTime = (dateStr: string) => {
|
||||
const date = new Date(dateStr)
|
||||
|
||||
Reference in New Issue
Block a user