fixes for default model, and to update the manifest.json file

This commit is contained in:
Salman Paracha 2025-07-02 19:05:51 -07:00
parent 5cf4cc8f67
commit fff37bd22e
2 changed files with 16 additions and 5 deletions

View file

@ -251,16 +251,27 @@ Based on your analysis, provide your response in the following JSON formats if y
let targetModel = null;
if (selectedRoute) {
targetModel = await getModelIdForRoute(selectedRoute);
console.log(`${TAG} Resolved model for route "${selectedRoute}" →`, targetModel);
if (!targetModel) {
const { defaultModel } = await new Promise(resolve =>
chrome.storage.sync.get(['defaultModel'], resolve)
);
targetModel = defaultModel || null;
if (targetModel) {
console.log(`${TAG} Falling back to default model: ${targetModel}`);
}
} else {
console.log(`${TAG} Resolved model for route "${selectedRoute}" →`, targetModel);
}
insertRouteLabelForLastUserMessage(selectedRoute);
}
const modifiedBody = { ...originalBody };
if (targetModel) {
modifiedBody.model = targetModel;
console.log(`${TAG} Overriding request with model: ${targetModel}`);
} else {
console.warn(`${TAG} No route/model override applied`);
console.log(`${TAG} No route/model override applied`);
}
await streamToPort(await fetch(url, {