Add model metadata and free checks to catalog#7
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughAdds ChangesFree Model Check + Capabilities Display
Sequence Diagram(s)sequenceDiagram
participant Browser
participant handleModelCheck
participant Capabilities as llm.Capabilities probe
participant Store
Browser->>handleModelCheck: POST /models/check (provider=openrouter, model=X)
handleModelCheck->>handleModelCheck: validate free + openrouter restriction
handleModelCheck->>Capabilities: GetCapabilities(model=X)
Capabilities-->>handleModelCheck: capabilities result + latency
handleModelCheck->>Store: PutCapabilities (CheckStatus=free_verified, CheckedAt, CheckLatencyMS)
handleModelCheck-->>Browser: re-rendered models page HTML
Browser->>handleSlotAssign: POST /models/assign (provider=openrouter, model=X)
handleSlotAssign->>Store: GetSettings → read free check status
alt CheckStatus != free_verified
handleSlotAssign-->>Browser: 400 Bad Request
else CheckStatus == free_verified
handleSlotAssign->>Store: SaveSettings (currentModel=X)
handleSlotAssign-->>Browser: 200 OK
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 324c5d8471
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| {{$root := .Root}} | ||
| {{with .Model}} | ||
| {{$modelID := .ID}} | ||
| {{$needsFreeCheck := and .Free (ne .Policy "free_verified")}} |
There was a problem hiding this comment.
Restrict free-check gating to OpenRouter
When browsing the Gemini catalog, this predicate is also true for Gemini entries whose prices are unknown/zero, but the check action is only rendered for OpenRouter and /models/check rejects non-OpenRouter models. Those Gemini rows therefore show only disabled assignment buttons and cannot be selected from the UI, even though handleSlotAssign only enforces the verification gate for OpenRouter. Include the catalog provider in $needsFreeCheck.
Useful? React with 👍 / 👎.
Summary
Test Plan
Summary by CodeRabbit
Release Notes
New Features
Improvements