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,14 @@
|
||||
import { expect, test } from 'bun:test';
|
||||
import { usageModelDetails } from '../src/services/usageModel';
|
||||
|
||||
test('compares reported response with routed model, not the requested alias', () => {
|
||||
expect(usageModelDetails('gpt-routed', 'my-alias', 'gpt-routed')).toMatchObject({ showResolved: true, mismatch: false, showResponseInTooltip: false });
|
||||
expect(usageModelDetails('gpt-routed', 'my-alias', 'my-alias')).toMatchObject({ mismatch: true });
|
||||
expect(usageModelDetails('gpt-routed', '', 'different')).toMatchObject({ showResolved: false, mismatch: true });
|
||||
});
|
||||
|
||||
test('missing response and route degrade without inventing model names', () => {
|
||||
expect(usageModelDetails('gpt-routed', '', ' ')).toMatchObject({ requested: 'gpt-routed', mismatch: false });
|
||||
expect(usageModelDetails('', 'alias', 'reported')).toMatchObject({ mismatch: false, showResponseInTooltip: true });
|
||||
expect(usageModelDetails(' gpt-routed ', ' gpt-routed ', ' gpt-routed ')).toMatchObject({ showResolved: false, mismatch: false });
|
||||
});
|
||||
Reference in new issue
Block a user