Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions openhands-sdk/openhands/sdk/conversation/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,16 @@ def create(
# Verify compatibility (agent class + tools)
agent.verify(state.agent, events=state._events)

# Reset terminal statuses to IDLE on resume.
# This ensures conversations stuck in STUCK, ERROR, or FINISHED
# can recover without requiring send_message() or run() to be called first.
if state.execution_status in (
ConversationExecutionStatus.FINISHED,
ConversationExecutionStatus.ERROR,
ConversationExecutionStatus.STUCK,
):
state.execution_status = ConversationExecutionStatus.IDLE

# Commit runtime-provided values (may autosave)
state._autosave_enabled = True
state.agent = agent
Expand Down
Loading