fix(rectification): ask spoken collect questions in the agent body
The standalone collect prompt bar reused the choice-card chrome and duplicated the question. Visibility now comes from the spoken reply, with an empty-body fallback that posts the persisted focus prompt. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -10,7 +10,12 @@ import {
|
||||
transitionV9CaseStatus,
|
||||
} from "@/lib/rectification-agentic/v9/tool-service";
|
||||
import { decideFromDossier, rectificationFollowupCatalog } from "@/lib/rectification-agentic/v9/decision-from-dossier";
|
||||
import { applyRectificationChoice, applyCollectFocusDenial, persistNextInterviewIfIdle } from "@/lib/rectification-agentic/v9/answer-choice";
|
||||
import {
|
||||
applyRectificationChoice,
|
||||
applyCollectFocusDenial,
|
||||
persistNextInterviewIfIdle,
|
||||
persistEmptyCollectSpokenAssistant,
|
||||
} 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";
|
||||
import { runV9AgentTurn, type V9RunBilling } from "@/lib/rectification-agentic/v9/agent-run";
|
||||
@@ -674,6 +679,22 @@ export async function POST(request: Request) {
|
||||
`[rectification-v9] persist next interview after turn failed case=${caseId} reason=${error instanceof Error ? error.name : "Unknown"}`,
|
||||
);
|
||||
}
|
||||
if (!result.answerText.trim()) {
|
||||
try {
|
||||
const fallback = await persistEmptyCollectSpokenAssistant({
|
||||
accounting: accounting as never,
|
||||
userId,
|
||||
caseId,
|
||||
requestId: crypto.randomUUID(),
|
||||
answerText: result.answerText,
|
||||
});
|
||||
if (fallback) send({ type: "answer.delta", text: fallback });
|
||||
} catch (error) {
|
||||
console.warn(
|
||||
`[rectification-v9] empty collect spoken fallback failed case=${caseId} reason=${error instanceof Error ? error.name : "Unknown"}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
send({ type: "done", emitted: true });
|
||||
}
|
||||
|
||||
@@ -2902,13 +2902,6 @@ input:not([type="radio"]):not([type="checkbox"]):not([class^="ant-"]):not([class
|
||||
font-size: var(--type-caption);
|
||||
line-height: 1.5;
|
||||
}
|
||||
.rectification-spoken-collect-prompt {
|
||||
margin: 0;
|
||||
color: var(--color-ink);
|
||||
font-size: var(--type-body-sm);
|
||||
font-weight: 600;
|
||||
line-height: 1.55;
|
||||
}
|
||||
.rectification-candidates-heading { display: grid; gap: 5px; }
|
||||
.rectification-candidates-heading strong { font-size: var(--type-title-sm); font-family: var(--font-display); font-weight: 600; letter-spacing: -.2px; }
|
||||
.rectification-candidates-heading span,
|
||||
|
||||
Reference in New Issue
Block a user