优化渲染引用处理,增加格式校验与说明;更新 agent 说明
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user