replanWhen

fun <T> replanWhen(tool: Tool, predicate: (t: T) -> Boolean): DelegatingTool

When the predicate matches the tool result artifact, replan, adding the artifact to the blackboard. The predicate receives the artifact cast to type T. If the artifact is null or cannot be cast to T, returns normally.