Skip to content

Allow chats when free-plan credits remain by removing post-generation hard block#54

Merged
Abdulmuiz44 merged 1 commit into
codex/ui-redesignfrom
codex/fix-upgrade-modal-for-credit-check
Apr 6, 2026
Merged

Allow chats when free-plan credits remain by removing post-generation hard block#54
Abdulmuiz44 merged 1 commit into
codex/ui-redesignfrom
codex/fix-upgrade-modal-for-credit-check

Conversation

@Abdulmuiz44
Copy link
Copy Markdown
Collaborator

Motivation

  • Users with remaining monthly free credits were still seeing the upgrade/modal because a post-generation gate rejected responses when a single request's tokenCost exceeded the remaining credits.
  • The intended behavior is to allow conversations while any credits remain and only show the upgrade modal when the user's remaining credits are zero.

Description

  • Removed the post-generation hard check that returned an error when tokenCost > creditsRemaining from app/actions/generate.ts.
  • Kept the pre-request credit cap check (creditsRemaining <= 0) intact so blocking still occurs when a user truly has no credits.
  • This change aligns server-side gating with the profile UI which reports remaining credits.

Testing

  • Ran type checking with npm run type-check (which executes tsc --noEmit -p tsconfig.typecheck.json) and it succeeded.

Codex Task

@Abdulmuiz44 Abdulmuiz44 merged commit c85779b into codex/ui-redesign Apr 6, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant