fix(rectification): stop discriminator followup from dropping user evidence
Decision and question ranking now share contrast option completion, so a missing style card cannot deadlock the interview with a dead-end reply. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -36,6 +36,8 @@ import { buildMethodFollowupPlan } from "@/lib/rectification-agentic/v9/method-f
|
||||
export const runtime = "nodejs";
|
||||
export const maxDuration = 240;
|
||||
|
||||
export const DISCRIMINATOR_EXHAUSTED_NARRATION = "当前几个候选已经构成可信区间。你可以再说一件记得住时间的经历,也可以先按这个区间看盘。";
|
||||
|
||||
function completedMessageResponse(text: string, requestId: string, caseId: string) {
|
||||
const body = [
|
||||
JSON.stringify({ type: "answer.delta", text }),
|
||||
@@ -414,7 +416,7 @@ export async function POST(request: Request) {
|
||||
followup: plan.next_followup,
|
||||
});
|
||||
const open = openQuestionFromPersistedFocus(persisted);
|
||||
if (open && persisted.focus) {
|
||||
if (open && persisted.focus && open.unrenderable !== true) {
|
||||
let classified = null;
|
||||
try {
|
||||
classified = await classifyRectificationTurnIntent(selectedModel, {
|
||||
@@ -456,13 +458,14 @@ export async function POST(request: Request) {
|
||||
});
|
||||
return completedMessageResponse(narration, requestId, caseId);
|
||||
}
|
||||
const narration = "目前没有可继续区分的问题。当前几个候选构成可信区间,不再泛问已经覆盖过的经历。";
|
||||
await persistV9DeterministicTurn(accounting, userId, caseId, {
|
||||
requestId,
|
||||
userMessage: parsed.data.message ?? null,
|
||||
assistantMessage: narration,
|
||||
});
|
||||
return completedMessageResponse(narration, requestId, caseId);
|
||||
if (!plan.next_followup) {
|
||||
await persistV9DeterministicTurn(accounting, userId, caseId, {
|
||||
requestId,
|
||||
userMessage: parsed.data.message ?? null,
|
||||
assistantMessage: DISCRIMINATOR_EXHAUSTED_NARRATION,
|
||||
});
|
||||
return completedMessageResponse(DISCRIMINATOR_EXHAUSTED_NARRATION, requestId, caseId);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user