Remove plan from chat payload and UI

This commit is contained in:
Ruslan Bakiev
2026-02-19 06:31:55 +07:00
parent 6156aa482c
commit 39dcfc97c4
4 changed files with 99 additions and 29 deletions

View File

@@ -859,7 +859,6 @@ export async function runLangGraphCrmAgentFor(input: {
tools: [crmTool],
responseFormat: z.object({
answer: z.string().describe("Final assistant answer for the user."),
plan: z.array(z.string()).min(1).max(10).describe("Short plan (3-8 steps)."),
}),
});
@@ -924,7 +923,7 @@ export async function runLangGraphCrmAgentFor(input: {
return String(msg?.type ?? msg?.role ?? msg?.constructor?.name ?? "");
};
const structured = res?.structuredResponse as { answer?: string; plan?: string[] } | undefined;
const structured = res?.structuredResponse as { answer?: string } | undefined;
const fallbackText = (() => {
const messages = Array.isArray(res?.messages) ? res.messages : [];
for (let i = messages.length - 1; i >= 0; i -= 1) {
@@ -945,7 +944,7 @@ export async function runLangGraphCrmAgentFor(input: {
if (!text) {
throw new Error("Model returned empty response");
}
const plan = Array.isArray(structured?.plan) ? structured.plan : [];
const plan: string[] = [];
return {
text,