fix(rectification): persist the next interview after a choice tap
Closing a discriminator used to leave GET without a card after refresh. Write the next dated question in the same request, skip childhood career and move probes, and do not continue a read-only turn when that question is already persisted. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -2,6 +2,7 @@ import { NextResponse } from "next/server";
|
||||
import { z } from "zod";
|
||||
import { getRectificationV9Agent, type RectificationAgentAction } from "@/mastra/agentic-rectification";
|
||||
import {
|
||||
loadV9CaseCompute,
|
||||
loadV9CaseDossier,
|
||||
persistV9DeterministicTurn,
|
||||
RectificationToolServiceError,
|
||||
@@ -280,6 +281,8 @@ export async function POST(request: Request) {
|
||||
sourceQuote: applied.sourceQuote,
|
||||
derivedContext: applied.derivedContext,
|
||||
nextAction: applied.nextAction,
|
||||
nextInterviewPersisted: applied.nextInterviewPersisted,
|
||||
nextChoiceReady: applied.nextChoiceReady,
|
||||
});
|
||||
} catch (error) {
|
||||
if (error instanceof RectificationToolServiceError) {
|
||||
@@ -386,11 +389,19 @@ export async function POST(request: Request) {
|
||||
dossier.latestResult,
|
||||
dossier.evidence,
|
||||
);
|
||||
let birthDate: string | null = null;
|
||||
try {
|
||||
const compute = await loadV9CaseCompute(accounting, userId, caseId);
|
||||
birthDate = String(compute.baselineBirthSnapshot.birth_date ?? "") || null;
|
||||
} catch {
|
||||
// Ranking stays fail-open when compute is unavailable.
|
||||
}
|
||||
const plan = buildMethodFollowupPlan({
|
||||
evidence: dossier.evidence,
|
||||
declinedTopics: dossier.conversationSummary.declinedSkippedTopics,
|
||||
sessionOutcome: "discriminate_candidates",
|
||||
...catalog,
|
||||
birthDate,
|
||||
candidatesSeparated: false,
|
||||
});
|
||||
const persisted = await persistServerOwnedFocus({
|
||||
|
||||
@@ -2707,6 +2707,16 @@ input:not([type="radio"]):not([type="checkbox"]):not([class^="ant-"]):not([class
|
||||
border-radius: var(--radius-lg);
|
||||
background: var(--color-canvas-soft);
|
||||
}
|
||||
.rectification-choice-card .birth-time-choice-question:disabled .birth-time-choice-option {
|
||||
cursor: default;
|
||||
opacity: .48;
|
||||
}
|
||||
.rectification-choice-card .birth-time-choice-question:disabled .birth-time-choice-option[data-selected="true"] {
|
||||
opacity: 1;
|
||||
}
|
||||
.rectification-choice-card.is-pending .birth-time-choice-question:disabled .birth-time-choice-option:not([data-selected="true"]) {
|
||||
cursor: wait;
|
||||
}
|
||||
.rectification-message-wrap .rectification-choice-card {
|
||||
width: calc(100% - var(--assistant-content-inset));
|
||||
margin: var(--space-3) 0 var(--space-4);
|
||||
|
||||
Reference in New Issue
Block a user