mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-30 16:23:31 +00:00
fix(usage): hide mapped reasoning effort from users
Users only see the reasoning effort they requested. Admins still see the requested value plus the forwarded mapped value, matching the model column's requested vs upstream split.
This commit is contained in:
@@ -93,14 +93,14 @@
|
||||
<template #cell-reasoning_effort="{ row }">
|
||||
<div v-if="hasReasoningEffortMapping(row)" class="space-y-0.5 text-xs">
|
||||
<div class="font-medium text-gray-900 dark:text-white">
|
||||
{{ formatReasoningEffort(row.requested_reasoning_effort) }}
|
||||
{{ formatReasoningEffort(row.reasoning_effort) }}
|
||||
</div>
|
||||
<div class="text-gray-500 dark:text-gray-400">
|
||||
<span class="mr-0.5">↳</span>{{ formatReasoningEffort(row.reasoning_effort) }}
|
||||
<span class="mr-0.5">↳</span>{{ formatReasoningEffort(row.upstream_reasoning_effort) }}
|
||||
</div>
|
||||
</div>
|
||||
<span v-else class="text-sm text-gray-900 dark:text-white">
|
||||
{{ formatReasoningEffort(row.requested_reasoning_effort || row.reasoning_effort) }}
|
||||
{{ formatReasoningEffort(row.reasoning_effort) }}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
@@ -596,8 +596,8 @@ const ipGeoBatchLoading = ref(false)
|
||||
const showIpGeoToolbar = computed(() => props.columns.some((col) => col.key === 'ip_address'))
|
||||
|
||||
const hasReasoningEffortMapping = (row: AdminUsageLog): boolean => {
|
||||
const requested = row.requested_reasoning_effort?.trim() || ''
|
||||
const forwarded = row.reasoning_effort?.trim() || ''
|
||||
const requested = row.reasoning_effort?.trim() || ''
|
||||
const forwarded = row.upstream_reasoning_effort?.trim() || ''
|
||||
return requested !== '' && forwarded !== '' && !reasoningEffortValuesEqual(requested, forwarded)
|
||||
}
|
||||
|
||||
|
||||
@@ -263,8 +263,8 @@ describe('admin UsageTable tooltip', () => {
|
||||
data: [{
|
||||
request_id: 'req-admin-effort-1',
|
||||
model: 'gpt-5.4',
|
||||
requested_reasoning_effort: 'max',
|
||||
reasoning_effort: 'xhigh',
|
||||
reasoning_effort: 'max',
|
||||
upstream_reasoning_effort: 'xhigh',
|
||||
}],
|
||||
loading: false,
|
||||
columns: [],
|
||||
@@ -291,7 +291,6 @@ describe('admin UsageTable tooltip', () => {
|
||||
data: [{
|
||||
request_id: 'req-admin-effort-2',
|
||||
model: 'gpt-5.6-sol',
|
||||
requested_reasoning_effort: 'max',
|
||||
reasoning_effort: 'max',
|
||||
}],
|
||||
loading: false,
|
||||
@@ -312,6 +311,32 @@ describe('admin UsageTable tooltip', () => {
|
||||
expect(text).not.toContain('↳')
|
||||
})
|
||||
|
||||
it('hides mapped reasoning effort for user rows that only have the requested value', () => {
|
||||
const wrapper = mount(UsageTable, {
|
||||
props: {
|
||||
data: [{
|
||||
request_id: 'req-user-effort-1',
|
||||
model: 'gpt-5.4',
|
||||
reasoning_effort: 'max',
|
||||
}],
|
||||
loading: false,
|
||||
columns: [],
|
||||
},
|
||||
global: {
|
||||
stubs: {
|
||||
DataTable: DataTableStub,
|
||||
EmptyState: true,
|
||||
Icon: true,
|
||||
Teleport: true,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
expect(wrapper.text()).toContain('Max')
|
||||
expect(wrapper.text()).not.toContain('XHigh')
|
||||
expect(wrapper.text()).not.toContain('↳')
|
||||
})
|
||||
|
||||
it.each([
|
||||
{
|
||||
name: 'possible version variant',
|
||||
|
||||
Reference in New Issue
Block a user