fix: align moonshot detail config key
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled

This commit is contained in:
Your Name 2026-03-21 22:42:08 +08:00
parent aa9abff5af
commit a2de2c6d6d

View File

@ -19,6 +19,7 @@ import {
normalizeRealtimeCanvasConfigForStorage,
resolveRealtimeProviders,
} from "@/lib/realtime/config";
import { DETAIL_AGENT_LOCAL_MOONSHOT_SETTING_KEY } from "@/lib/ai/detail-agent-model-config";
import { db } from "@/lib/db";
import { siteSettings } from "@/lib/db/schema";
import { eq } from "drizzle-orm";
@ -86,7 +87,7 @@ export async function POST(request: Request) {
let nextValue = value;
if (key === "moonshot_detail_agent_config") {
if (key === DETAIL_AGENT_LOCAL_MOONSHOT_SETTING_KEY) {
const config = moonshotDetailAgentConfigSchema.parse(value || {});
const normalizedBaseUrl = String(config.baseUrl || "").trim() || MOONSHOT_OFFICIAL_BASE_URL;
const normalizedModelId = String(config.modelId || "").trim() || MOONSHOT_KIMI_K25_MODEL_ID;
@ -197,7 +198,7 @@ export async function POST(request: Request) {
return Response.json({
setting: {
key: "moonshot_detail_agent_config",
key: DETAIL_AGENT_LOCAL_MOONSHOT_SETTING_KEY,
value: {
providerId: provider.id,
modelEntryId: model.id,