feat: mark recommended ask options

This commit is contained in:
Erik Kotsiuba
2026-08-12 14:18:59 +02:00
parent 4de596ae54
commit bd5f4520a3
20 changed files with 231 additions and 20 deletions
+23
View File
@@ -634,6 +634,29 @@ test("elaborate continuation preserves unrelated committed answers", () => {
});
});
test("elaboration preserves recommendation metadata", () => {
let state = createInitialState({
questions: [
{
id: "framework",
label: "Framework",
prompt: "Pick a framework",
options: [{ value: "react", label: "React", recommended: true }],
},
],
});
state = enterOptionNoteMode(state, "framework", "react");
state = saveNote(state, "Explain this preference");
state = { ...state, mode: "elaborate" };
const item = toAskResult(state).elaboration?.items[0];
assert.equal(item?.question.options[0]?.recommended, true);
assert.equal(
item && "option" in item ? item.option.recommended : undefined,
true
);
});
test("invalid tool payload result is attributed to the tool call", () => {
const result = {
title: "Interview",