You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(claw): prompt users to purchase credits when selecting a paid model (#1324)
## Summary
- When a user without credits selects a paid model during KiloClaw
onboarding, an inline credit purchase nudge now appears below the model
picker. It offers preset amounts ($10, $20, $50), a Stripe checkout CTA,
and a "Use the free model instead" fallback.
- After completing payment, the user is automatically redirected back to
`/claw` with their model selection preserved via the existing
`payment-return-url` cookie mechanism, a success toast is shown, and
provisioning starts automatically.
- Free model detection uses the shared `isFreeModel()` helper, so
selecting any free model (not just Kilo Auto: Free) from the 500+
dropdown also hides the nudge.
## Verification
- [x] `pnpm typecheck` — passes across all packages
- [x] `pnpm format:check` (oxfmt) — passes
- [x] `pnpm lint` — passes (oxlint + eslint)
## Visual Changes
https://github.com/user-attachments/assets/af69ed1b-46ec-4b50-8a02-8d0549216ec5
## Reviewer Notes
- The Stripe cancel URL still redirects to `/profile` (hardcoded in
`getStripeTopUpCheckoutUrl`). A follow-up could pass a custom cancel URL
so users return to `/claw` on cancellation too.
- The auto-provision effect uses a `useRef` guard (`hasAutoProvisioned`)
to prevent double-firing in React strict mode or on re-renders.
0 commit comments