Skip to content

fix(kiloclaw): remove delayed-billing start date that causes Stripe checkout failures#1363

Merged
jeanduplessis merged 2 commits intomainfrom
jdp/remove-billing-start-date
Mar 23, 2026
Merged

fix(kiloclaw): remove delayed-billing start date that causes Stripe checkout failures#1363
jeanduplessis merged 2 commits intomainfrom
jdp/remove-billing-start-date

Conversation

@jeanduplessis
Copy link
Copy Markdown
Contributor

Summary

  • Removes the STRIPE_KILOCLAW_BILLING_START env var and the trial_end logic in checkout session creation. This mechanism deferred billing for pre-launch subscribers until March 23, but Stripe requires trial_end to be at least 48 hours in the future — causing checkout failures for users as we approached that date.
  • New subscriptions now always bill immediately. Pre-launch subscriptions that already have a trial_end are still handled correctly by the existing trialing→active status mapping.
  • Updates the billing spec to remove the configurable billing start date rules and documents the change in the changelog.

Verification

  • pnpm typecheck — passes across all workspace projects
  • pnpm test -- src/routers/kiloclaw-billing-router.test.ts — 25/25 tests pass
  • Pre-push hooks (format, lint, typecheck) all pass

Visual Changes

N/A

Reviewer Notes

  • .env.local still contains STRIPE_KILOCLAW_BILLING_START="2026-03-23" — should be removed manually (file edit was blocked by repo rules). The production env var should also be removed.
  • The trialing→active mapping in stripe-handlers.ts is now only needed for legacy pre-launch subs. A TODO was added to remove it after ~2026-03-23 when those subscriptions transition.

@jeanduplessis jeanduplessis marked this pull request as draft March 21, 2026 11:16
@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot bot commented Mar 21, 2026

Code Review Summary

Status: 1 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

No new issues on commentable PR diff lines.

Fix these issues in Kilo Cloud

Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
src/lib/providers/openrouter/index.ts 23 Removing the deprecated kilo/auto* aliases from /models makes persisted legacy selections disappear from the picker and be cleared on save.
Files Reviewed (14 files)
  • .specs/kiloclaw-billing.md - 0 issues
  • AGENTS.md - 0 issues
  • kiloclaw/controller/src/config-writer.test.ts - 0 issues
  • kiloclaw/controller/src/config-writer.ts - 0 issues
  • kiloclaw/src/durable-objects/kiloclaw-instance/index.ts - 0 issues
  • kiloclaw/src/utils/analytics.ts - 0 issues
  • plans/kiloclaw-billing-promo-codes.md - 0 issues
  • src/app/(app)/claw/components/billing/SubscriptionCard.tsx - 0 issues
  • src/lib/config.server.ts - 0 issues
  • src/lib/kiloclaw/billing-lifecycle-cron.ts - 0 issues
  • src/lib/kiloclaw/stripe-handlers.ts - 0 issues
  • src/lib/kiloclaw/stripe-price-ids.server.ts - 0 issues
  • src/routers/kiloclaw-billing-router.test.ts - 0 issues
  • src/routers/kiloclaw-router.ts - 0 issues

Reviewed by gpt-5.4-20260305 · 464,723 tokens

@jeanduplessis jeanduplessis marked this pull request as ready for review March 23, 2026 06:15
…rial_end rejection

STRIPE_KILOCLAW_BILLING_START was set to 2026-03-23 but Stripe requires
trial_end to be at least 48h in the future, causing checkout failures for
users. Since launch billing is imminent, remove the mechanism entirely
rather than adding a buffer.
…t new users

A canceled trial (plan='trial') was incorrectly treated as a prior paid
subscription, causing post-trial users to see the regular $9/mo price
instead of the $4 intro price at checkout. Now only canceled paid
subscriptions (plan='standard'/'commit') block the intro price.

Also adds KiloClaw Billing section to AGENTS.md requiring the billing
spec be read before making billing-related changes.
@jeanduplessis jeanduplessis force-pushed the jdp/remove-billing-start-date branch from 723f658 to 38acbf4 Compare March 23, 2026 07:28
@jeanduplessis jeanduplessis merged commit 8086ddb into main Mar 23, 2026
18 checks passed
@jeanduplessis jeanduplessis deleted the jdp/remove-billing-start-date branch March 23, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants