jev_next_step
Decide what an agent should do next after a stalled step: continue, retry, change approach, ask user, or done, with reasoning signals to avoid premature completion.
Instructions
Decide what an agent should do next after a step: continue / retry / change_approach / ask_user / done, with the reasoning signals behind it.
Use it when a loop has stalled and you are about to guess: a tool returned an error you are unsure how to read, a search came back thin, you have tried the same thing more than once, or you are about to tell the user you are finished.
It is deliberately conservative about done: the verdict is downgraded to continue unless the completion signal comes back a confident yes, so a premature 'task complete' turns into another step instead. retry is capped in code — pass attempts and it becomes change_approach once you have tried enough.
Pass result truncated to the part that matters (the error text, the head of the output); a huge dump lowers accuracy. Pass last_step as what you actually ran, and goal as the user's objective rather than the current sub-task.
Read reasons before acting: it names every code-level override, which is usually more informative than the verdict itself.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| goal | Yes | The objective being pursued, in the user's terms. | |
| result | Yes | What came back: tool output or error text. Truncate it yourself to the part that matters. | |
| attempts | No | How many times this same step has already been attempted, including the one just made. Default 1. | |
| last_step | Yes | What was just attempted, concretely. | |
| thresholds | No | Override the server's configured gating thresholds for this call only. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| next | Yes | What to do, after code-level overrides. | |
| model | Yes | The versioned model id that actually answered. | |
| usage | Yes | Token usage. Jev charges for input tokens only. | |
| reasons | Yes | Why, including every override code applied to the model's choice. | |
| signals | Yes | Raw P(yes) for each supporting judgment. Near 0.5 means unsure. | |
| confidence | Yes | How peaked that distribution is. | |
| latency_ms | Yes | Wall-clock time for the underlying API call(s), including retries. | |
| thresholds | Yes | ||
| choice_probabilities | Yes | The model's distribution over the five next-step options. |