feat: add lead_reasoning field to ApprovalCreate and update validation logic

This commit is contained in:
Abhimanyu Saharan
2026-02-13 21:34:08 +05:30
parent aea69f5118
commit b98d6e2f83
2 changed files with 21 additions and 0 deletions

View File

@@ -58,3 +58,16 @@ def test_approval_create_accepts_float_confidence() -> None:
},
)
assert model.confidence == 88.75
def test_approval_create_accepts_top_level_lead_reasoning() -> None:
model = ApprovalCreate.model_validate(
{
"action_type": "task.update",
"confidence": 80,
"lead_reasoning": "Need manual review before changing task status.",
},
)
assert model.payload == {
"reason": "Need manual review before changing task status.",
}