fix(rectification): remove static interview fallbacks
Independent Staging Quality Gate / validate (push) Successful in 10m50s
Independent Staging Quality Gate / publish (push) Successful in 13m29s

This commit is contained in:
Jesse_Chen
2026-08-27 16:40:47 +08:00
parent 5f855c610c
commit f3327235ea
43 changed files with 1798 additions and 509 deletions
@@ -1,7 +1,10 @@
import { NextResponse } from "next/server";
import { z } from "zod";
import { getRectificationV9Agent, type RectificationAgentAction } from "@/mastra/agentic-rectification";
import { RectificationToolServiceError } from "@/lib/rectification-agentic/v9/tool-service";
import {
RectificationToolServiceError,
transitionV9CaseStatus,
} from "@/lib/rectification-agentic/v9/tool-service";
import { applyRectificationChoice } 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";
@@ -230,6 +233,9 @@ export async function POST(request: Request) {
optionId: action === "stop_and_review" ? "stop" : parsed.data.optionId!,
expectedRevision,
});
if (action === "stop_and_review") {
await transitionV9CaseStatus(accounting, userId, caseId, "paused");
}
return NextResponse.json({
type: "choice.applied",
action: applied.idempotent ? "replayed" : "applied",