Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions frontend/src/hooks/useOpenCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,11 @@ export const useSendPrompt = (opcodeUrl: string | null | undefined, directory?:
};

if (model) {
const [providerID, modelID] = model.split("/");
if (providerID && modelID) {
const [providerID, ...rest] = model.split("/");
if (providerID && rest.length > 0) {
requestData.model = {
providerID,
modelID,
modelID: rest.join("/"),
};
Comment on lines +347 to 352
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current validation only checks rest.length > 0, which allows inputs like "provider/" to send modelID: "" (and differs from existing parsing that checks !modelID). Consider computing const modelID = rest.join('/') and requiring providerID && modelID before setting requestData.model (to avoid empty/trailing-slash cases).

Copilot uses AI. Check for mistakes.
Comment on lines +347 to 352
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description checklist says tests were added/updated, but this PR only changes useOpenCode.ts and doesn't include any test changes. Please either add/adjust tests for the model parsing behavior or update the PR description/checklist to match what was actually changed.

Copilot uses AI. Check for mistakes.
}
}
Expand Down
Loading