Fix model pricing refresh without PowerToys integration - #442
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughLocal usage enrichment now selects enabled ChangesLocal usage enrichment
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to Enabled Codex and Claude providers can now refresh local usage and model pricing without PowerToys enabled, while unsupported and disabled providers remain excluded. No current merge-blocking risk is identified. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Hey, thanks for the PR. I will review it ASAP. |
Thermo-nuclear review: APPROVENo structural blocker found. The fix removes an accidental PowerToys gate from a helper that is actually shared local-usage/pricing enrichment, keeps the PowerToys server itself independently opt-in, and adds focused tests for pipe-off/pipe-on plus supported/enabled provider filtering. The change is one file, deletes a special-case early return, and does not add a new abstraction or provider-specific branch. 1k/CUA: no 1,000-line threshold crossing; no UI/layout behavior changes, so CUA is not required for this diff.
|
Summary
Fix dynamic model-pricing refresh being incorrectly gated behind the optional PowerToys status pipe.
refresh_providersschedules local usage enrichment, butpowertoys_local_usage_provider_idsreturned an empty list wheneverpowertoys_status_pipe_enabledwas false (the default). That enrichment path contains the only call torefresh_unknown_models_if_needed, so a normal installation without PowerToys integration could never download the models.dev pricing cache. Models absent from the bundled table, such asgpt-6-astra, remained marked unpriced even when models.dev already supplied their prices. Refreshing Usage & Spend only rescanned usage and did not fetch the missing catalog.local_usage_provider_ids.Related issue
No existing issue linked. Reproduced on v0.55.0; the same gate is present on current main.
Affected areas
Validation
Native Windows validation against the patched tree:
cargo fmt --all --checkcargo test --workspace --locked: 1,760 tests passed (1,396 shared library, 1 CLI, 363 desktop).cargo clippy --workspace --all-targets --locked -- -D warningspnpm test: 291 tests passed across 47 files.pnpm run build: locale check, TypeScript check, and Vite build passed.pnpm run tauri:build: optimized Windows desktop executable built successfully.The workspace emits an existing ignored member-profile warning; frontend tests emit existing React act/locale-test warnings. No test failures. Used the locked dependencies and pnpm 11.24.0; no lockfiles changed.
Runtime proof
On a Windows installation with Codex enabled,
powertoys_status_pipe_enabled=false, and nomodel-pricing/models-dev-v1.json:gpt-6-astrainmodelPricingCompleteness.partial.unpriced_models.No caches were manually seeded or cleared.
codex-auto-reviewremains unpriced; this change does not invent a price for unknown models.UI / tray proof
No UI layout/control changes. Windows computer-use was unavailable (native helper pipe missing; CUA Driver not installed), so visual UI proof was not captured. The fresh Windows executable and the cache/CLI read-back above provide functional proof of the reported pricing issue, not visual proof.
Notes for reviewers
Local pricing enrichment now runs for enabled Codex/Claude providers even without PowerToys integration. It retains the existing single-flight guard, scan/cache logic, and pricing refresh throttles. The named-pipe server remains independently guarded in
main.rs.Summary by CodeRabbit