Skip to content

AG-UI, Skills, MCP, Sandbox & OTel ​

OpenHusky's outer ring connects your core agent runtime to external protocols, domain instructions, isolated execution planes, and observability backends—all in pure JDK 21.

1. AG-UI v1.0 Streaming (openhusky-agui) ​

openhusky-agui adapts openhusky-core to the open AG-UI v1.0 protocol without Spring, Servlets, Netty, or Reactor.

xml
<dependency>
    <groupId>dev.openhusky</groupId>
    <artifactId>openhusky-agui</artifactId>
    <version>0.2.0</version>
</dependency>
kotlin
implementation("dev.openhusky:openhusky-agui:0.2.0")
  • Full 21-Event Model (AgUiEvent): RUN_*, STEP_*, TEXT_MESSAGE_*, REASONING_*, TOOL_CALL_*, STATE_SNAPSHOT, RFC 6902 STATE_DELTA, MESSAGES_SNAPSHOT, and CUSTOM (openhusky:tool_progress, approvals).
  • Container-Agnostic AgUiRunner + AgUiApprovalBroker: Manages thread-keyed sessions, mid-run steer(), abort(), and CompletableFuture-backed HITL approvals.
  • Built-in AgUiJdkHttpHandler: Mounts directly onto com.sun.net.httpserver.HttpServer (POST /run, /steer, /abort, /approve), with configurable heartbeats and client-disconnect AbortSignal propagation.

2. Progressive Skills & AGENTS.md (openhusky-skills) ​

openhusky-skills implements the open agentskills.io SKILL.md specification and hierarchical AGENTS.md loading with zero SnakeYAML dependency.

xml
<dependency>
    <groupId>dev.openhusky</groupId>
    <artifactId>openhusky-skills</artifactId>
    <version>0.2.0</version>
</dependency>
kotlin
implementation("dev.openhusky:openhusky-skills:0.2.0")

3-Stage Progressive Disclosure preserves prompt cache stability and avoids bloating system prompts:

  1. <available_skills> compact XML catalog injected via SkillContextComposer
  2. load_skill (readOnly = true, PARALLEL_SAFE) returns full SKILL.md instructions + relative reference paths
  3. read_skill_resource (readOnly = true, PARALLEL_SAFE) lazily loads UTF-8 references/*.md files with symlink/traversal guards

Sources include DirectorySkillSource, ClasspathSkillSource, and InMemorySkillSource (ideal for per-tenant SaaS SOPs).

3. MCP Client & Tool Bridge (openhusky-mcp) ​

openhusky-mcp implements the Model Context Protocol (2025-11-25) client over both Stdio (StdioMcpTransport) and Streamable HTTP (StreamableHttpMcpTransport with SSE, Mcp-Session-Id, HTTP 404 re-init, and OAuth 2.1 PKCE).

java
try (McpToolkit mcp = McpToolkit.fromJsonFile(Path.of("mcp.json"))) {
    AgentRuntime runtime = AgentRuntime.builder()
            .provider(provider)
            .model(model)
            .tools(mcp.tools())
            .permissionPolicy(PermissionPolicy.failClosed()
                    .allow("mcp__weather__*")
                    .build())
            .build();
}

McpToolAdapter preserves multimodal ImageBlocks, structuredContent, progress tokens, and readOnlyHint -> ToolExecutionMode.PARALLEL_SAFE mapping.

4. Unified Sandbox Plane (openhusky-sandbox) ​

Decouple your agent's file and shell primitives ("Hand") across 5 isolation tiers (AgentSandbox):

TierImplementationIsolationsupportsExec()
L0InMemorySandboxConcurrentHashMap<String, byte[]> virtual workspacefalse
L1LocalHostSandboxHost directory (toRealPath() jail) + JDK 21 ProcessBuildertrue
L2LocalOsSandboxLinux bubblewrap (bwrap) / macOS Seatbelt (sandbox-exec), fail-closedtrue
L3DockerSandboxPure JDK 21 docker CLI lifecycle (zero docker-java/Netty)true
L4Custom AgentSandboxCloud sandboxes (E2B, Modal, Daytona, Kubernetes Pods)Implementation-defined

SandboxToolkit.tools(sandbox) exposes read_file, glob_files, grep_files (PARALLEL_SAFE) and write_file, edit_file, shell_exec (SEQUENTIAL).

5. OpenTelemetry GenAI Tracing (openhusky-otel) v0.2.0 ​

Availability

openhusky-otel is available on main and in the upcoming 0.2.0 release.

Instrument AgentRuntime in one call with zero OpenTelemetry contamination inside openhusky-core:

java
AgentRuntime.Builder builder = AgentRuntime.builder()
        .provider(myProvider)
        .model(myModel)
        .toolsFrom(myTools);

OpenHuskyOtel.install(builder, GlobalOpenTelemetry.get(),
        OpenHuskyOtelConfig.builder()
                .agentName("support-desk")
                .captureContent(false)
                .build());

AgentRuntime runtime = builder.build();

OpenHuskyOtel.install(...) records invoke_agent run spans, chat <model> step spans, and execute_tool <tool> spans—propagating parent context cleanly across virtual-thread parallel tools and nested SubagentTool delegations—plus lifecycle Span Events (CompactionApplied, SteeringApplied, ApprovalRequested, ApprovalResolved, DoomLoopDetected, ModelRetryScheduled).

Released under the MIT License. Built with Java 21 Virtual Threads.