fix(narration): use plan_rejected kind and include source in instruction
This commit is contained in:
@@ -68,7 +68,7 @@ class NarrationSubscriber(
|
|||||||
)
|
)
|
||||||
is ExecutionPlanRejectedEvent -> enqueue(
|
is ExecutionPlanRejectedEvent -> enqueue(
|
||||||
sid,
|
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(
|
is OrchestrationPausedEvent -> enqueue(
|
||||||
sid,
|
sid,
|
||||||
|
|||||||
+5
-1
@@ -221,10 +221,14 @@ class NarrationSubscriberTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
assertEquals(1, facade.calls.size)
|
assertEquals(1, facade.calls.size)
|
||||||
assertEquals("execution_plan_rejected", facade.calls[0].second.kind)
|
assertEquals("plan_rejected", facade.calls[0].second.kind)
|
||||||
assertTrue(
|
assertTrue(
|
||||||
facade.calls[0].second.instruction.contains("Missing required artifact"),
|
facade.calls[0].second.instruction.contains("Missing required artifact"),
|
||||||
"instruction must include the rejection reason",
|
"instruction must include the rejection reason",
|
||||||
)
|
)
|
||||||
|
assertTrue(
|
||||||
|
facade.calls[0].second.instruction.contains("missing_content"),
|
||||||
|
"instruction must include the source",
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user