feat: improve request pricing, model diagnostics, and client discovery
- Align response model handling with CPA-Manager-Plus and flag routing mismatches - Add per-request costs and CSV export; fix mixed-context cost aggregation - Display API-reported access types and move providers next to timestamps - Use white table backgrounds and simplify cost and status displays - Expand client discovery paths, validate executables, and prioritize installed clients - Add model, pricing, client discovery, and UI regression tests
This commit is contained in:
1 parent
0e7437493d
commit
dfba9b019f
20 files changed
+652
-152
No files matched your search
@@ -0,0 +1,12 @@
|
||||
/** Match CPA-Manager-Plus request monitoring: compare the response with the routed model. */
|
||||
export function usageModelDetails(model: string, alias = '', response = '') {
|
||||
const resolved = model.trim();
|
||||
const requested = alias.trim() || resolved || '—';
|
||||
const responseModel = response.trim();
|
||||
return {
|
||||
requested, resolved, response: responseModel,
|
||||
showResolved: Boolean(resolved && resolved !== requested),
|
||||
mismatch: Boolean(responseModel && resolved && responseModel !== resolved),
|
||||
showResponseInTooltip: Boolean(responseModel && (!resolved || responseModel !== resolved)),
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
/** Usage API values describe the route, not the brand implied by a model name. */
|
||||
export function usageProviderDetails(provider: string, authType = '') {
|
||||
const rawProvider = provider.trim();
|
||||
const rawAuthType = authType.trim();
|
||||
const labels: Record<string, string> = {
|
||||
codex: 'Codex', claude: 'Claude', gemini: 'Gemini', aistudio: 'AI Studio',
|
||||
antigravity: 'Antigravity', openai: 'OpenAI', 'openai-compatibility': 'OpenAI Compatible',
|
||||
vertex: 'Vertex AI', 'vertex-ai': 'Vertex AI', xai: 'xAI', grok: 'Grok',
|
||||
};
|
||||
return {
|
||||
name: labels[rawProvider.toLowerCase()] ?? (rawProvider || '—'),
|
||||
access: rawAuthType.toLowerCase() === 'apikey' ? 'API'
|
||||
: rawAuthType.toLowerCase() === 'oauth' ? 'OAuth'
|
||||
: rawAuthType && rawAuthType.toLowerCase() !== 'unknown' ? rawAuthType : '',
|
||||
rawProvider,
|
||||
rawAuthType,
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user