J.

Jev Stop the loop Code Example

Detect when repeated attempts are no longer making progress.

same permission denied response

Attempts 6
Last Errors same permission denied response
Changed Input No

What should the agent do next?

0% Stop and report.
Stop and report 83%
Retry 12%
Switch tool 5%

Stop the flow and stop and report.

Code
Conceptual pseudocode — not official Jev SDK syntax
// Conceptual pseudocode — not Jev SDK syntax
const state = {
  "attempts": 6,
  "last_errors": "same permission denied response",
  "changed_input": false
};

const decision = await evaluateDecision({
  state,
  question: "What should the agent do next?",
  options: ["Stop and report","Retry","Switch tool"],
});

// Your adapter normalizes the provider response.
// Tune this example threshold on labelled data.
if (decision.outcome === "Stop and report"
    && decision.probability >= 0.85) {
  stopAgentLoop(decision);
} else {
  queueForReview(decision);
}

This adapter illustrates the decision boundary. Check the official Jev docs for current API syntax.