fix(#4): remove dead total_cost_usd field; map model enums to readable names
This commit is contained in:
@@ -34,13 +34,13 @@ The `MitmConfig.modify_requests` flag exists and is plumbed through, but no actu
|
||||
|
||||
---
|
||||
|
||||
### 4. `total_cost_usd` Is Dead
|
||||
### ~~4. `total_cost_usd` Is Dead~~ ✅ FIXED
|
||||
|
||||
**File:** `src/mitm/store.rs` (line 28)
|
||||
**File:** `src/mitm/store.rs`
|
||||
|
||||
`ApiUsage.total_cost_usd` is `Option<f64>` but is **always `None`** — set to `None` in all 4 construction sites (`h2_handler.rs` ×2, `intercept.rs` ×2). Neither Anthropic nor Google include cost in API responses.
|
||||
~~`ApiUsage.total_cost_usd` is `Option<f64>` but is **always `None`**.~~
|
||||
|
||||
**Fix:** Either remove the field (simpler), or populate it via a pricing table lookup (model → $/1K tokens) at `record_usage()` time.
|
||||
**Fixed:** Removed the field entirely from `ApiUsage` and all 3 construction sites (`proto.rs`, `intercept.rs` ×2).
|
||||
|
||||
---
|
||||
|
||||
@@ -182,13 +182,6 @@ The LS supports BYOK (Bring Your Own Key) variants for Claude and OpenAI models
|
||||
|
||||
---
|
||||
|
||||
### 13. `total_cost_usd` Could Use Pricing Table
|
||||
### ~~13. `total_cost_usd` Could Use Pricing Table~~ ✅ RESOLVED
|
||||
|
||||
(Extends issue #4)
|
||||
|
||||
Now that we have the full model catalog with proto enum numbers (`docs/ls-binary-analysis.md`), we could build a pricing table mapping model → cost per token. The MITM captures input/output token counts, so cost calculation is just a lookup + multiply.
|
||||
|
||||
Known models that could have pricing:
|
||||
|
||||
- Claude Opus 4.6 (M26/1026), Opus 4.5 (M12/1012)
|
||||
- Gemini 3 Pro High (M8/1008), Pro Low (M7/1007), Flash (M18/1018)
|
||||
Moot — `total_cost_usd` field was removed in issue #4 fix.
|
||||
|
||||
Reference in New Issue
Block a user