You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Address review feedback for conversation status checking
- Add Note warning about production error handling at start of section
- Add raise_for_status() for HTTP error handling in all examples
- Use safe list access with len() checks to prevent IndexError
- Improve status documentation with actions for each state
- Add terminal states Note explaining which states exit polling loops
- Handle waiting_for_confirmation state in Complete Polling Example
- Handle ERROR status in start task polling loop
Co-authored-by: openhands <openhands@all-hands.dev>
@@ -244,20 +252,25 @@ Once you have the `app_conversation_id`, check whether the agent has finished it
244
252
#### Status Fields
245
253
246
254
**`sandbox_status`** - The state of the sandbox environment:
247
-
-`STARTING` - Sandbox is being created
248
-
-`RUNNING` - Sandbox is active
249
-
-`PAUSED` - Sandbox is paused (due to rate limits or user action)
250
-
-`ERROR` - Sandbox encountered an error
251
-
-`MISSING` - Sandbox was deleted
255
+
-`STARTING` - Sandbox is being created. **Action:** Continue polling.
256
+
-`RUNNING` - Sandbox is active. **Action:** Check `execution_status` for task progress.
257
+
-`PAUSED` - Sandbox is paused (due to rate limits or user action). **Action:** The sandbox will resume automatically when resources are available, or resume manually via the UI.
258
+
-`ERROR` - Sandbox encountered an error. **Action:** This is a terminal state. Check conversation details in the UI for error information.
259
+
-`MISSING` - Sandbox was deleted. **Action:** This is a terminal state. Start a new conversation if needed.
252
260
253
261
**`execution_status`** - The state of the agent's task (available when sandbox is `RUNNING`):
254
-
-`idle` - Agent is ready to receive tasks
255
-
-`running` - Agent is actively working
256
-
-`paused` - Execution is paused
257
-
-`waiting_for_confirmation` - Agent is waiting for user confirmation
258
-
-`finished` - Agent has completed the task
259
-
-`error` - Agent encountered an error
260
-
-`stuck` - Agent is stuck and unable to proceed
262
+
-`idle` - Agent is ready to receive tasks. **Action:** Continue polling if task was recently submitted.
263
+
-`running` - Agent is actively working. **Action:** Continue polling.
264
+
-`paused` - Execution is paused. **Action:** Continue polling; will resume automatically.
265
+
-`waiting_for_confirmation` - Agent is waiting for user confirmation. **Action:** This is a blocking state. The agent needs user input via the UI to proceed. Your polling loop should treat this as a terminal state or alert the user.
266
+
-`finished` - Agent has completed the task. **Action:** Terminal state. Task is done successfully.
267
+
-`error` - Agent encountered an error. **Action:** Terminal state. Check conversation in UI for error details.
268
+
-`stuck` - Agent is stuck and unable to proceed. **Action:** Terminal state. Manual intervention may be required.
269
+
270
+
<Note>
271
+
**Terminal states** that should exit your polling loop: `finished`, `error`, `stuck`, `waiting_for_confirmation`.
272
+
The `waiting_for_confirmation` state requires user action through the UI before the agent can continue.
0 commit comments