Twilio pricing constants (0.79¢, 1.3¢) have no source-of-truth comment
Severity: Low
Affected repos: middleware-node, middleware-python
Component boundary: middleware provider registry
Symptom
Both SDKs hard-code Twilio pricing in provider-registry.ts / _provider_registry.py:
- SMS: 0.79¢ per request
- Voice: 1.3¢ per request
No comment explains the source or date. Twilio pricing has changed over the years; nobody knows when these numbers were last reviewed. If they're outdated, the SDK reports stale cost estimates for every Twilio user.
Evidence
middleware-node/src/core/provider-registry.ts — Twilio rules with magic numbers.
middleware-python/recost/_provider_registry.py — same numbers.
Impact
- Cost estimates drift from Twilio's actual pricing over time.
- Same concern applies to other hard-coded fingerprint values for OpenAI, Anthropic, Stripe, etc.
Fix recommendation
Two-part:
- Document the source and date at each price constant:
// Twilio SMS $0.0079/msg as of https://www.twilio.com/sms/pricing, last reviewed 2026-05-01.
- Replace with a sync to
GET /pricing — same feed the extension uses (high/05). The SDKs can sync provider pricing once at init and cache it. Then there's one place to update prices, not five.
Until (2) is in place, at least do (1).
Verification
- Grep for cost-per-request numbers in both registries returns zero hits without a corresponding
// source: ... as of YYYY-MM-DD comment.
Twilio pricing constants (0.79¢, 1.3¢) have no source-of-truth comment
Severity: Low
Affected repos:
middleware-node,middleware-pythonComponent boundary: middleware provider registry
Symptom
Both SDKs hard-code Twilio pricing in
provider-registry.ts/_provider_registry.py:No comment explains the source or date. Twilio pricing has changed over the years; nobody knows when these numbers were last reviewed. If they're outdated, the SDK reports stale cost estimates for every Twilio user.
Evidence
middleware-node/src/core/provider-registry.ts— Twilio rules with magic numbers.middleware-python/recost/_provider_registry.py— same numbers.Impact
Fix recommendation
Two-part:
// Twilio SMS $0.0079/msg as of https://www.twilio.com/sms/pricing, last reviewed 2026-05-01.GET /pricing— same feed the extension uses (high/05). The SDKs can sync provider pricing once at init and cache it. Then there's one place to update prices, not five.Until (2) is in place, at least do (1).
Verification
// source: ... as of YYYY-MM-DDcomment.