fix(assets): expose full inventory for scoped users and stabilize previews
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
shishengliang
2026-09-28 13:16:12 +08:00
parent f1b3f8d3da
commit 48cf429468
17 changed files with 191 additions and 57 deletions
+4 -4
View File
@@ -137,7 +137,7 @@ router.post("/export", async (c) => {
c.get("user"),
body.subject,
);
const result = await execute(vehicles, node.plan);
const result = await execute(vehicles, node.plan, c.get("user"));
const records = [
[
"车牌",
@@ -265,7 +265,7 @@ router.post("/ask", async (c) => {
let parent = baseNode;
if (input.action) {
if (!previous) throw new Error("请先完成一次统计。");
const currentData = await execute(vehicles, previous);
const currentData = await execute(vehicles, previous, user);
if (input.action.type === "explore") {
const exploration = applyGeneratedAction(previous, input.action, currentData, baseNode?.presentation);
plan = exploration.plan;
@@ -313,7 +313,7 @@ router.post("/ask", async (c) => {
if (currentSession.nodes.size + 1 + (queries?.length || 0) > 100)
throw new Error("本次对话分析步骤已满,请新建对话。");
let result: AssistantResult = queries?.length
? await executeComposition(vehicles, queries, input.subject, controller.signal)
? await executeComposition(vehicles, queries, input.subject, controller.signal, user)
: plan.kind === "clarify"
? {
plan,
@@ -332,7 +332,7 @@ router.post("/ask", async (c) => {
metrics: [],
answerKind: answerKind === "answer" ? "help" : "clarification",
}
: await execute(vehicles, plan);
: await execute(vehicles, plan, user);
if (controller.signal.aborted) return;
plan = result.plan;
if (result.unanswered?.length) {