diff --git a/frontend/src/lib/rectification-agentic/v9/turn-decision.ts b/frontend/src/lib/rectification-agentic/v9/turn-decision.ts index bb6d8044..39214d67 100644 --- a/frontend/src/lib/rectification-agentic/v9/turn-decision.ts +++ b/frontend/src/lib/rectification-agentic/v9/turn-decision.ts @@ -345,7 +345,11 @@ function withInferenceCandidates( export function enforceTurnDecisionBudget(payload: Record): Record { if (utf8Bytes(payload) <= TURN_DECISION_MAX_BYTES) return payload; const noRanges = withInferenceCandidates(payload, (candidates) => ({ - candidates: candidates.map(({ cluster_range: _range, ...rest }) => rest), + candidates: candidates.map((candidate) => { + const rest = { ...candidate }; + delete rest.cluster_range; + return rest; + }), })); if (utf8Bytes(noRanges) <= TURN_DECISION_MAX_BYTES) return noRanges; const topCandidates = withInferenceCandidates(noRanges, (candidates) => { diff --git a/frontend/src/mastra/rectification-v9-tools.ts b/frontend/src/mastra/rectification-v9-tools.ts index b23a0f34..9314bce7 100644 --- a/frontend/src/mastra/rectification-v9-tools.ts +++ b/frontend/src/mastra/rectification-v9-tools.ts @@ -624,16 +624,19 @@ function agentVisibleLatestProjection( representative_time_pre_inference: _preTime, house_table_pre_inference: _preHouse, natal_recast_pre_inference: _preNatal, - // R1 (TASK-rectification-grounding-20260927): the engine's own width is - // audit-only (BUG-593); the report width is skill_verification_report. - engine_indistinguishable_width_minutes: _engineWidth, ...rest } = projection; + // R1 (TASK-rectification-grounding-20260927): the engine's own width is + // audit-only (BUG-593); the report width is skill_verification_report. + delete rest.engine_indistinguishable_width_minutes; // R1: the verification Markdown is kept once, in skill_verification_report; // range_delivery carried a byte-identical copy. - const rangeDelivery = rest.range_delivery && typeof rest.range_delivery === "object" && !Array.isArray(rest.range_delivery) - ? (({ verification_markdown: _markdown, ...delivery }) => delivery)(rest.range_delivery as Record) - : rest.range_delivery; + let rangeDelivery = rest.range_delivery; + if (rangeDelivery && typeof rangeDelivery === "object" && !Array.isArray(rangeDelivery)) { + const delivery = { ...(rangeDelivery as Record) }; + delete delivery.verification_markdown; + rangeDelivery = delivery; + } const currentQuestion = extras.openQuestion ? extras.openQuestion.unrenderable === true ? {