improvement(trace): billing trace span typing#4375
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Adds first-class support for Reviewed by Cursor Bugbot for commit dd71d11. Configure here. |
Greptile SummaryThis PR extends Confidence Score: 5/5Safe to merge — all changes are additive typing improvements with no logic mutations except No bugs identified. The type narrowing is correct, the No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["Provider response\n(response.cost.toolCost)"] -->|"sumToolCosts()"| B["providers/index.ts\nattaches toolCost to response.cost"]
B -->|"BYOK: zeroModelSegmentCosts()\n(model segments only — tool preserved)"| C["ProviderTiming.timeSegments"]
B -->|"enrichWithProviderMetadata()"| D["span-factory.ts\nspan.cost = {input, output, total, toolCost?}"]
D -->|"toolCost > 0 guard"| E["TraceSpan.cost.toolCost\n(new field in types.ts)"]
E -->|"calculateCostSummary()"| F["logging-factory.ts\nmodels[model].toolCost accumulator"]
F --> G["Cost summary\n(totalCost, models[x].toolCost)"]
Reviews (1): Last reviewed commit: "improvement(trace): billing trace span t..." | Re-trigger Greptile |
Summary
Minor typing improvement to make invariants clearer for trace spans.
Type of Change
Testing
N/A
Checklist