fix: record reasoning effort consistently in usage logs (#6641)

This commit is contained in:
Seefs
2026-08-10 12:48:14 +08:00
committed by GitHub
parent 7dd1000a19
commit eab18a8357
10 changed files with 333 additions and 14 deletions
@@ -74,6 +74,7 @@ import {
isViolationFeeLog,
getFirstResponseTimeColor,
getResponseTimeColor,
getReasoningEffortVariant,
renderAuditContent,
} from '../../lib/format'
import {
@@ -604,12 +605,9 @@ export function DetailsDialog(props: DetailsDialogProps) {
const useChannel = other?.admin_info?.use_channel
const channelChain =
useChannel && useChannel.length > 0 ? useChannel.join(' → ') : undefined
let reasoningEffortVariant: StatusBadgeProps['variant'] = 'green'
if (other?.reasoning_effort === 'high') {
reasoningEffortVariant = 'orange'
} else if (other?.reasoning_effort === 'medium') {
reasoningEffortVariant = 'yellow'
}
const reasoningEffortVariant = getReasoningEffortVariant(
other?.reasoning_effort
)
return (
<Dialog
+19
View File
@@ -167,6 +167,25 @@ export function parseLogOther(other: string): LogOtherData | null {
}
}
export function getReasoningEffortVariant(
effort: string | undefined
): StatusBadgeProps['variant'] {
switch (effort?.trim().toLowerCase()) {
case 'max':
case 'xhigh':
case 'high':
return 'orange'
case 'medium':
return 'yellow'
case 'low':
case 'minimal':
return 'green'
case 'none':
default:
return 'grey'
}
}
/**
* Get time color based on duration (in seconds)
*/