Start a conversation in the local environment.
Payload to create a new conversation.
Contains an Agent configuration along with conversation-specific options.
Agent that delegates to an ACP-compatible subprocess server.
Working directory for agent operations and tool execution
Optional conversation ID. If not provided, a random UUID will be generated.
Controls when the conversation will prompt the user before continuing. Defaults to never.
Initial message to pass to the LLM
If set, the max number of iterations the agent will run before stopping. This is useful to prevent infinite loops.
x >= 1If true, the conversation will use stuck detection to prevent infinite loops.
Secrets available in the conversation
Mapping of tool names to their module qualnames from the client's registry. These modules will be dynamically imported on the server to register the tools for this conversation.
Agent definitions from the client's registry. These are registered on the server so that DelegateTool and TaskSetTool can see user-registered subagents.
List of plugins to load for this conversation. Plugins are loaded and their skills/MCP config are merged into the agent. Hooks are extracted and stored for runtime execution.
Optional hook configuration for this conversation. Hooks are shell scripts that run at key lifecycle events (PreToolUse, PostToolUse, UserPromptSubmit, Stop, etc.). If both hook_config and plugins are provided, they are merged with explicit hooks running before plugin hooks.
If true, automatically generate a title for the conversation from the first user message using the conversation's LLM.
Successful Response
Information about a conversation running locally without a Runtime sandbox.
Unique conversation ID
The agent running in the conversation. This is persisted to allow resuming conversations and check agent configuration to handle e.g., tool changes, LLM changes, etc.
Workspace used by the agent to execute commands and read/write files. Not the process working directory.
Directory for persisting conversation state and events. If None, conversation will not be persisted.
Maximum number of iterations the agent can perform in a single run.
Whether to enable stuck detection for the agent.
Enum representing the current execution state of the conversation.
idle, running, paused, waiting_for_confirmation, finished, error, stuck, deleting Optional security analyzer to evaluate action risks.
List of activated knowledge skills name
Actions blocked by PreToolUse hooks, keyed by action ID
Messages blocked by UserPromptSubmit hooks, keyed by message ID
Most recent user MessageEvent id for hook block checks. Updated when user messages are emitted so Agent.step can pop blocked_messages without scanning the event log. If None, hook-blocked checks are skipped (legacy conversations).
Conversation statistics for tracking LLM metrics
Registry for handling secrets and sensitive data
Dictionary for agent-specific runtime state that persists across iterations. Agents can store feature-specific state using string keys. To trigger autosave, always reassign: state.agent_state = {**state.agent_state, key: value}. See https://docs.openhands.dev/sdk/guides/convo-persistence#how-state-persistence-works
Hook configuration for this conversation. Includes definitions for PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, SessionEnd, and Stop hooks. When set, these hooks are executed at the appropriate points during conversation execution.
User-defined title for the conversation
A snapshot of metrics at a point in time.
Does not include lists of individual costs, latencies, or token usages.