Skip to main content

Tool loop

Human review

Return HumanReviewRequest from AgentDefinition.humanReview to checkpoint a run. Persist the returned RunResult, collect a decision in your application, then call continueRun(...) with humanInput. The Agent SDK does not depend on hidden hosted state.

Responses API options

Pass additional Responses API fields through GatewayOptions.requestOptions. Agent-owned model, input, instructions, and local function tools are applied by the adapter.

Advanced runtime

Java supports validator and approval interfaces, HITL and manual tools, progress, recoverable errors, replayable iterables, stop helpers, dynamic turns, persisted NextTurnParams, normalized usage/cost, and StateAccessor.

Streaming and cancellation

Agent.stream(...) and Agent.continueStream(...) consume the gateway’s Responses SSE stream. Read textStream() or fullStream() for replayable results, and call cancel() to interrupt the active worker and HTTP read. Completed steps retain request IDs, provider metadata, finish reasons, warnings, usage, and cost.
Last modified on July 26, 2026