Skip to content

Open source CapCut alternative.

TypeScript

Complete skill-backed runs when a trailing verify step omits criteria

David Le23173e47bed0
diff --git a/apps/Donkey/Sources/DonkeyHarness/GenericHarnessBuiltInToolExecutors.swift b/apps/Donkey/Sources/DonkeyHarness/GenericHarnessBuiltInToolExecutors.swift
index 9a24e633..0052f0cb 100644
--- a/apps/Donkey/Sources/DonkeyHarness/GenericHarnessBuiltInToolExecutors.swift
+++ b/apps/Donkey/Sources/DonkeyHarness/GenericHarnessBuiltInToolExecutors.swift
@@ -1319,7 +1319,28 @@ public enum BuiltInHarnessToolExecutors {
private static func stateVerify(_ context: HarnessToolExecutionContext) -> HarnessToolResult {
guard let criteria = trimmed(context.call.input["criteria"]) else {
- return invalidInput(context, "state.verify requires criteria.")
+ // Planners sometimes append a verify step without echoing explicit criteria. Rather than
+ // failing a run whose action already succeeded, verify against the most recent guarded
+ // action's structured outcome: pass unless that action explicitly reported failure.
+ let recentAction = context.worldModel.facts["script.executed.succeeded"]
+ let verified = recentAction != "false"
+ return HarnessToolResult(
+ callID: context.call.id,
+ toolName: context.call.name,
+ status: verified ? .succeeded : .failed,
+ summary: verified
+ ? "Verification succeeded from prior action evidence (no explicit criteria)."
+ : "Prior action reported failure.",
+ observations: HarnessObservationDelta(
+ facts: [
+ "state.verify.criteria": "inferred:script.executed.succeeded",
+ "state.verify.verified": String(verified),
+ "lastAcceptedTool": context.call.name
+ ],
+ uncertainty: verified ? [] : ["prior guarded action reported failure"]
+ ),
+ metadata: ["verified": String(verified), "criteria.inferred": "true"]
+ )
}
let evidence = (
context.worldModel.facts.map { "\($0.key): \($0.value)" }