Skip to content

fix(gateway): block llmgateway provider in credits mode - #1570

Merged
steebchen merged 1 commit into
mainfrom
steebchen/fix-llmgateway-provider
Feb 2, 2026
Merged

steebchen merged 1 commit into
mainfrom
steebchen/fix-llmgateway-provider

Conversation

@steebchen

@steebchen steebchen commented Feb 2, 2026

Copy link
Copy Markdown
Member

Summary

  • Fix confusing error "No API key set in environment for provider: llmgateway" when using the "custom" model in credits mode
  • The "custom" model uses providerId "llmgateway", but the credits mode check only blocked provider === "custom"
  • Now also blocks provider === "llmgateway" in credits mode with the correct error message

Test plan

  • pnpm build passes
  • pnpm test:unit passes (390 tests)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Extended credits-mode restrictions: The llmgateway provider is now blocked in credits mode, aligning with existing custom provider limitations. Requests using these providers in credits mode will be rejected.

The "custom" model uses providerId "llmgateway", but the check for
credits mode only blocked provider === "custom". This caused a
confusing error when using the custom model in credits mode.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 2, 2026 15:56
@steebchen
steebchen enabled auto-merge February 2, 2026 15:56
@coderabbitai

coderabbitai Bot commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

This PR expands the credits-mode restriction to block both "custom" and "llmgateway" providers from being used in requests. Two conditional checks in the chat endpoint were updated to reject requests with either provider type when the project operates in credits mode.

Changes

Cohort / File(s) Summary
Credits Mode Provider Restriction
apps/gateway/src/chat/chat.ts
Expanded conditional checks from blocking only "custom" provider to also blocking "llmgateway" provider in credits mode. The condition was modified in two locations to reject both provider types with a 400 error.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • smakosh
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: blocking the llmgateway provider in credits mode, which directly addresses the confusing error message issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch steebchen/fix-llmgateway-provider

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@steebchen
steebchen added this pull request to the merge queue Feb 2, 2026
Merged via the queue into main with commit 3758e84 Feb 2, 2026
18 of 19 checks passed
@steebchen
steebchen deleted the steebchen/fix-llmgateway-provider branch February 2, 2026 16:06
@steebchen
steebchen removed the request for review from Copilot March 23, 2026 22:01
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.

1 participant