优化渲染引用处理,增加格式校验与说明;更新 agent 说明

This commit is contained in:
2026-05-20 17:13:17 +08:00
parent 872570ac3a
commit 0b5004fc2c
3 changed files with 32 additions and 15 deletions
+9
View File
@@ -20,6 +20,8 @@ import {
type SupportedModel,
} from "./chatStream.js";
const persistentRenderRefPattern = /^res-[a-z0-9-]+$/i;
const payloadSchema = z.object({
message: z.string().min(1).max(10000),
session_id: z.string().max(128).optional(),
@@ -67,6 +69,13 @@ export const buildChatRouter = (
return;
}
if (!persistentRenderRefPattern.test(renderRef)) {
res.status(400).json({
message: "render_ref must be a persistent ref like res-..., not a file path",
});
return;
}
const result = await resultReferenceStore.getFullAuthorized(renderRef, {
actorKey: toActorKey(userId),
clientSessionId,