fix(rectification): keep model confirmations separate from question slots
This commit is contained in:
@@ -15,7 +15,6 @@ import {
|
||||
applyCollectFocusDenial,
|
||||
ensureNonTerminalTurnExit,
|
||||
persistNextInterviewIfIdle,
|
||||
persistCollectSpokenAssistantIfNew,
|
||||
} from "@/lib/rectification-agentic/v9/answer-choice";
|
||||
import { mapRectificationRpcError } from "@/lib/rectification-agentic/v9/case-service";
|
||||
import { CHOICE_ACTION, STOP_ACTION } from "@/lib/rectification-agentic/v9/choice-action";
|
||||
@@ -671,14 +670,12 @@ export async function POST(request: Request) {
|
||||
send({ type: "error", message: "生时校正暂时不可用,请稍后重试。" });
|
||||
} else {
|
||||
if (action === "message") {
|
||||
let idleHostNarration: string | null = null;
|
||||
try {
|
||||
const idle = await persistNextInterviewIfIdle({
|
||||
accounting: accounting as never,
|
||||
userId,
|
||||
caseId,
|
||||
});
|
||||
idleHostNarration = idle.hostNarration;
|
||||
} catch (error) {
|
||||
console.warn(
|
||||
`[rectification-v9] persist next interview after turn failed case=${caseId} reason=${error instanceof Error ? error.name : "Unknown"}`,
|
||||
@@ -690,29 +687,11 @@ export async function POST(request: Request) {
|
||||
userId,
|
||||
caseId,
|
||||
});
|
||||
idleHostNarration = exit.hostNarration ?? idleHostNarration;
|
||||
} catch (error) {
|
||||
console.warn(
|
||||
`[rectification-v9] nonterminal turn exit repair failed case=${caseId} reason=${error instanceof Error ? error.name : "Unknown"}`,
|
||||
);
|
||||
}
|
||||
try {
|
||||
const fallback = await persistCollectSpokenAssistantIfNew({
|
||||
accounting: accounting as never,
|
||||
userId,
|
||||
caseId,
|
||||
requestId: crypto.randomUUID(),
|
||||
answerText: result.answerText,
|
||||
previousFocusId: result.previousFocusId,
|
||||
alreadyEmitted: result.collectSpokenEmitted,
|
||||
hostNarration: idleHostNarration,
|
||||
});
|
||||
if (fallback) send({ type: "answer.delta", text: fallback });
|
||||
} catch (error) {
|
||||
console.warn(
|
||||
`[rectification-v9] collect spoken visibility fallback failed case=${caseId} reason=${error instanceof Error ? error.name : "Unknown"}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
send({ type: "done", emitted: true });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user