fix(narration): use plan_rejected kind and include source in instruction

This commit is contained in:
2026-06-10 21:31:34 +04:00
parent 04836b751c
commit 3d43f34d3b
2 changed files with 6 additions and 2 deletions
@@ -68,7 +68,7 @@ class NarrationSubscriber(
)
is ExecutionPlanRejectedEvent -> enqueue(
sid,
NarrationTrigger(kind = "execution_plan_rejected", instruction = "The execution plan was rejected: ${p.reason}. Explain to the user what happened and what they can do next."),
NarrationTrigger(kind = "plan_rejected", instruction = "The execution plan was rejected (${p.source}): ${p.reason}. Explain to the user what happened and what they can do next."),
)
is OrchestrationPausedEvent -> enqueue(
sid,
@@ -221,10 +221,14 @@ class NarrationSubscriberTest {
}
assertEquals(1, facade.calls.size)
assertEquals("execution_plan_rejected", facade.calls[0].second.kind)
assertEquals("plan_rejected", facade.calls[0].second.kind)
assertTrue(
facade.calls[0].second.instruction.contains("Missing required artifact"),
"instruction must include the rejection reason",
)
assertTrue(
facade.calls[0].second.instruction.contains("missing_content"),
"instruction must include the source",
)
}
}