Conversation
Co-authored-by: polv <polv@uoc.edu>
|
Cursor Agent can help with this pull request. Just |
🦋 Changeset detectedLatest commit: 8aa3734 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughIntroduces GPT-5 models across the app: adds model features, constants, and icon mappings; removes OpenRouter Horizon Beta; updates chat title generation to use GPT_5_NANO; and adds a changeset declaring a patch release. Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant C as Client
participant S as Server (v1/chat)
participant T as Title Generator
participant M as Model (GPT_5_NANO or Free)
U->>C: Start new chat
C->>S: POST /v1/chat.new
alt Free model path
S->>T: generateChatTitle(LLAMA_3_3_70B_FREE)
T->>M: Prompt title (free)
else Non-free path
S->>T: generateChatTitle(GPT_5_NANO)
T->>M: Prompt title (GPT_5_NANO)
end
M-->>T: Title text
T-->>S: Title result
S-->>C: Chat created with title
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15 minutes Possibly related PRs
Poem
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
@cursor run pnpm format:fix |
|
@cursoragent , remove openrouter's horizon or beta models please |
|
Learn more about Cursor Agents |
| displayName: "GPT-5-chat", | ||
| reasoning: false, | ||
| }, | ||
|
|
There was a problem hiding this comment.
Bug: Model Registration Incomplete
The GPT_5_NANO model constant is defined and used for chat title generation, but it is not fully registered within the application's model system. It is missing from the MODELS array, making it an invalid ModelId type and causing TypeScript compilation errors. Furthermore, it lacks corresponding entries in the MODEL_DETAILS object, modelFeatures.ts, and iconMap.ts, which will lead to runtime errors when the application attempts to access its properties or display information.
Additional Locations (2)
There was a problem hiding this comment.
Actionable comments posted: 2
🔭 Outside diff range comments (1)
src/lib/common/ai/modelFeatures.ts (1)
20-428: Add missing GPT_5_NANO entry in MODEL_FEATURESThe constant
GPT_5_NANO("openai/gpt-5-nano") is used inmodels.tsand in the chat route but isn’t defined inMODEL_FEATURES. This will lead toundefinedlookups at runtime.Please update:
- File:
src/lib/common/ai/modelFeatures.ts- Action: Insert a new key
"openai/gpt-5-nano"with itscontextLength,pricing, andinputModalities.For example:
"openai/gpt-5-nano": { contextLength: <INSERT_VALUE>, pricing: { prompt: <INSERT_VALUE>, completion: <INSERT_VALUE>, image: 0, web_search: 0, request: 0, }, inputModalities: [/* e.g. "text", "image", … */], },Verify the values against OpenRouter’s model specs or your pricing documentation.
♻️ Duplicate comments (1)
src/lib/common/ai/models.ts (1)
167-167: Existing pricing inconsistency for GPT_5_MINI in FREE_MODELS.This is a duplicate of a previously identified issue where
GPT_5_MINIis incorrectly included inFREE_MODELSdespite having non-zero pricing inmodelFeatures.ts.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
.changeset/swift-buses-cross.md(1 hunks)src/lib/common/ai/modelFeatures.ts(12 hunks)src/lib/common/ai/models.ts(5 hunks)src/lib/components/icons/iconMap.ts(2 hunks)src/lib/server/orpc/routes/v1/chat.ts(2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (4)
src/lib/server/orpc/routes/v1/chat.ts (3)
src/lib/common/ai/models.ts (2)
LLAMA_3_3_70B_FREE(39-39)GPT_5_NANO(18-18)src/lib/server/ai/agents/title.ts (1)
generateChatTitle(17-73)src/lib/server/ai/agents/main.ts (1)
callModel(97-225)
src/lib/components/icons/iconMap.ts (2)
src/lib/common/ai/models.ts (2)
GPT_5_MINI(19-19)GPT_5_CHAT(20-20)scripts/fetchModelFeatures.ts (1)
OpenRouterModel(89-104)
src/lib/common/ai/models.ts (1)
scripts/fetchModelFeatures.ts (2)
OpenRouterModel(89-104)fetchModelFeatures(20-87)
src/lib/common/ai/modelFeatures.ts (1)
scripts/fetchModelFeatures.ts (2)
fetchModelFeatures(20-87)OpenRouterModel(89-104)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Cursor Bugbot
- GitHub Check: build-and-push
- GitHub Check: Lint
🔇 Additional comments (12)
.changeset/swift-buses-cross.md (1)
1-5: LGTM!The changeset follows proper format and accurately describes the patch release for adding GPT-5 models.
src/lib/server/orpc/routes/v1/chat.ts (1)
3-3: Model import updated correctly.The import has been properly updated from
GPT_4_1_NANOtoGPT_5_NANOto align with the GPT-5 model transition.src/lib/components/icons/iconMap.ts (2)
42-43: GPT-5 model imports added correctly.The new GPT-5 models (
GPT_5_MINIandGPT_5_CHAT) have been properly imported and will be available for icon mapping.
71-72: Icon mappings for GPT-5 models are appropriate.Both
GPT_5_MINIandGPT_5_CHATare correctly mapped toOpenAiIcon, which is consistent with their OpenAI branding.src/lib/common/ai/models.ts (4)
18-20: GPT-5 model constants defined correctly.The new GPT-5 model constants follow the proper naming convention and use appropriate OpenAI model identifiers.
81-82: GPT-5 models added to MODELS array.
GPT_5_MINIandGPT_5_CHAThave been properly added to the main models array for availability in the application.
136-137: GPT-5 models highlighted appropriately.Both models are included in the highlighted models list, which will give them proper visibility in the UI.
262-269: GPT-5 model details configured properly.The display names and reasoning settings for the new GPT-5 models are appropriate and consistent with the model capabilities.
src/lib/common/ai/modelFeatures.ts (4)
6-6: Generated timestamp updated correctly.The file has been properly regenerated with a recent timestamp, indicating fresh model features data.
21-31: GPT-5-chat model features configured properly.The model has appropriate context length (400K tokens), pricing, and input modalities including file support.
32-42: GPT-5-mini model features configured properly.The model configuration looks appropriate with 400K context length and support for text, image, and file inputs.
98-108: Verify qwen/qwen3-coder:free model features.The past review flagged this model as missing from MODEL_FEATURES, but it appears to be present now. The previous issue appears to be resolved.
| export const GPT_5_NANO = "openai/gpt-5-nano"; | ||
| export const GPT_5_MINI = "openai/gpt-5-mini"; | ||
| export const GPT_5_CHAT = "openai/gpt-5-chat"; |
There was a problem hiding this comment.
GPT_5_NANO missing from configuration arrays.
GPT_5_NANO is defined but not included in MODELS, HIGHLIGHTED_MODELS, FREE_MODELS arrays or MODEL_DETAILS. However, it's used in src/lib/server/orpc/routes/v1/chat.ts for title generation, which could cause runtime errors.
Add GPT_5_NANO to the appropriate arrays:
GPT_OSS_20B,
+ GPT_5_NANO,
GPT_5_MINI,
GPT_5_CHAT,And add a MODEL_DETAILS entry:
[GPT_OSS_20B]: {
displayName: "GPT-OSS 20B",
reasoning: true,
},
+ [GPT_5_NANO]: {
+ displayName: "GPT-5-nano",
+ reasoning: false,
+ },📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| export const GPT_5_NANO = "openai/gpt-5-nano"; | |
| export const GPT_5_MINI = "openai/gpt-5-mini"; | |
| export const GPT_5_CHAT = "openai/gpt-5-chat"; | |
| // In src/lib/common/ai/models.ts | |
| export const MODELS = [ | |
| GPT_OSS_20B, | |
| + GPT_5_NANO, | |
| GPT_5_MINI, | |
| GPT_5_CHAT, | |
| // …other models | |
| ]; | |
| export const HIGHLIGHTED_MODELS = [ | |
| GPT_OSS_20B, | |
| + GPT_5_NANO, | |
| GPT_5_MINI, | |
| GPT_5_CHAT, | |
| // …other highlighted models | |
| ]; | |
| export const FREE_MODELS = [ | |
| // …other free models | |
| + GPT_5_NANO, | |
| ]; | |
| export const MODEL_DETAILS = { | |
| [GPT_OSS_20B]: { | |
| displayName: "GPT-OSS 20B", | |
| reasoning: true, | |
| }, | |
| + [GPT_5_NANO]: { | |
| + displayName: "GPT-5-nano", | |
| + reasoning: false, | |
| + }, | |
| [GPT_5_MINI]: { | |
| displayName: "GPT-5-mini", | |
| reasoning: false, | |
| }, | |
| [GPT_5_CHAT]: { | |
| displayName: "GPT-5-chat", | |
| reasoning: true, | |
| }, | |
| // …other model entries | |
| }; |
🤖 Prompt for AI Agents
In src/lib/common/ai/models.ts around lines 18 to 20, GPT_5_NANO is declared but
not included in the exported arrays or MODEL_DETAILS; add GPT_5_NANO to the
MODELS array and to any arrays that list available/featured/free models (MODELS,
HIGHLIGHTED_MODELS, FREE_MODELS) consistent with where similar GPT_5_* entries
appear, and add a corresponding entry to MODEL_DETAILS using the same object
shape as the other GPT_5 entries (id/value set to GPT_5_NANO, a human-friendly
name like "GPT-5 Nano", and any family/metadata fields matching the convention
used by GPT_5_MINI/CHAT).
| input.message, | ||
| context.inferenceContext.key, | ||
| input.model.endsWith(":free") ? LLAMA_3_3_70B_FREE : GPT_4_1_NANO, | ||
| input.model.endsWith(":free") ? LLAMA_3_3_70B_FREE : GPT_5_NANO, |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Verify GPT_5_NANO configuration.
The chat title generation now uses GPT_5_NANO for non-free models. However, based on the models file review, GPT_5_NANO is defined but not included in the MODELS, HIGHLIGHTED_MODELS, or FREE_MODELS arrays, and has no entry in MODEL_DETAILS.
🏁 Script executed:
#!/bin/bash
# Verify GPT_5_NANO is properly configured across the codebase
echo "Checking GPT_5_NANO usage and configuration..."
# Check if GPT_5_NANO is in MODELS array
rg -A 5 -B 5 "GPT_5_NANO" src/lib/common/ai/models.ts
# Check for any model features entry
rg -A 10 -B 2 "gpt-5-nano" src/lib/common/ai/modelFeatures.tsLength of output: 677
This will confirm whether GPT_5_NANO has been added to the main model arrays and if there’s a corresponding MODEL_DETAILS entry.
🏁 Script executed:
#!/bin/bash
set -e
echo "Checking array definitions in models.ts for GPT_5_NANO inclusion..."
# Inspect the MODELS array
rg -A5 -B1 "export const MODELS" src/lib/common/ai/models.ts
# Inspect the HIGHLIGHTED_MODELS array
rg -A5 -B1 "export const HIGHLIGHTED_MODELS" src/lib/common/ai/models.ts
# Inspect the FREE_MODELS array
rg -A5 -B1 "export const FREE_MODELS" src/lib/common/ai/models.ts
echo
echo "Searching for MODEL_DETAILS definitions and entries across ai directory..."
rg -n "MODEL_DETAILS" -R src/lib/common/aiLength of output: 1297
🏁 Script executed:
#!/bin/bash
set -e
echo "==== Full MODELS array ===="
awk '/export const MODELS/,/\];/' src/lib/common/ai/models.ts || true
echo
echo "==== Full HIGHLIGHTED_MODELS array ===="
awk '/export const HIGHLIGHTED_MODELS/,/\];/' src/lib/common/ai/models.ts || true
echo
echo "==== Full FREE_MODELS array ===="
awk '/export const FREE_MODELS/,/\];/' src/lib/common/ai/models.ts || true
echo
echo "==== Locate MODEL_DETAILS file(s) ===="
rg -l "MODEL_DETAILS" -g "*.ts" src/lib/common/ai || true
echo
echo "==== MODEL_DETAILS contents (if found) ===="
# Attempt to print MODEL_DETAILS object from likely file
for file in $(rg -l "export const MODEL_DETAILS" -g "*.ts" src/lib/common/ai); do
echo "---- $file ----"
awk '/export const MODEL_DETAILS/,/};/' "$file" || true
doneLength of output: 6610
Missing GPT_5_NANO registration
The chat title logic now falls back to GPT_5_NANO for non-free models, but that model isn’t registered in our central model lists or details. Please add GPT_5_NANO to:
MODELSinsrc/lib/common/ai/models.ts- (Optionally)
HIGHLIGHTED_MODELSif it should appear in the UI carousel MODEL_DETAILSwith a display name and reasoning flag
Locations to update:
- File:
src/lib/common/ai/models.ts- Under
export const MODELS = [...] - Under
export const HIGHLIGHTED_MODELS = [...](if desired)
- Under
- File:
src/lib/common/ai/models.ts- Inside
export const MODEL_DETAILS: Record<ModelId, ModelDetails> = { ... }
- Inside
Example diff:
--- a/src/lib/common/ai/models.ts
@@ export const MODELS = [
GPT_5_CHAT,
+ GPT_5_NANO,
@@ export const HIGHLIGHTED_MODELS = [
GPT_5_CHAT,
+ GPT_5_NANO,
@@ export const MODEL_DETAILS: Record<ModelId, ModelDetails> = {
[GPT_5_CHAT]: {
displayName: "GPT-5-chat",
reasoning: false,
},
+ [GPT_5_NANO]: {
+ displayName: "GPT-5-nano",
+ reasoning: false,
+ },🤖 Prompt for AI Agents
In src/lib/common/ai/models.ts (update the arrays and map where MODELS,
HIGHLIGHTED_MODELS, and MODEL_DETAILS are declared), add a new entry for
GPT_5_NANO: include its id in the exported MODELS array, optionally include it
in HIGHLIGHTED_MODELS if you want it shown in the UI carousel, and add a
MODEL_DETAILS entry keyed by the GPT_5_NANO id with a human-friendly displayName
(e.g., "GPT-5 Nano") and the appropriate reasoning flag (true/false) and any
other required fields to match the ModelDetails shape; ensure imports/types
still validate and run type checks after adding the entries.
This pull request contains changes generated by Cursor background composer.
Summary by CodeRabbit