fix(cli): stop pre-filling the secrets the server owns (#11436)

Retargetado para release/v3.8.51 (release/v3.8.50 está congelada — freeze issue #11439). Resolvido um conflito de merge não-relacionado em src/shared/utils/wsPath.ts (originado de um refactor já mergeado nessa branch depois do fork deste PR; o diff real deste PR — scripts/dev/sync-env.mjs + tests/unit/sync-env.test.ts — ficou intacto) e revalidado: typecheck:core limpo, 13/13 testes focados passando.

Segue o precedente correto do #1622 (STORAGE_ENCRYPTION_KEY) para os dois secrets restantes que a postinstall preenchia por engano, defeituando o mecanismo de ensureSecrets(). Obrigado pela contribuição!
This commit is contained in:
Dizzle
2026-08-25 01:04:11 +02:00
committed by GitHub
parent 66ecc09050
commit 6e8fc94732
33 changed files with 914 additions and 114 deletions

View File

@@ -70,6 +70,7 @@ const AUTHORITATIVE_CONTEXT_WINDOW_MODEL_IDS = new Set([
"glm-5.3",
"glm-5.3-high",
"glm-5.3-low",
"glm-5.3-max",
"glm-5.2",
"glm-5.2-high",
"glm-5.2-max",
@@ -573,6 +574,13 @@ export const MODEL_SPECS: Record<string, ModelSpec> = {
supportsThinking: true,
supportsTools: true,
},
"glm-5.3-max": {
maxOutputTokens: 131072,
contextWindow: 1000000,
thinkingBudgetCap: 38912,
supportsThinking: true,
supportsTools: true,
},
// ── Z.AI GLM-5.2 (1M context, 128K max output, effort tiers) ────
"glm-5.2": {

View File

@@ -0,0 +1,54 @@
export const MODEL_SUPPORTED_ENDPOINT_VALUES = [
"chat",
"embeddings",
"rerank",
"images",
"videos",
"audio-speech",
"audio-transcriptions",
"images-generations",
// Persisted legacy values remain valid input and normalize on write/edit.
"video",
"audio",
] as const;
export type ModelSupportedEndpoint = (typeof MODEL_SUPPORTED_ENDPOINT_VALUES)[number];
export function normalizeModelSupportedEndpoints(endpoints: readonly string[]): string[] {
const normalized: string[] = [];
const add = (endpoint: string) => {
if (!normalized.includes(endpoint)) normalized.push(endpoint);
};
for (const endpoint of endpoints) {
if (endpoint === "video") {
add("videos");
} else if (endpoint === "audio") {
add("audio-speech");
add("audio-transcriptions");
} else {
add(endpoint);
}
}
return normalized;
}
export function classifyModelSupportedEndpoints(endpoints: readonly string[]): {
type?: "embedding" | "rerank" | "image" | "video" | "audio";
subtype?: "speech" | "transcription";
} {
if (endpoints.includes("embeddings")) return { type: "embedding" };
if (endpoints.includes("rerank")) return { type: "rerank" };
if (endpoints.includes("images")) return { type: "image" };
if (endpoints.includes("videos") || endpoints.includes("video")) return { type: "video" };
const supportsSpeech = endpoints.includes("audio-speech");
const supportsTranscription =
endpoints.includes("audio-transcriptions") || endpoints.includes("audio");
if (!supportsSpeech && !supportsTranscription) return {};
if (supportsSpeech && !supportsTranscription) return { type: "audio", subtype: "speech" };
if (supportsTranscription && !supportsSpeech) {
return { type: "audio", subtype: "transcription" };
}
return { type: "audio" };
}

View File

@@ -135,6 +135,13 @@ export const GLM_PRICING = {
reasoning: 5,
cache_creation: 1.2,
},
"glm-5.3-max": {
input: 1.2,
output: 5,
cached: 0.3,
reasoning: 5,
cache_creation: 1.2,
},
"glm-5.2": {
input: 1.2,
output: 5,

View File

@@ -6,6 +6,10 @@ import {
import { SUPPORTED_BATCH_ENDPOINTS } from "@/shared/constants/batchEndpoints";
import { MAX_REQUEST_BODY_LIMIT_MB, MIN_REQUEST_BODY_LIMIT_MB } from "@/shared/constants/bodySize";
import { COMBO_CONFIG_MODES } from "@/shared/constants/comboConfigMode";
import {
MODEL_SUPPORTED_ENDPOINT_VALUES,
normalizeModelSupportedEndpoints,
} from "@/shared/constants/modelSupportedEndpoints";
import { providerAllowsOptionalApiKey } from "@/shared/constants/providers";
import { HIDEABLE_SIDEBAR_ITEM_IDS } from "@/shared/constants/sidebarVisibility";
import {
@@ -238,22 +242,12 @@ export const providerModelMutationSchema = z.object({
"audio-transcriptions",
"audio-speech",
"images-generations",
"video",
])
.default("chat-completions"),
supportedEndpoints: z
.array(
z.enum([
"chat",
"embeddings",
"rerank",
"images",
"audio",
"audio-transcriptions",
"audio-speech",
"images-generations",
"videos",
])
)
.array(z.enum(MODEL_SUPPORTED_ENDPOINT_VALUES))
.transform(normalizeModelSupportedEndpoints)
.default(["chat"]),
// #2905: optional per-model wire format override for custom models (e.g. a
// custom opencode-go model that must use the Anthropic Messages shape).