Skip to content

Commit f3111c7

Browse files
committed
chore: remove unused i18n keys for include max output tokens
Removes unused translation strings introduced in PR #6864 that are no longer needed after PR #6921 refactoring. Keys removed: includeMaxOutputTokens, includeMaxOutputTokensDescription, maxOutputTokensLabel, maxTokensGenerateDescription
1 parent b41762e commit f3111c7

File tree

19 files changed

+36
-97
lines changed

19 files changed

+36
-97
lines changed
Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,33 @@
11
import { describe, it, expect } from "vitest"
22
import { openAiNativeModels } from "../openai.js"
33

4+
type Dict = Record<string, unknown>
5+
const hasProp = (obj: Dict, key: string) => Object.prototype.hasOwnProperty.call(obj, key)
6+
const boolProp = (obj: Dict, key: string): boolean | undefined => {
7+
const v = obj[key]
8+
return typeof v === "boolean" ? (v as boolean) : undefined
9+
}
10+
411
describe("openAiNativeModels temperature invariants", () => {
512
it("models with supportsTemperature === false must not specify defaultTemperature", () => {
6-
for (const [id, info] of Object.entries(openAiNativeModels)) {
7-
if ((info as any).supportsTemperature === false) {
8-
expect((info as any).defaultTemperature).toBeUndefined()
13+
const values = Object.values(openAiNativeModels) as Dict[]
14+
for (const info of values) {
15+
const supportsTemp = boolProp(info, "supportsTemperature")
16+
if (supportsTemp === false) {
17+
expect(hasProp(info, "defaultTemperature")).toBe(false)
918
}
1019
}
1120
})
1221

1322
it("gpt-5 family models must have supportsTemperature: false and no defaultTemperature", () => {
14-
const gpt5Ids = ["gpt-5-2025-08-07", "gpt-5-mini-2025-08-07", "gpt-5-nano-2025-08-07"]
23+
const gpt5Ids = ["gpt-5-2025-08-07", "gpt-5-mini-2025-08-07", "gpt-5-nano-2025-08-07"] as const
1524
for (const id of gpt5Ids) {
16-
const info = (openAiNativeModels as any)[id]
25+
// Non-undefined assertion is safe here because the IDs are known keys in openAiNativeModels
26+
const infoUnknown = (openAiNativeModels as Record<string, unknown>)[id]!
27+
const info = infoUnknown as Dict
1728
expect(info).toBeDefined()
18-
expect(info.supportsTemperature).toBe(false)
19-
expect(info.defaultTemperature).toBeUndefined()
29+
expect(boolProp(info, "supportsTemperature")).toBe(false)
30+
expect(hasProp(info, "defaultTemperature")).toBe(false)
2031
}
2132
})
2233
})

webview-ui/src/i18n/locales/ca/settings.json

Lines changed: 1 addition & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/de/settings.json

Lines changed: 1 addition & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/en/settings.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -809,9 +809,5 @@
809809
"customArn": "Custom ARN",
810810
"useCustomArn": "Use custom ARN..."
811811
},
812-
"includeMaxOutputTokens": "Include max output tokens",
813-
"includeMaxOutputTokensDescription": "Send max output tokens parameter in API requests. Some providers may not support this.",
814-
"limitMaxTokensDescription": "Limit the maximum number of tokens in the response",
815-
"maxOutputTokensLabel": "Max output tokens",
816-
"maxTokensGenerateDescription": "Maximum tokens to generate in response"
812+
"limitMaxTokensDescription": "Limit the maximum number of tokens in the response"
817813
}

webview-ui/src/i18n/locales/es/settings.json

Lines changed: 1 addition & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/fr/settings.json

Lines changed: 1 addition & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/hi/settings.json

Lines changed: 1 addition & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/id/settings.json

Lines changed: 1 addition & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/it/settings.json

Lines changed: 1 addition & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/ja/settings.json

Lines changed: 1 addition & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)