fix(rectification): hold time cards until an offer turn
Independent Staging Quality Gate / validate (push) Successful in 11m37s
Independent Staging Quality Gate / publish (push) Failing after 9m4s

Keep collecting while a method follow-up can still distinguish candidates, and show adoption cards only after offer-candidates. Align the natal house snapshot with the agent text column.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-08-20 00:50:40 +08:00
parent 4d872c68b2
commit a732ff4b58
19 changed files with 167 additions and 51 deletions
@@ -126,6 +126,10 @@ type RenderMessage = ChatMessageView & {
turnId?: string;
};
function turnOfferedSelection(message: RenderMessage): boolean {
return Boolean(message.completedReceipt?.steps.includes("rectification-offer-candidates"));
}
function completedReceiptFromPersisted(receipt: PersistedTurn["receipt"]): CompletedActivityReceiptView {
if (!receipt) return { steps: [], methods: [] };
if (Array.isArray(receipt.tool_activities)) {
@@ -552,13 +556,15 @@ export function RectificationAgenticChat(props: RectificationAgenticChatProps) {
&& message.state === "settled"
&& !message.failed
&& Boolean(message.text)
))?.renderKey;
));
const showSelectionCards = Boolean(
candidateResult?.selectionAllowed
&& latestOfferMessageKey
&& turnOfferedSelection(latestOfferMessageKey)
&& !busy
&& regeneratingMessageKey === null,
);
const selectionCardMessageKey = showSelectionCards ? latestOfferMessageKey.renderKey : undefined;
const canSend = !busy && !readonly && !regeneratingMessageKey;
return (
@@ -613,7 +619,7 @@ export function RectificationAgenticChat(props: RectificationAgenticChatProps) {
onRegenerate={() => void regenerateMessage(message)}
/>
)}
{showSelectionCards && message.renderKey === latestOfferMessageKey && candidateResult && (
{showSelectionCards && message.renderKey === selectionCardMessageKey && candidateResult && (
<RectificationCandidateCards
result={candidateResult}
acceptingCandidateId={acceptingCandidateId}