Given an id, get a conversation
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.