Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add resonatehq/resonate-skills --skill resonate-human-in-the-loop-pattern-javagit clone --depth 1 https://github.com/resonatehq/resonate-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-java)<a href="https://agentmods.dev/skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-java"><img src="https://agentmods.dev/badge/skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-java/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-java"><img src="https://agentmods.dev/badge/skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-java.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00144 | $0.02512 |
| Opus 5 | $0.00072 | $0.01256 |
| Sonnet 5 | $0.00029 | $0.00502 |
| Haiku 4.5 | $0.00014 | $0.00251 |
Grade A, and why
resonate-human-in-the-loop-pattern-java scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
curl -s -X POST "http://localhost:8001/promises/${APPROVAL_ID}/resolve" \ How it starts
The opening of the file, as written. The whole thing — 152 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Resonate Human-in-the-Loop Pattern — Java
Prerelease note.
resonate-sdk-javais published on Maven Central — pinio.resonatehq:resonate-sdk-java:0.1.1. The API mirrors the Python SDK and may change before a stable1.0. Requires Java 21+ (virtual threads, a feature generally available in Java 21). There is no Java HITL example repo yet, so every code block here uses only documented SDK surface, compile-verified against0.1.1and cross-checked againstdevelop/java.mdx(docs PR #230) and the SDK source.
Overview
For the language-agnostic mental model, start with resonate-human-in-the-loop-pattern-typescript. The idea is identical: create a latent durable promise, hand its ID to the external actor who will settle it, and await — the workflow parks until settlement arrives, surviving any number of crashes or restarts.
Resolution from Java is direct. The Java SDK ships a top-level r.promises sub-client (it mirrors Python), so settling a promise from outside the workflow is r.promises.resolve(id, new Value(...)). There is no manual base64 encoding — that extra step is a Go-specific workaround for a sub-client Go lacks. Don't copy it into Java.
When to use
- Approval gates (budget, deploy, content moderation)
- Third-party webhook callbacks (Stripe, DocuSign, Twilio)
- Operator unblock steps in runbooks
- Any step where the decision or data originates outside the Resonate worker set
Basic shape
Workflow side — ctx.promise() → promise.id() → publish → await
import io.resonatehq.resonate.Context;
import io.resonatehq.resonate.Context.ResonateFuture;
import java.time.Duration;
public final class Approval {
private Approval() {}
public record ReviewRequest(String item, String requester) {}
/**
* Parks until an external actor settles the latent promise. promise.id() returns the id once
* the promise has been created (instantaneous in local mode, a network round-trip against a
* real server); await suspends the workflow (durably) until it is settled from outside.
*/
public static String approvalWorkflow(Context ctx, ReviewRequest req) {
// A latent durable promise — no registered function backs it; it settles only when an
// external caller resolves it. 24-hour timeout, capped at the workflow deadline.
ResonateFuture<Object> promise = ctx.promise(Duration.ofHours(24));
String approvalId = promise.id();
// Publish the promise ID inside a ctx.run so the side effect is checkpointed and does
// not re-run on replay. In production: write to a DB, push to a notification queue, etc.
ctx.run(Approval::publishApprovalId, req.item(), approvalId).await();
// Suspend until the promise is settled externally; decode the decision.
Object decision = promise.await();
return "item " + req.item() + " decided: " + decision;
}
/** Checkpointed publication of the promise ID. Replace the println with a real notification. */
public static String publishApprovalId(Context ctx, String item, String approvalId) {
System.out.printf(" [workflow] awaiting approval for %s — promise id: %s%n", item, approvalId);
return "published";
}
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 10d ago First seen · 152 lines · 144 tokens per session scan A fc0c6495fb5c
resonate-human-in-the-loop-pattern-java is a skill published in the GitHub repository resonatehq/resonate-skills (6 stars, last pushed 18d ago), licensed Apache-2.0. It adds 144 tokens to every session and 2,512 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
springboot-patterns
Provides Spring Boot architecture patterns for REST APIs, layered services, JPA data access, caching, async processing, and logging. Use when working with Java Spring Boot files (.java, pom.xml) or when the user mentions Spring Boot, Spring Framework, or Java backend.
azure-security-keyvault-secrets-java
Azure Key Vault Secrets Java SDK for secret management. Use when storing, retrieving, or managing passwords, API keys, connection strings, or other sensitive configuration data.
azure-ai-anomalydetector-java
Build anomaly detection applications with Azure AI Anomaly Detector SDK for Java. Use when implementing univariate/multivariate anomaly detection, time-series analysis, or AI-powered monitoring.
azure-communication-common-java
Azure Communication Services common utilities for Java. Use when working with CommunicationTokenCredential, user identifiers, token refresh, or shared authentication across ACS services.
union-type-wrappers
Add typed getters and setters over BinaryData properties that represent TypeSpec union types in generated Java models. Use when generated classes expose BinaryData for union-typed fields and you need ergonomic, type-safe accessors instead.
azure-ai-agents-persistent-java
Azure AI Agents Persistent SDK for Java. Low-level SDK for creating and managing AI agents with threads, messages, runs, and tools. Triggers: "PersistentAgentsClient", "persistent agents java", "agent threads java", "agent runs java", "streaming agents java".