fix(rectification): stop discriminator followup from dropping user evidence
Independent Staging Quality Gate / validate (push) Successful in 10m10s
Independent Staging Quality Gate / publish (push) Successful in 7m25s

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:
Jesse_Chen
2026-08-29 10:18:04 +08:00
parent 31b54aa71d
commit 86d6923e6e
15 changed files with 1054 additions and 124 deletions
@@ -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) {