Skip to content

Commit c70b8b8

Browse files
committed
Split troubleshooting into separate file and add jpshackelford attribution
- Created references/TROUBLESHOOTING.md with common issues from jpshackelford's feedback - Updated SKILL.md to reference the new troubleshooting file (progressive disclosure) - Added attribution for John-Mason P. Shackelford in README.md and SKILL.md
1 parent f27195b commit c70b8b8

3 files changed

Lines changed: 90 additions & 46 deletions

File tree

skills/openhands-api-v1/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ If `app_conversation_id` is missing from the initial response, fetch it via:
2626
- `GET /api/v1/app-conversations/start-tasks?ids=<start_task_id>`
2727

2828
(If you accidentally use a start-task id with `/download`, you’ll get `404 Not Found`.)
29+

skills/openhands-api-v1/SKILL.md

Lines changed: 3 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -119,53 +119,9 @@ If you need to know how many events a conversation has, you can:
119119
Do **not** rely on the last event `id` to infer the total number of events.
120120
In the agent-server API, event IDs are UUIDs (not monotonically increasing integers).
121121

122-
## Troubleshooting / common issues
122+
## Troubleshooting
123123

124-
### 1) Direct ID lookup returns HTML instead of JSON
125-
126-
**Symptom:** Calling `GET /api/v1/app-conversations/{id}` returns HTML (the frontend app) instead of JSON.
127-
128-
**Cause:** In OpenHands Cloud, this URL pattern is handled by the frontend router, not the API.
129-
130-
**Solution:** Use the batch endpoint with the `ids` query parameter:
131-
132-
```bash
133-
# ❌ Wrong (returns HTML)
134-
curl "${BASE_URL:-https://app.all-hands.dev}/api/v1/app-conversations/${APP_CONVERSATION_ID}" \
135-
-H "Authorization: Bearer ${OPENHANDS_API_KEY}" \
136-
-H "Accept: application/json"
137-
138-
# ✅ Correct (returns JSON)
139-
curl "${BASE_URL:-https://app.all-hands.dev}/api/v1/app-conversations?ids=${APP_CONVERSATION_ID}" \
140-
-H "Authorization: Bearer ${OPENHANDS_API_KEY}" \
141-
-H "Accept: application/json"
142-
```
143-
144-
### 2) "Service Temporarily Unavailable" when calling sandbox/agent-server endpoints
145-
146-
This usually means the sandbox runtime is not currently reachable.
147-
148-
- Check the conversation record (`GET /api/v1/app-conversations?ids=...`) for a `runtime_status`-like field.
149-
- If the sandbox is paused, call `POST /api/v1/sandboxes/{sandbox_id}/resume`.
150-
- If the start-task isn't `READY` yet, poll `GET /api/v1/app-conversations/start-tasks?ids=...` for a bit.
151-
152-
### 3) 404s when downloading trajectory or reading events
153-
154-
Common causes:
155-
156-
- Using a **start_task_id** where an **app_conversation_id** is required (see above).
157-
- Using the wrong event path (V1 is `/api/v1/conversation/{id}/events/...`).
158-
- The conversation was deleted or you don't have access.
159-
160-
### 4) Timing expectations (typical, varies by load)
161-
162-
| Operation | Typical duration |
163-
|---|---:|
164-
| `POST /api/v1/app-conversations` returns | < 1s |
165-
| start-task becomes `READY` | 5–15s |
166-
| sandbox responds to agent-server calls | usually immediately after `READY` |
167-
168-
**Polling guidance:** poll every 3–5 seconds with a reasonable timeout (2–3 minutes). The minimal client implements polite exponential backoff.
124+
For common issues and solutions, see [TROUBLESHOOTING.md](references/TROUBLESHOOTING.md).
169125

170126
## Event structure (for debugging)
171127

