Skip to content

Conversation

@wjiayis
Copy link
Member

@wjiayis wjiayis commented Jan 24, 2026

Problem Description

Prod breaks when user provides their own API key.

image Screenshot 2026-01-24 at 4 36 52 PM

Cause of Problem

This is because endpoint, API key and model name are hardcoded to be OpenRouter compatible in some methods.

Solution

This PR fixes this breakage by making the definition of endpoint, API key and model name conditional on whether user specifies their own API key.

image Screenshot 2026-01-24 at 5 58 14 PM

Notes to Reviewers

Pls help to test this PR's compatibility with OpenRouter API. I only tested it with OpenAI API as I only have OpenAI API key.

@wjiayis wjiayis marked this pull request as draft January 24, 2026 09:24
@wjiayis wjiayis marked this pull request as ready for review January 24, 2026 10:00
@4ndrelim 4ndrelim self-requested a review January 24, 2026 13:34
@Junyi-99 Junyi-99 added the bug Something isn't working label Jan 24, 2026
@Junyi-99 Junyi-99 moved this from Icebox to In review in Project PaperDebugger Jan 24, 2026
@Junyi-99 Junyi-99 self-requested a review January 24, 2026 15:10
@Junyi-99 Junyi-99 added the good first issue Good for newcomers label Jan 24, 2026
@wjiayis
Copy link
Member Author

wjiayis commented Jan 24, 2026

Sure, I'll get it done tmr 25/01

@wjiayis
Copy link
Member Author

wjiayis commented Jan 25, 2026

@4ndrelim Updated my fix based on your suggested changes!

The deeper root cause of this bug is that in getDefaultParamsV2, the input modelSlug is by default prefixed with openai/. While the logic in the method implements a substring match, the final parameter passed to openaiv3.ChatCompletionNewParams is still the original modelSlug. I stripped the prefix if a custom model is passed.

Edit: This is the same issue as #99. Either this PR or #100 (which debugs #99) can be used to solve the problem. On hindsight, #100 is probably a more native fix.

@wjiayis wjiayis requested a review from 4ndrelim January 25, 2026 07:26
@wjiayis wjiayis mentioned this pull request Jan 25, 2026
@wjiayis
Copy link
Member Author

wjiayis commented Jan 25, 2026

Closing this PR as it solves the same purpose as #100, with #100 being a more native fix.

@wjiayis wjiayis closed this Jan 25, 2026
@github-project-automation github-project-automation bot moved this from In review to Done in Project PaperDebugger Jan 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working good first issue Good for newcomers

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants