Corrected bug in openrouter.ts and pre-commit and pre-push husky scripts #1853
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Context
This PR is primarily related to #1330 where selecting a free model in OpenRouter still displays pricing information when it should not.
During the process of attempting to commit the changes to my forked copy, I also ran into issues with the husky script not finding npm and npx on my system PATH (I'm using Windows 11). I corrected the issue by adding a conditional statement to append ".cmd" to the npm and npx commands respectively to make GitBash happy when running the scripts.
Implementation
OpenRouter Issue
A small correction to a case statement on line 257 of openrouter.ts resolved the problem (see #1330 for details).
Corrected code:
Screenshots
How to Test
Go to the Settings, select OpenRouter and choose the
deepseek/deepseek-r1-distill-llama-70b:free(or any free model). The pricing information will not be shown on the panel.Get in Touch
I'm on Discord as Jdo300
Important
Fixes free model pricing display in
openrouter.tsand updates Husky scripts for Windows compatibility.openrouter.ts:getOpenRouterModels()to prevent free models from displaying pricing information..husky/pre-commitand.husky/pre-pushto append.cmdtonpxandnpmcommands on Windows systems.This description was created by
for d2333c8. It will automatically update as commits are pushed.