mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-19 10:02:04 +08:00
Merge pull request #7971 from Kilo-Org/session/agent_ab4d50f6-2609-4d1d-97fd-d24b2ba5c30d
fix(vscode): show friendly model name in notification "Try model" button
This commit is contained in:
@@ -6,6 +6,7 @@ import { useProvider } from "../../context/provider"
|
||||
import { useLanguage } from "../../context/language"
|
||||
import { KILO_PROVIDER_ID } from "../../../../src/shared/provider-model"
|
||||
import { TelemetryEventName } from "../../../../src/services/telemetry/types"
|
||||
import { stripSubProviderPrefix } from "../shared/model-selector-utils"
|
||||
|
||||
export const KiloNotifications: Component = () => {
|
||||
const { filteredNotifications, dismiss } = useNotifications()
|
||||
@@ -61,6 +62,14 @@ export const KiloNotifications: Component = () => {
|
||||
return true
|
||||
})
|
||||
|
||||
const suggestedName = createMemo(() => {
|
||||
const suggestion = suggestedModel()
|
||||
if (!suggestion) return undefined
|
||||
const model = provider.findModel(suggestion)
|
||||
if (!model?.name) return undefined
|
||||
return stripSubProviderPrefix(model.name)
|
||||
})
|
||||
|
||||
const handleTryModel = () => {
|
||||
const suggestion = suggestedModel()
|
||||
if (!suggestion) return
|
||||
@@ -88,7 +97,7 @@ export const KiloNotifications: Component = () => {
|
||||
<div class="kilo-notifications-footer">
|
||||
<Show when={canSwitchModel()}>
|
||||
<button class="kilo-notifications-action-btn" onClick={handleTryModel}>
|
||||
{language.t("notifications.action.tryModel")}
|
||||
{language.t("notifications.action.tryModel", { model: suggestedName() ?? "" })}
|
||||
</button>
|
||||
</Show>
|
||||
<Show when={current()?.action}>
|
||||
|
||||
+1
-1
@@ -1282,5 +1282,5 @@ export const dict = {
|
||||
"notifications.action.previous": "Previous",
|
||||
"notifications.action.next": "Next",
|
||||
"notifications.action.close": "Close",
|
||||
"notifications.action.tryModel": "Try model",
|
||||
"notifications.action.tryModel": "Try {{model}}",
|
||||
}
|
||||
|
||||
+1
-1
@@ -1311,5 +1311,5 @@ export const dict = {
|
||||
"notifications.action.previous": "Previous",
|
||||
"notifications.action.next": "Next",
|
||||
"notifications.action.close": "Close",
|
||||
"notifications.action.tryModel": "Try model",
|
||||
"notifications.action.tryModel": "Try {{model}}",
|
||||
}
|
||||
|
||||
+1
-1
@@ -1307,5 +1307,5 @@ export const dict = {
|
||||
"notifications.action.previous": "Previous",
|
||||
"notifications.action.next": "Next",
|
||||
"notifications.action.close": "Close",
|
||||
"notifications.action.tryModel": "Try model",
|
||||
"notifications.action.tryModel": "Try {{model}}",
|
||||
}
|
||||
|
||||
+1
-1
@@ -1298,5 +1298,5 @@ export const dict = {
|
||||
"notifications.action.previous": "Previous",
|
||||
"notifications.action.next": "Next",
|
||||
"notifications.action.close": "Close",
|
||||
"notifications.action.tryModel": "Try model",
|
||||
"notifications.action.tryModel": "Try {{model}}",
|
||||
}
|
||||
|
||||
+1
-1
@@ -1325,5 +1325,5 @@ export const dict = {
|
||||
"notifications.action.previous": "Previous",
|
||||
"notifications.action.next": "Next",
|
||||
"notifications.action.close": "Close",
|
||||
"notifications.action.tryModel": "Try model",
|
||||
"notifications.action.tryModel": "Try {{model}}",
|
||||
} satisfies Partial<Record<Keys, string>>
|
||||
|
||||
@@ -1310,5 +1310,5 @@ export const dict = {
|
||||
"notifications.action.previous": "Previous",
|
||||
"notifications.action.next": "Next",
|
||||
"notifications.action.close": "Close",
|
||||
"notifications.action.tryModel": "Try model",
|
||||
"notifications.action.tryModel": "Try {{model}}",
|
||||
}
|
||||
|
||||
+1
-1
@@ -1315,5 +1315,5 @@ export const dict = {
|
||||
"notifications.action.previous": "Previous",
|
||||
"notifications.action.next": "Next",
|
||||
"notifications.action.close": "Close",
|
||||
"notifications.action.tryModel": "Try model",
|
||||
"notifications.action.tryModel": "Try {{model}}",
|
||||
}
|
||||
|
||||
+1
-1
@@ -1328,5 +1328,5 @@ export const dict = {
|
||||
"notifications.action.previous": "Previous",
|
||||
"notifications.action.next": "Next",
|
||||
"notifications.action.close": "Close",
|
||||
"notifications.action.tryModel": "Try model",
|
||||
"notifications.action.tryModel": "Try {{model}}",
|
||||
}
|
||||
|
||||
+1
-1
@@ -1297,5 +1297,5 @@ export const dict = {
|
||||
"notifications.action.previous": "Previous",
|
||||
"notifications.action.next": "Next",
|
||||
"notifications.action.close": "Close",
|
||||
"notifications.action.tryModel": "Try model",
|
||||
"notifications.action.tryModel": "Try {{model}}",
|
||||
}
|
||||
|
||||
+1
-1
@@ -1285,5 +1285,5 @@ export const dict = {
|
||||
"notifications.action.previous": "Previous",
|
||||
"notifications.action.next": "Next",
|
||||
"notifications.action.close": "Close",
|
||||
"notifications.action.tryModel": "Try model",
|
||||
"notifications.action.tryModel": "Try {{model}}",
|
||||
}
|
||||
|
||||
+1
-1
@@ -1303,5 +1303,5 @@ export const dict = {
|
||||
"notifications.action.previous": "Previous",
|
||||
"notifications.action.next": "Next",
|
||||
"notifications.action.close": "Close",
|
||||
"notifications.action.tryModel": "Try model",
|
||||
"notifications.action.tryModel": "Try {{model}}",
|
||||
}
|
||||
|
||||
+1
-1
@@ -1296,5 +1296,5 @@ export const dict = {
|
||||
"notifications.action.previous": "Previous",
|
||||
"notifications.action.next": "Next",
|
||||
"notifications.action.close": "Close",
|
||||
"notifications.action.tryModel": "Try model",
|
||||
"notifications.action.tryModel": "Try {{model}}",
|
||||
} satisfies Partial<Record<Keys, string>>
|
||||
|
||||
+1
-1
@@ -1306,5 +1306,5 @@ export const dict = {
|
||||
"notifications.action.previous": "Previous",
|
||||
"notifications.action.next": "Next",
|
||||
"notifications.action.close": "Close",
|
||||
"notifications.action.tryModel": "Try model",
|
||||
"notifications.action.tryModel": "Try {{model}}",
|
||||
}
|
||||
|
||||
+1
-1
@@ -1305,5 +1305,5 @@ export const dict = {
|
||||
"notifications.action.previous": "Previous",
|
||||
"notifications.action.next": "Next",
|
||||
"notifications.action.close": "Close",
|
||||
"notifications.action.tryModel": "Try model",
|
||||
"notifications.action.tryModel": "Try {{model}}",
|
||||
}
|
||||
|
||||
+1
-1
@@ -1281,5 +1281,5 @@ export const dict = {
|
||||
"notifications.action.previous": "Previous",
|
||||
"notifications.action.next": "Next",
|
||||
"notifications.action.close": "Close",
|
||||
"notifications.action.tryModel": "Try model",
|
||||
"notifications.action.tryModel": "Try {{model}}",
|
||||
}
|
||||
|
||||
+1
-1
@@ -1295,5 +1295,5 @@ export const dict = {
|
||||
"notifications.action.previous": "Previous",
|
||||
"notifications.action.next": "Next",
|
||||
"notifications.action.close": "Close",
|
||||
"notifications.action.tryModel": "Try model",
|
||||
"notifications.action.tryModel": "Try {{model}}",
|
||||
}
|
||||
|
||||
+1
-1
@@ -1258,5 +1258,5 @@ export const dict = {
|
||||
"notifications.action.previous": "Previous",
|
||||
"notifications.action.next": "Next",
|
||||
"notifications.action.close": "Close",
|
||||
"notifications.action.tryModel": "Try model",
|
||||
"notifications.action.tryModel": "Try {{model}}",
|
||||
} satisfies Partial<Record<Keys, string>>
|
||||
|
||||
+1
-1
@@ -1261,5 +1261,5 @@ export const dict = {
|
||||
"notifications.action.previous": "Previous",
|
||||
"notifications.action.next": "Next",
|
||||
"notifications.action.close": "Close",
|
||||
"notifications.action.tryModel": "Try model",
|
||||
"notifications.action.tryModel": "Try {{model}}",
|
||||
} satisfies Partial<Record<Keys, string>>
|
||||
|
||||
Reference in New Issue
Block a user