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:
lzt404 committed 2026-10-04 17:31:52 +08:00
1 parent 0e7437493d
commit dfba9b019f
20 files changed
+652 -152

No files matched your search

+1
View File
@@ -55,6 +55,7 @@ const records = Array.from({ length: 400 }, (_, index) => ({
failure_status: index % 4 === 0 ? 429 : 0,
failure_body: index % 4 === 0 ? 'Rate limit exceeded' : '',
provider: 'test-provider',
auth_type: index % 2 ? 'oauth' : 'apikey',
model: index % 3 ? 'test-model' : 'secondary-model',
alias: '',
reasoning_effort: 'high',
+4 -1
View File
@@ -12,6 +12,7 @@ localStorage.setItem('cpa-gui.usage-events-visible-cols.v3', JSON.stringify([
'time', 'key', 'source', 'model', 'effort', 'result', 'request', 'latency', 'speed', 'total', 'cache', 'provider',
]));
localStorage.removeItem('cpa-gui.usage-events-visible-cols.v2');
localStorage.removeItem('cpa-gui.usage-events-visible-cols.v4');
localStorage.removeItem('cpa-gui.usage-events-col-widths.v2');
document.documentElement.dataset.theme = params.get('theme') || 'light';
@@ -36,7 +37,9 @@ const record = (id: string, model: string, alias: string, response_model?: strin
canceled: false,
failure_status: 0,
failure_body: '',
provider: 'test-provider',
provider: 'codex',
auth_type: id === 'differing' ? 'apikey' : id === 'matching' ? 'oauth' : undefined,
cost: id === 'differing' ? { total: 0.0042, pricing_model: 'gpt-6-astra' } : id === 'matching' ? { total: 0, pricing_model: 'gpt-6-sol' } : null,
model,
alias,
...(response_model === undefined ? {} : { response_model }),