@@ -324,3 +280,4 @@ python skills/openhands-api-v1/scripts/openhands_api_v1.py start-conversation \
324280
See also:
325281
- `skills/openhands-api-v1/scripts/openhands_api_v1.py`
326282
- The original inspiration client: `enyst/llm-playground``openhands-api-client-v1/scripts/cloud_api_v1.py`
283+
- Troubleshooting content and real-world usage feedback → `https://github.com/jpshackelford/.openhands/`
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
name: openhands-api-v1-troubleshooting
3+
description: Common issues and solutions when using the OpenHands Cloud API V1.
4+
---
5+
6+
# Troubleshooting / Common Issues
7+
8+
This file documents common issues encountered when working with the OpenHands Cloud API V1.
9+
10+
## 1. Direct ID lookup returns HTML instead of JSON
11+
12+
**Symptom:** Calling `GET /api/v1/app-conversations/{id}` returns HTML (the frontend app) instead of JSON.
13+
14+
**Cause:** In OpenHands Cloud, this URL pattern is handled by the frontend router, not the API.
15+
16+
**Solution:** Use the batch endpoint with the `ids` query parameter:
17+
18+
```bash
19+
# ❌ Wrong (returns HTML)
20+
curl "${BASE_URL:-https://app.all-hands.dev}/api/v1/app-conversations/${APP_CONVERSATION_ID}" \
21+
-H "Authorization: Bearer ${OPENHANDS_API_KEY}" \
22+
-H "Accept: application/json"
23+
24+
# ✅ Correct (returns JSON)
25+
curl "${BASE_URL:-https://app.all-hands.dev}/api/v1/app-conversations?ids=${APP_CONVERSATION_ID}" \
26+
-H "Authorization: Bearer ${OPENHANDS_API_KEY}" \
27+
-H "Accept: application/json"
28+
```
29+
30+
## 2. "Service Temporarily Unavailable" when calling sandbox/agent-server endpoints
31+
32+
This usually means the sandbox runtime is not currently reachable.
33+
34+
- Check the conversation record (`GET /api/v1/app-conversations?ids=...`) for a `runtime_status`-like field.
35+
- If the sandbox is paused, call `POST /api/v1/sandboxes/{sandbox_id}/resume`.
36+
- If the start-task isn't `READY` yet, poll `GET /api/v1/app-conversations/start-tasks?ids=...` for a bit.
37+
38+
## 3. 404s when downloading trajectory or reading events
39+
40+
Common causes:
41+
42+
- Using a **start_task_id** where an **app_conversation_id** is required (see above).
43+
- Using the wrong event path (V1 is `/api/v1/conversation/{id}/events/...`).
44+
- The conversation was deleted or you don't have access.
45+
46+
## 4. Timing expectations (typical, varies by load)
47+
48+
| Operation | Typical duration |
49+
|---|---:|
50+
| `POST /api/v1/app-conversations` returns | < 1s |
51+
| start-task becomes `READY` | 5–15s |
52+
| sandbox responds to agent-server calls | usually immediately after `READY` |
53+
54+
**Polling guidance:** poll every 3–5 seconds with a reasonable timeout (2–3 minutes). The minimal client implements polite exponential backoff.
55+
56+
## Practical Tips
57+
58+
- **Save responses locally for analysis** — When debugging, pipe API responses to a file:
59+
```bash
60+
curl ... > response.json
61+
# Then analyze with jq or python
62+
```
63+
64+
- **Use jq for quick filtering** — For fast event inspection:
65+
```bash
66+
curl ... | jq '.items[] | select(.kind == "ErrorEvent")'
67+
```
68+
69+
- **Check runtime_status before querying events** — Always verify the sandbox is ready:
70+
```bash
71+
# Get conversation to check runtime_status
72+
GET /api/v1/app-conversations?ids=<id>
73+
# Only query events if runtime_status shows READY
74+
```
75+
76+
- **Use trajectory zip for offline analysis** — Download the full trajectory:
77+
```bash
78+
GET /api/v1/app-conversations/{id}/download
79+
```
80+
Then analyze all event files locally without making multiple API calls.
81+
82+
- **Monitor start-task status** — When starting conversations, poll the start-task until ready before querying events or executing agent commands.
83+
84+
---
85+
86+
*Content adapted from user feedback and real-world usage patterns.*

0 commit comments

Comments
 (0)