@openhands/extensions 0.21.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/.claude-plugin/marketplace.json +881 -0
  2. package/.codex-plugin/marketplace.json +881 -0
  3. package/.github/workflows/npm-publish.yml +9 -3
  4. package/.plugin/marketplace.json +881 -0
  5. package/.release-please-manifest.json +1 -1
  6. package/README.md +3 -2
  7. package/automations/bundle-index.js +16 -7
  8. package/automations/catalog/github-delivery-watchdog/manifest.json +79 -0
  9. package/automations/catalog/github-issue-to-pr/manifest.json +23 -15
  10. package/automations/catalog/github-issue-triage/manifest.json +4 -3
  11. package/automations/catalog/github-pr-reviewer/manifest.json +22 -15
  12. package/automations/catalog-index.js +6 -4
  13. package/marketplaces/openhands-extensions.json +6 -0
  14. package/package.json +1 -1
  15. package/plugins/city-weather/.claude-plugin/plugin.json +13 -0
  16. package/plugins/city-weather/.codex-plugin/plugin.json +13 -0
  17. package/plugins/cobol-modernization/.claude-plugin/plugin.json +19 -0
  18. package/plugins/cobol-modernization/.codex-plugin/plugin.json +19 -0
  19. package/plugins/issue-duplicate-checker/.claude-plugin/plugin.json +13 -0
  20. package/plugins/issue-duplicate-checker/.codex-plugin/plugin.json +13 -0
  21. package/plugins/magic-test/.claude-plugin/plugin.json +13 -0
  22. package/plugins/magic-test/.codex-plugin/plugin.json +13 -0
  23. package/plugins/migration-scoring/.claude-plugin/plugin.json +19 -0
  24. package/plugins/migration-scoring/.codex-plugin/plugin.json +19 -0
  25. package/plugins/onboarding/.claude-plugin/plugin.json +20 -0
  26. package/plugins/onboarding/.codex-plugin/plugin.json +20 -0
  27. package/plugins/onboarding/skills/agent-readiness-report/references/criteria.md +144 -0
  28. package/plugins/onboarding/skills/improve-agent-readiness/references/criteria.md +144 -0
  29. package/plugins/openhands/.claude-plugin/plugin.json +13 -0
  30. package/plugins/openhands/.codex-plugin/plugin.json +13 -0
  31. package/plugins/openhands/skills/openhands-api/.claude-plugin/plugin.json +22 -0
  32. package/plugins/openhands/skills/openhands-api/.codex-plugin/plugin.json +22 -0
  33. package/plugins/openhands/skills/openhands-api/.plugin/plugin.json +22 -0
  34. package/plugins/openhands/skills/openhands-api/README.md +52 -0
  35. package/plugins/openhands/skills/openhands-api/SKILL.md +469 -0
  36. package/plugins/openhands/skills/openhands-api/references/README.md +33 -0
  37. package/plugins/openhands/skills/openhands-api/references/TROUBLESHOOTING.md +81 -0
  38. package/plugins/openhands/skills/openhands-api/references/example_prompt.md +12 -0
  39. package/plugins/openhands/skills/openhands-api/references/windows.md +44 -0
  40. package/plugins/openhands/skills/openhands-api/scripts/openhands_api.py +606 -0
  41. package/plugins/openhands/skills/openhands-api/scripts/openhands_api.ts +252 -0
  42. package/plugins/openhands/skills/openhands-automation/.claude-plugin/plugin.json +19 -0
  43. package/plugins/openhands/skills/openhands-automation/.codex-plugin/plugin.json +19 -0
  44. package/plugins/openhands/skills/openhands-automation/.plugin/plugin.json +19 -0
  45. package/plugins/openhands/skills/openhands-automation/README.md +89 -0
  46. package/plugins/openhands/skills/openhands-automation/SKILL.md +899 -0
  47. package/plugins/openhands/skills/openhands-automation/commands/automation-create.md +8 -0
  48. package/plugins/openhands/skills/openhands-automation/references/ab-testing.md +185 -0
  49. package/plugins/openhands/skills/openhands-automation/references/custom-automation.md +832 -0
  50. package/plugins/openhands/skills/openhands-automation/references/security.md +84 -0
  51. package/plugins/openhands/skills/openhands-automation/references/windows.md +57 -0
  52. package/plugins/openhands/skills/openhands-sdk/.claude-plugin/plugin.json +20 -0
  53. package/plugins/openhands/skills/openhands-sdk/.codex-plugin/plugin.json +20 -0
  54. package/plugins/openhands/skills/openhands-sdk/.plugin/plugin.json +20 -0
  55. package/plugins/openhands/skills/openhands-sdk/README.md +22 -0
  56. package/plugins/openhands/skills/openhands-sdk/SKILL.md +245 -0
  57. package/plugins/openhands/skills/openhands-sdk/commands/sdk.md +8 -0
  58. package/plugins/pr-review/.claude-plugin/plugin.json +13 -0
  59. package/plugins/pr-review/.codex-plugin/plugin.json +13 -0
  60. package/plugins/pr-review/skills/code-review/.claude-plugin/plugin.json +19 -0
  61. package/plugins/pr-review/skills/code-review/.codex-plugin/plugin.json +19 -0
  62. package/plugins/pr-review/skills/code-review/.plugin/plugin.json +19 -0
  63. package/plugins/pr-review/skills/code-review/README.md +18 -0
  64. package/plugins/pr-review/skills/code-review/SKILL.md +209 -0
  65. package/plugins/pr-review/skills/code-review/commands/codereview-roasted.md +8 -0
  66. package/plugins/pr-review/skills/code-review/commands/codereview.md +8 -0
  67. package/plugins/pr-review/skills/code-review/references/risk-evaluation.md +41 -0
  68. package/plugins/pr-review/skills/code-review/references/supply-chain-security.md +31 -0
  69. package/plugins/pr-review/skills/github-pr-review/.claude-plugin/plugin.json +18 -0
  70. package/plugins/pr-review/skills/github-pr-review/.codex-plugin/plugin.json +18 -0
  71. package/plugins/pr-review/skills/github-pr-review/.plugin/plugin.json +18 -0
  72. package/plugins/pr-review/skills/github-pr-review/README.md +145 -0
  73. package/plugins/pr-review/skills/github-pr-review/SKILL.md +187 -0
  74. package/plugins/pr-review/skills/github-pr-review/commands/github-pr-review.md +8 -0
  75. package/plugins/pr-review/skills/github-pr-review/references/windows.md +47 -0
  76. package/plugins/qa-changes/.claude-plugin/plugin.json +11 -0
  77. package/plugins/qa-changes/.codex-plugin/plugin.json +11 -0
  78. package/plugins/qa-changes/skills/github-pr-review/.claude-plugin/plugin.json +18 -0
  79. package/plugins/qa-changes/skills/github-pr-review/.codex-plugin/plugin.json +18 -0
  80. package/plugins/qa-changes/skills/github-pr-review/.plugin/plugin.json +18 -0
  81. package/plugins/qa-changes/skills/github-pr-review/README.md +145 -0
  82. package/plugins/qa-changes/skills/github-pr-review/SKILL.md +187 -0
  83. package/plugins/qa-changes/skills/github-pr-review/commands/github-pr-review.md +8 -0
  84. package/plugins/qa-changes/skills/github-pr-review/references/windows.md +47 -0
  85. package/plugins/qa-changes/skills/qa-changes/README.md +18 -0
  86. package/plugins/qa-changes/skills/qa-changes/SKILL.md +229 -0
  87. package/plugins/qa-changes/skills/qa-changes/commands/qa-changes.md +8 -0
  88. package/plugins/release-notes/.claude-plugin/plugin.json +19 -0
  89. package/plugins/release-notes/.codex-plugin/plugin.json +19 -0
  90. package/plugins/release-notes/skills/release-notes/README.md +24 -0
  91. package/plugins/release-notes/skills/release-notes/SKILL.md +19 -0
  92. package/plugins/release-notes/skills/release-notes/commands/release-notes.md +8 -0
  93. package/plugins/vulnerability-remediation/.claude-plugin/plugin.json +19 -0
  94. package/plugins/vulnerability-remediation/.codex-plugin/plugin.json +19 -0
  95. package/plugins/vulnerability-remediation/skills/github/.claude-plugin/plugin.json +19 -0
  96. package/plugins/vulnerability-remediation/skills/github/.codex-plugin/plugin.json +19 -0
  97. package/plugins/vulnerability-remediation/skills/github/.plugin/plugin.json +19 -0
  98. package/plugins/vulnerability-remediation/skills/github/README.md +42 -0
  99. package/plugins/vulnerability-remediation/skills/github/SKILL.md +107 -0
  100. package/plugins/vulnerability-remediation/skills/github/references/windows.md +48 -0
  101. package/plugins/vulnerability-remediation/skills/github/scripts/agent_conversation.py +143 -0
  102. package/plugins/vulnerability-remediation/skills/github/scripts/github_client.py +230 -0
  103. package/plugins/vulnerability-remediation/skills/security/.claude-plugin/plugin.json +18 -0
  104. package/plugins/vulnerability-remediation/skills/security/.codex-plugin/plugin.json +18 -0
  105. package/plugins/vulnerability-remediation/skills/security/.plugin/plugin.json +18 -0
  106. package/plugins/vulnerability-remediation/skills/security/README.md +38 -0
  107. package/plugins/vulnerability-remediation/skills/security/SKILL.md +33 -0
  108. package/pyproject.toml +1 -1
  109. package/python/openhands_extensions/_version.py +1 -1
  110. package/skills/add-javadoc/.claude-plugin/plugin.json +18 -0
  111. package/skills/add-javadoc/.codex-plugin/plugin.json +18 -0
  112. package/skills/add-skill/.claude-plugin/plugin.json +18 -0
  113. package/skills/add-skill/.codex-plugin/plugin.json +18 -0
  114. package/skills/agent-canvas-environment/.claude-plugin/plugin.json +19 -0
  115. package/skills/agent-canvas-environment/.codex-plugin/plugin.json +19 -0
  116. package/skills/agent-creator/.claude-plugin/plugin.json +20 -0
  117. package/skills/agent-creator/.codex-plugin/plugin.json +20 -0
  118. package/skills/agent-memory/.claude-plugin/plugin.json +18 -0
  119. package/skills/agent-memory/.codex-plugin/plugin.json +18 -0
  120. package/skills/agent-sdk-builder/.claude-plugin/plugin.json +18 -0
  121. package/skills/agent-sdk-builder/.codex-plugin/plugin.json +18 -0
  122. package/skills/azure-devops/.claude-plugin/plugin.json +18 -0
  123. package/skills/azure-devops/.codex-plugin/plugin.json +18 -0
  124. package/skills/bitbucket/.claude-plugin/plugin.json +17 -0
  125. package/skills/bitbucket/.codex-plugin/plugin.json +17 -0
  126. package/skills/bitbucket-cloud/.claude-plugin/plugin.json +18 -0
  127. package/skills/bitbucket-cloud/.codex-plugin/plugin.json +18 -0
  128. package/skills/bitbucket-data-center/.claude-plugin/plugin.json +19 -0
  129. package/skills/bitbucket-data-center/.codex-plugin/plugin.json +19 -0
  130. package/skills/code-review/.claude-plugin/plugin.json +19 -0
  131. package/skills/code-review/.codex-plugin/plugin.json +19 -0
  132. package/skills/code-simplifier/.claude-plugin/plugin.json +21 -0
  133. package/skills/code-simplifier/.codex-plugin/plugin.json +21 -0
  134. package/skills/datadog/.claude-plugin/plugin.json +19 -0
  135. package/skills/datadog/.codex-plugin/plugin.json +19 -0
  136. package/skills/deno/.claude-plugin/plugin.json +18 -0
  137. package/skills/deno/.codex-plugin/plugin.json +18 -0
  138. package/skills/discord/.claude-plugin/plugin.json +18 -0
  139. package/skills/discord/.codex-plugin/plugin.json +18 -0
  140. package/skills/docker/.claude-plugin/plugin.json +17 -0
  141. package/skills/docker/.codex-plugin/plugin.json +17 -0
  142. package/skills/evidence-based-citations/.claude-plugin/plugin.json +20 -0
  143. package/skills/evidence-based-citations/.codex-plugin/plugin.json +20 -0
  144. package/skills/flarglebargle/.claude-plugin/plugin.json +16 -0
  145. package/skills/flarglebargle/.codex-plugin/plugin.json +16 -0
  146. package/skills/frontend-design/.claude-plugin/plugin.json +21 -0
  147. package/skills/frontend-design/.codex-plugin/plugin.json +21 -0
  148. package/skills/github/.claude-plugin/plugin.json +19 -0
  149. package/skills/github/.codex-plugin/plugin.json +19 -0
  150. package/skills/github/scripts/agent_conversation.py +143 -0
  151. package/skills/github/scripts/github_client.py +31 -5
  152. package/skills/github-actions/.claude-plugin/plugin.json +19 -0
  153. package/skills/github-actions/.codex-plugin/plugin.json +19 -0
  154. package/skills/github-agents-md-maintainer/.claude-plugin/plugin.json +19 -0
  155. package/skills/github-agents-md-maintainer/.codex-plugin/plugin.json +19 -0
  156. package/skills/github-agents-md-maintainer/scripts/github_client.py +230 -0
  157. package/skills/github-delivery-watchdog/.claude-plugin/plugin.json +9 -0
  158. package/skills/github-delivery-watchdog/.codex-plugin/plugin.json +9 -0
  159. package/skills/github-delivery-watchdog/.plugin/plugin.json +9 -0
  160. package/skills/github-delivery-watchdog/README.md +10 -0
  161. package/skills/github-delivery-watchdog/SKILL.md +35 -0
  162. package/skills/github-delivery-watchdog/commands/github-delivery-watchdog.md +8 -0
  163. package/skills/github-delivery-watchdog/scripts/github_client.py +230 -0
  164. package/skills/github-delivery-watchdog/scripts/worker.py +96 -0
  165. package/skills/github-issue-to-pr/.claude-plugin/plugin.json +19 -0
  166. package/skills/github-issue-to-pr/.codex-plugin/plugin.json +19 -0
  167. package/skills/github-issue-to-pr/SKILL.md +7 -0
  168. package/skills/github-issue-to-pr/scripts/agent_conversation.py +143 -0
  169. package/skills/github-issue-to-pr/scripts/github_client.py +230 -0
  170. package/skills/github-issue-to-pr/scripts/main.py +16 -10
  171. package/skills/github-issue-to-pr/scripts/worker.py +172 -0
  172. package/skills/github-issue-triage/.claude-plugin/plugin.json +9 -0
  173. package/skills/github-issue-triage/.codex-plugin/plugin.json +9 -0
  174. package/skills/github-issue-triage/SKILL.md +15 -18
  175. package/skills/github-issue-triage/scripts/agent_conversation.py +143 -0
  176. package/skills/github-issue-triage/scripts/github_client.py +230 -0
  177. package/skills/github-issue-triage/scripts/worker.py +81 -98
  178. package/skills/github-pr-review/.claude-plugin/plugin.json +18 -0
  179. package/skills/github-pr-review/.codex-plugin/plugin.json +18 -0
  180. package/skills/github-pr-reviewer/.claude-plugin/plugin.json +20 -0
  181. package/skills/github-pr-reviewer/.codex-plugin/plugin.json +20 -0
  182. package/skills/github-pr-reviewer/SKILL.md +7 -0
  183. package/skills/github-pr-reviewer/scripts/agent_conversation.py +143 -0
  184. package/skills/github-pr-reviewer/scripts/github_client.py +230 -0
  185. package/skills/github-pr-reviewer/scripts/main.py +20 -8
  186. package/skills/github-pr-reviewer/scripts/worker.py +94 -0
  187. package/skills/github-repo-monitor/.claude-plugin/plugin.json +22 -0
  188. package/skills/github-repo-monitor/.codex-plugin/plugin.json +22 -0
  189. package/skills/github-repo-monitor/scripts/github_client.py +230 -0
  190. package/skills/gitlab/.claude-plugin/plugin.json +17 -0
  191. package/skills/gitlab/.codex-plugin/plugin.json +17 -0
  192. package/skills/gitlab-issue-to-mr/.claude-plugin/plugin.json +19 -0
  193. package/skills/gitlab-issue-to-mr/.codex-plugin/plugin.json +19 -0
  194. package/skills/incident-retrospective/.claude-plugin/plugin.json +21 -0
  195. package/skills/incident-retrospective/.codex-plugin/plugin.json +21 -0
  196. package/skills/index.js +12 -3
  197. package/skills/iterate/.claude-plugin/plugin.json +13 -0
  198. package/skills/iterate/.codex-plugin/plugin.json +13 -0
  199. package/skills/jira-issue-to-pr/.claude-plugin/plugin.json +19 -0
  200. package/skills/jira-issue-to-pr/.codex-plugin/plugin.json +19 -0
  201. package/skills/jupyter/.claude-plugin/plugin.json +18 -0
  202. package/skills/jupyter/.codex-plugin/plugin.json +18 -0
  203. package/skills/kubernetes/.claude-plugin/plugin.json +18 -0
  204. package/skills/kubernetes/.codex-plugin/plugin.json +18 -0
  205. package/skills/learn-from-code-review/.claude-plugin/plugin.json +19 -0
  206. package/skills/learn-from-code-review/.codex-plugin/plugin.json +19 -0
  207. package/skills/linear/.claude-plugin/plugin.json +19 -0
  208. package/skills/linear/.codex-plugin/plugin.json +19 -0
  209. package/skills/linear-triage/.claude-plugin/plugin.json +21 -0
  210. package/skills/linear-triage/.codex-plugin/plugin.json +21 -0
  211. package/skills/news-digest/.claude-plugin/plugin.json +19 -0
  212. package/skills/news-digest/.codex-plugin/plugin.json +19 -0
  213. package/skills/notion/.claude-plugin/plugin.json +17 -0
  214. package/skills/notion/.codex-plugin/plugin.json +17 -0
  215. package/skills/npm/.claude-plugin/plugin.json +17 -0
  216. package/skills/npm/.codex-plugin/plugin.json +17 -0
  217. package/skills/openhands-api/.claude-plugin/plugin.json +22 -0
  218. package/skills/openhands-api/.codex-plugin/plugin.json +22 -0
  219. package/skills/openhands-automation/.claude-plugin/plugin.json +19 -0
  220. package/skills/openhands-automation/.codex-plugin/plugin.json +19 -0
  221. package/skills/openhands-enterprise-troubleshooting/.claude-plugin/plugin.json +20 -0
  222. package/skills/openhands-enterprise-troubleshooting/.codex-plugin/plugin.json +20 -0
  223. package/skills/openhands-sdk/.claude-plugin/plugin.json +20 -0
  224. package/skills/openhands-sdk/.codex-plugin/plugin.json +20 -0
  225. package/skills/pdflatex/.claude-plugin/plugin.json +18 -0
  226. package/skills/pdflatex/.codex-plugin/plugin.json +18 -0
  227. package/skills/plain-english-content/.claude-plugin/plugin.json +15 -0
  228. package/skills/plain-english-content/.codex-plugin/plugin.json +15 -0
  229. package/skills/prd/.claude-plugin/plugin.json +19 -0
  230. package/skills/prd/.codex-plugin/plugin.json +19 -0
  231. package/skills/research-brief/.claude-plugin/plugin.json +20 -0
  232. package/skills/research-brief/.codex-plugin/plugin.json +20 -0
  233. package/skills/security/.claude-plugin/plugin.json +18 -0
  234. package/skills/security/.codex-plugin/plugin.json +18 -0
  235. package/skills/skill-creator/.claude-plugin/plugin.json +17 -0
  236. package/skills/skill-creator/.codex-plugin/plugin.json +17 -0
  237. package/skills/slack-channel-monitor/.claude-plugin/plugin.json +21 -0
  238. package/skills/slack-channel-monitor/.codex-plugin/plugin.json +21 -0
  239. package/skills/slack-standup-digest/.claude-plugin/plugin.json +21 -0
  240. package/skills/slack-standup-digest/.codex-plugin/plugin.json +21 -0
  241. package/skills/spark-version-upgrade/.claude-plugin/plugin.json +20 -0
  242. package/skills/spark-version-upgrade/.codex-plugin/plugin.json +20 -0
  243. package/skills/ssh/.claude-plugin/plugin.json +18 -0
  244. package/skills/ssh/.codex-plugin/plugin.json +18 -0
  245. package/skills/swift-linux/.claude-plugin/plugin.json +17 -0
  246. package/skills/swift-linux/.codex-plugin/plugin.json +17 -0
  247. package/skills/technical-writing/.claude-plugin/plugin.json +15 -0
  248. package/skills/technical-writing/.codex-plugin/plugin.json +15 -0
  249. package/skills/theme-factory/.claude-plugin/plugin.json +19 -0
  250. package/skills/theme-factory/.codex-plugin/plugin.json +19 -0
  251. package/skills/ticket-to-code-change/.claude-plugin/plugin.json +21 -0
  252. package/skills/ticket-to-code-change/.codex-plugin/plugin.json +21 -0
  253. package/skills/upstream-fork-sync/.claude-plugin/plugin.json +21 -0
  254. package/skills/upstream-fork-sync/.codex-plugin/plugin.json +21 -0
  255. package/skills/uv/.claude-plugin/plugin.json +18 -0
  256. package/skills/uv/.codex-plugin/plugin.json +18 -0
  257. package/skills/vercel/.claude-plugin/plugin.json +18 -0
  258. package/skills/vercel/.codex-plugin/plugin.json +18 -0
  259. package/tests/fixtures/automations/capabilities.json +6 -3
  260. package/tests/fixtures/automations/github-pr-reviewer.json +64 -43
  261. package/tests/github_automation_helpers.py +7 -1
  262. package/tests/test_agent_conversation_dispatch.py +180 -0
  263. package/tests/test_automation_setup.py +3 -3
  264. package/tests/test_github_developer_delivery.py +150 -0
  265. package/tests/test_github_reviewer_delivery.py +110 -0
  266. package/tests/test_github_triage_delivery.py +78 -41
  267. package/tests/test_github_watchdog_delivery.py +233 -0
@@ -0,0 +1,469 @@
1
+ ---
2
+ name: openhands-api
3
+ description: Reference skill for the OpenHands Cloud REST API (V1) and agent-server APIs, including how to start additional cloud or local backend conversations for fresh-context or delegated work.
4
+ triggers:
5
+ - openhands-api
6
+ - openhands-api-v1
7
+ - openhands-cloud
8
+ - openhands-cloud-api-v1
9
+ - oh-api-v1
10
+ - oh-cloud-api-v1
11
+ ---
12
+
13
+ This skill documents the **OpenHands Cloud API** (V1), commonly used **agent-server APIs**, and small, easy-to-copy clients.
14
+ Windows PowerShell equivalents for the shell examples in this skill are in `references/windows.md`.
15
+
16
+ It is intentionally focused on common OpenHands API workflows:
17
+
18
+ - Defaults to OpenHands Cloud (`https://app.all-hands.dev`).
19
+ - Targets the **V1 app server REST API** under `/api/v1/...`.
20
+ - Includes a few **agent server** endpoints (inside a sandbox) that use `X-Session-API-Key`.
21
+ - Covers the **multi-conversation delegation pattern**: start separate Cloud conversations when you want fresh context windows or background work.
22
+ - Covers **local Agent Canvas backend conversations**: start or inspect conversations by calling a local agent server directly.
23
+
24
+ ## When to use this skill
25
+
26
+ Use this skill when you need to:
27
+
28
+ - start or inspect OpenHands Cloud conversations from code
29
+ - monitor async startup via start-task polling
30
+ - monitor execution status for long-running jobs
31
+ - create separate Cloud conversations for parallel or background work
32
+ - access sandbox agent-server endpoints once a conversation is running
33
+ - start or inspect conversations on a local Agent Canvas backend or local agent server
34
+
35
+ ## Auth
36
+
37
+ ### App server (Cloud)
38
+
39
+ Use Bearer auth:
40
+
41
+ - Header: `Authorization: Bearer <OPENHANDS_CLOUD_API_KEY>`
42
+ - Preferred env var: `OPENHANDS_CLOUD_API_KEY`
43
+ - Backward-compatible env var: `OPENHANDS_API_KEY`
44
+
45
+ ### Agent server (inside a sandbox)
46
+
47
+ Use session auth:
48
+
49
+ - Header: `X-Session-API-Key: <session_api_key>`
50
+
51
+ How to obtain `agent_server_url` and `session_api_key`:
52
+
53
+ 1. Start or fetch an app conversation via the app server (Bearer auth), e.g.:
54
+ - `POST /api/v1/app-conversations`
55
+ - or `GET /api/v1/app-conversations?ids=<conversation_id>`
56
+ 2. In the returned JSON, look for sandbox/runtime connection fields (names vary slightly by deployment/version). Common patterns:
57
+ - a sandbox object containing `agent_server_url` (or similar)
58
+ - a session key such as `session_api_key` (or similar)
59
+ 3. Use those values to call the agent server directly:
60
+ - Base: `{agent_server_url}/api/...`
61
+ - Header: `X-Session-API-Key: <session_api_key>`
62
+
63
+ Example (common field names; adjust to your deployment):
64
+
65
+ ```python
66
+ # using the minimal Python client (`OpenHandsAPI`)
67
+ conv = api.app_conversation_get(app_conversation_id)
68
+
69
+ session_api_key = conv.get("session_api_key")
70
+ conversation_url = conv.get("conversation_url", "")
71
+
72
+ # `conversation_url` often looks like: https://<runtime-host>/api/conversations/<id>
73
+ agent_server_url = conversation_url.rsplit("/api/conversations", 1)[0]
74
+ ```
75
+
76
+
77
+ If those fields are not present on the conversation record, list/search sandboxes (`GET /api/v1/sandboxes/search`) and use the sandbox referenced by the conversation to locate the agent server URL + session key.
78
+
79
+ ### Local Agent Canvas backend
80
+
81
+ Use the local backend flow only for local Agent Canvas / agent-server development, such as `agent-canvas`, `agent-canvas --backend-only`, or `npm run dev` with ingress at `http://localhost:8000`. This calls the agent server directly with `X-Session-API-Key`. It is not an automation, and it is different from OpenHands Cloud delegation through `POST /api/v1/app-conversations`, which uses Bearer auth against the Cloud app API and may return asynchronous start-task records.
82
+
83
+ When Agent Canvas runs locally, the launcher uses `LOCAL_BACKEND_API_KEY` when it is set. Otherwise it generates and persists the session API key at `~/.openhands/agent-canvas/api-key.txt`. Set `OH_SESSION_API_KEY_PATH` to override the persisted key path. Never print, log, or paste the actual key; use command substitution or an environment variable in examples and scripts.
84
+
85
+ ```bash
86
+ LOCAL_AGENT_SERVER_URL="${LOCAL_AGENT_SERVER_URL:-http://localhost:8000}"
87
+ SESSION_API_KEY="${LOCAL_BACKEND_API_KEY:-$(cat "${OH_SESSION_API_KEY_PATH:-$HOME/.openhands/agent-canvas/api-key.txt}")}"
88
+ ```
89
+
90
+ Check the local server before creating a backend conversation:
91
+
92
+ ```bash
93
+ curl -sS "${LOCAL_AGENT_SERVER_URL}/server_info" \
94
+ -H "X-Session-API-Key: ${SESSION_API_KEY}"
95
+ ```
96
+
97
+ Start a backend conversation with `POST /api/conversations`. Include the agent settings and workspace expected by that backend. Local agent-server calls use an explicit `workspace` such as `{"kind": "LocalWorkspace", "working_dir": "/workspace"}`; Cloud app-conversation delegation instead uses app-server fields such as `selected_repository` and `selected_branch`. If you are starting the conversation from an existing Agent Canvas session, pass through the current configured settings or encrypted settings rather than hard-coding secrets into scripts.
98
+
99
+ ```bash
100
+ CONVERSATION_JSON=$(curl -sS -X POST "${LOCAL_AGENT_SERVER_URL}/api/conversations" \
101
+ -H "X-Session-API-Key: ${SESSION_API_KEY}" \
102
+ -H "Content-Type: application/json" \
103
+ -d @- <<'JSON'
104
+ {
105
+ "agent": {
106
+ "kind": "Agent",
107
+ "llm": {
108
+ "model": "your-model-provider/your-model-name",
109
+ "api_key": "**********"
110
+ },
111
+ "tools": [
112
+ {"name": "terminal"},
113
+ {"name": "file_editor"},
114
+ {"name": "task_tracker"}
115
+ ]
116
+ },
117
+ "workspace": {"kind": "LocalWorkspace", "working_dir": "/workspace"},
118
+ "initial_message": {
119
+ "content": [{"text": "Summarize the current workspace."}],
120
+ "run": true
121
+ }
122
+ }
123
+ JSON
124
+ )
125
+ CONVERSATION_ID=$(python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])' <<<"${CONVERSATION_JSON}")
126
+ printf 'Conversation: %s/api/conversations/%s\n' "${LOCAL_AGENT_SERVER_URL}" "${CONVERSATION_ID}"
127
+ ```
128
+
129
+ Poll status and inspect recent events:
130
+
131
+ ```bash
132
+ curl -sS "${LOCAL_AGENT_SERVER_URL}/api/conversations/${CONVERSATION_ID}" \
133
+ -H "X-Session-API-Key: ${SESSION_API_KEY}"
134
+
135
+ curl -sS "${LOCAL_AGENT_SERVER_URL}/api/conversations/${CONVERSATION_ID}/events/search?limit=20&sort_order=TIMESTAMP_DESC" \
136
+ -H "X-Session-API-Key: ${SESSION_API_KEY}"
137
+ ```
138
+
139
+ If the same base URL serves the Agent Canvas UI, the browser route is:
140
+
141
+ ```bash
142
+ printf '%s/conversations/%s\n' "${LOCAL_AGENT_SERVER_URL}" "${CONVERSATION_ID}"
143
+ ```
144
+
145
+ ## Common V1 app server endpoints
146
+
147
+ The following are the main endpoints implemented in the minimal client:
148
+
149
+ - `GET /api/v1/users/me` — validate auth and inspect current account
150
+ - `GET /api/v1/app-conversations/search?limit=...` — list recent conversations
151
+ - `GET /api/v1/app-conversations?ids=...` — fetch conversation records by id (batch)
152
+ - `GET /api/v1/app-conversations/count` — count conversations
153
+ - `POST /api/v1/app-conversations` — start a new conversation (creates a sandbox)
154
+ - `GET /api/v1/app-conversations/start-tasks?ids=...` — check async start-task status
155
+ - `GET /api/v1/conversation/{app_conversation_id}/events/search?limit=...` — read conversation events
156
+ - `GET /api/v1/conversation/{app_conversation_id}/events/count` — count events
157
+ - `GET /api/v1/sandboxes/search?limit=...` — list sandboxes
158
+ - `POST /api/v1/sandboxes/{sandbox_id}/pause` / `.../resume` — manage sandbox lifecycle
159
+ - `GET /api/v1/app-conversations/{app_conversation_id}/download` — download trajectory zip
160
+
161
+ ## Delegating work with additional Cloud conversations
162
+
163
+ Use the Cloud API when you want a **separate OpenHands conversation** with its own fresh context window.
164
+ This is useful for:
165
+
166
+ - background jobs that can run independently
167
+ - parallel investigations or implementation tasks
168
+ - long-running work where you want to keep the current conversation focused
169
+ - task-specific contexts, such as one conversation building a component while another runs tests
170
+
171
+ ### Delegation checklist
172
+
173
+ When you start a delegated Cloud conversation:
174
+
175
+ 1. Write a **self-contained task description**. Do not assume the new conversation has any context from the current one.
176
+ 2. Include the **repository**, branch, relevant file paths, constraints, and expected output.
177
+ 3. Start the new conversation with `POST /api/v1/app-conversations`.
178
+ 4. Poll the start-task until `status` is `READY` and you have an `app_conversation_id`.
179
+ 5. Monitor the delegated conversation via `GET /api/v1/app-conversations?ids=...`.
180
+ 6. Share or store the Cloud URL: `https://app.all-hands.dev/conversations/<app_conversation_id>`.
181
+
182
+ ### Minimal cURL flow
183
+
184
+ ```bash
185
+ curl -X POST "https://app.all-hands.dev/api/v1/app-conversations" \
186
+ -H "Authorization: Bearer ${OPENHANDS_CLOUD_API_KEY}" \
187
+ -H "Content-Type: application/json" \
188
+ -d '{
189
+ "initial_message": {
190
+ "content": [{"type": "text", "text": "Investigate flaky tests in tests/test_api.py. Report the root cause and propose a fix."}]
191
+ },
192
+ "selected_repository": "owner/repo"
193
+ }'
194
+ ```
195
+
196
+ If the response does not already include `app_conversation_id`, poll the start-task:
197
+
198
+ ```bash
199
+ curl -s "https://app.all-hands.dev/api/v1/app-conversations/start-tasks?ids=${START_TASK_ID}" \
200
+ -H "Authorization: Bearer ${OPENHANDS_CLOUD_API_KEY}"
201
+ ```
202
+
203
+ Then check execution status:
204
+
205
+ ```bash
206
+ curl -s "https://app.all-hands.dev/api/v1/app-conversations?ids=${APP_CONVERSATION_ID}" \
207
+ -H "Authorization: Bearer ${OPENHANDS_CLOUD_API_KEY}"
208
+ ```
209
+
210
+ ### Minimal Python flow
211
+
212
+ ```python
213
+ from openhands_api import OpenHandsAPI
214
+
215
+ api = OpenHandsAPI() # prefers OPENHANDS_CLOUD_API_KEY
216
+
217
+ start = api.app_conversation_start(
218
+ initial_message=(
219
+ "Implement the requested dashboard component in src/dashboard.tsx. "
220
+ "Update any related tests and summarize the changes."
221
+ ),
222
+ selected_repository="owner/repo",
223
+ selected_branch="main",
224
+ title="Dashboard component task",
225
+ )
226
+
227
+ ready = start
228
+ if not ready.get("app_conversation_id"):
229
+ ready = api.poll_start_task_until_ready(start["id"])
230
+
231
+ conversation_id = ready["app_conversation_id"]
232
+ print(f"Delegated conversation: {api.base_url}/conversations/{conversation_id}")
233
+
234
+ status = api.app_conversation_get(conversation_id)
235
+ print(status.get("sandbox_status"), status.get("execution_status"))
236
+
237
+ api.close()
238
+ ```
239
+
240
+ ### Parallelism guidance
241
+
242
+ - Prefer **5 or fewer** concurrently running delegated conversations.
243
+ - Before starting more, check recent conversations and count how many are still `execution_status == "running"`.
244
+ - Batch specific conversation lookups with `GET /api/v1/app-conversations?ids=...` when you already know their ids.
245
+
246
+ Example:
247
+
248
+ ```python
249
+ items = api.app_conversations_search(limit=50).get("items", [])
250
+ running = [item for item in items if item.get("execution_status") == "running"]
251
+ if len(running) >= 5:
252
+ print("Wait for some delegated conversations to finish before starting more.")
253
+ ```
254
+
255
+
256
+ ### Start-task vs `app_conversation_id` (common pitfall)
257
+
258
+ In many deployments, `POST /api/v1/app-conversations` is **asynchronous** and returns a **start-task** object:
259
+
260
+ - `id` is the **start_task_id**
261
+ - `app_conversation_id` is the id you should use for conversation operations like:
262
+ - `GET /api/v1/app-conversations/{app_conversation_id}/download`
263
+ - `GET /api/v1/conversation/{app_conversation_id}/events/...`
264
+
265
+ If `app_conversation_id` is not present in the initial response, fetch it via:
266
+
267
+ - `GET /api/v1/app-conversations/start-tasks?ids=<start_task_id>`
268
+
269
+ If you pass a **start_task_id** to `/download`, you will get `404 Not Found`.
270
+
271
+ ## Common agent server endpoints
272
+
273
+ These run against `agent_server_url` (not the app server):
274
+
275
+ - `POST {agent_server_url}/api/bash/execute_bash_command`
276
+ - `GET {agent_server_url}/api/file/download/<absolute_path>`
277
+ - `POST {agent_server_url}/api/file/upload/<absolute_path>` (multipart)
278
+ - `GET {agent_server_url}/api/conversations/{conversation_id}/events/search`
279
+ - `GET {agent_server_url}/api/conversations/{conversation_id}/events/count`
280
+
281
+ ### Counting events (recommended approach)
282
+
283
+ If you need to know how many events a conversation has, you can:
284
+
285
+ 1. **App server count (fastest when working)**
286
+ - `GET /api/v1/conversation/{app_conversation_id}/events/count`
287
+ 2. **Agent server count (reliable fallback)**
288
+ - `GET {agent_server_url}/api/conversations/{app_conversation_id}/events/count`
289
+ 3. **Trajectory zip fallback (heavier, but still one call + gives full payloads)**
290
+ - `GET /api/v1/app-conversations/{app_conversation_id}/download`
291
+ - Unzip and count `event_*.json` files
292
+
293
+ Do **not** rely on the last event `id` to infer the total number of events.
294
+ In the agent-server API, event IDs are UUIDs (not monotonically increasing integers).
295
+
296
+ ## Troubleshooting
297
+
298
+ For common issues and solutions, see [TROUBLESHOOTING.md](references/TROUBLESHOOTING.md).
299
+
300
+ ## Event structure (for debugging)
301
+
302
+ Events returned by:
303
+
304
+ - app server: `GET /api/v1/conversation/{id}/events/search`
305
+ - agent server: `GET {agent_server_url}/api/conversations/{id}/events/search`
306
+
307
+ …share the same high-level shape.
308
+
309
+ Each event typically includes:
310
+
311
+ - `id` (UUID)
312
+ - `timestamp`
313
+ - `kind`
314
+ - `source`
315
+
316
+ Common `kind` values:
317
+
318
+ | kind | source (typical) | key fields (common) | purpose |
319
+ |---|---|---|---|
320
+ | `ActionEvent` | `agent` | `tool_name`, `tool_call_id`, `action` | tool call requested by the agent |
321
+ | `ObservationEvent` | `environment` | `tool_name`, `tool_call_id`, `action_id`, `observation` | tool result produced by the sandbox/environment |
322
+ | `MessageEvent` | `user` / `assistant` | `message` (or similar) | user/assistant chat messages |
323
+ | `ConversationStateUpdateEvent` | `environment` | `key`, `value` | state transitions/metadata |
324
+
325
+ Linking tool calls:
326
+
327
+ - `ActionEvent.tool_call_id` == `ObservationEvent.tool_call_id`
328
+ - `ObservationEvent.action_id` == `ActionEvent.id`
329
+
330
+ Example (simplified):
331
+
332
+ ```json
333
+ {
334
+ "id": "<action-event-uuid>",
335
+ "kind": "ActionEvent",
336
+ "source": "agent",
337
+ "tool_name": "terminal",
338
+ "tool_call_id": "toolu_...",
339
+ "action": {"command": "ls"}
340
+ }
341
+ ```
342
+
343
+ ```json
344
+ {
345
+ "id": "<observation-event-uuid>",
346
+ "kind": "ObservationEvent",
347
+ "source": "environment",
348
+ "tool_name": "terminal",
349
+ "tool_call_id": "toolu_...",
350
+ "action_id": "<action-event-uuid>",
351
+ "observation": {"exit_code": 0, "stdout": "..."}
352
+ }
353
+ ```
354
+
355
+ ## Debugging one-liners (events)
356
+
357
+ These assume you're querying the **app server** endpoint. For agent-server queries, swap the URL base + use `X-Session-API-Key`.
358
+
359
+ ### Print a quick timeline
360
+
361
+ ```bash
362
+ curl -s "${BASE_URL:-https://app.all-hands.dev}/api/v1/conversation/${APP_CONVERSATION_ID}/events/search?limit=100" \
363
+ -H "Authorization: Bearer ${OPENHANDS_CLOUD_API_KEY:-$OPENHANDS_API_KEY}" \
364
+ -H "Accept: application/json" | \
365
+ python3 - <<'PY'
366
+ import json, sys
367
+ items = (json.load(sys.stdin) or {}).get("items", [])
368
+ for i, e in enumerate(items):
369
+ print(f"{i:04d} {e.get('timestamp','')} {e.get('source','')} {e.get('kind','')}")
370
+ PY
371
+ ```
372
+
373
+ ### Find error-like events
374
+
375
+ ```bash
376
+ curl -s "${BASE_URL:-https://app.all-hands.dev}/api/v1/conversation/${APP_CONVERSATION_ID}/events/search?limit=200" \
377
+ -H "Authorization: Bearer ${OPENHANDS_CLOUD_API_KEY:-$OPENHANDS_API_KEY}" \
378
+ -H "Accept: application/json" | \
379
+ python3 - <<'PY'
380
+ import json, sys
381
+ items = (json.load(sys.stdin) or {}).get("items", [])
382
+ for i, e in enumerate(items):
383
+ if e.get("kind") == "ErrorEvent" or ("code" in e and "detail" in e):
384
+ print(i, e.get("kind"), e.get("code"), str(e.get("detail", ""))[:400])
385
+ PY
386
+ ```
387
+
388
+ ### Check tool-call matching (unmatched actions / duplicate observations)
389
+
390
+ ```bash
391
+ curl -s "${BASE_URL:-https://app.all-hands.dev}/api/v1/conversation/${APP_CONVERSATION_ID}/events/search?limit=200" \
392
+ -H "Authorization: Bearer ${OPENHANDS_CLOUD_API_KEY:-$OPENHANDS_API_KEY}" \
393
+ -H "Accept: application/json" | \
394
+ python3 - <<'PY'
395
+ import json, sys
396
+ from collections import Counter
397
+ items = (json.load(sys.stdin) or {}).get("items", [])
398
+ action_ids = {e.get("id") for e in items if e.get("kind") == "ActionEvent"}
399
+ obs_action_ids = [e.get("action_id") for e in items if e.get("kind") == "ObservationEvent" and e.get("action_id")]
400
+ observed = set(obs_action_ids)
401
+ print("actions:", len(action_ids))
402
+ print("observations:", len(observed))
403
+ unmatched = action_ids - observed
404
+ print("unmatched actions:", list(unmatched)[:20] if unmatched else "none")
405
+ dups = [aid for aid, c in Counter(obs_action_ids).items() if c > 1]
406
+ print("duplicate observation action_ids:", list(dups)[:20] if dups else "none")
407
+ PY
408
+ ```
409
+
410
+
411
+ ## Quick start (Python)
412
+
413
+ ```python
414
+ # Copy `skills/openhands-api/scripts/openhands_api.py` into your project (e.g. as `openhands_api.py`),
415
+ # then import it normally:
416
+ from openhands_api import OpenHandsAPI
417
+
418
+ api = OpenHandsAPI() # prefers OPENHANDS_CLOUD_API_KEY
419
+
420
+ me = api.users_me()
421
+ print(me)
422
+
423
+ recent = api.app_conversations_search(limit=5)
424
+ print(recent)
425
+
426
+ api.close()
427
+ ```
428
+
429
+ ## CLI examples
430
+
431
+ Search conversations:
432
+
433
+ ```bash
434
+ export OPENHANDS_CLOUD_API_KEY="..."
435
+ python skills/openhands-api/scripts/openhands_api.py search-conversations --limit 5
436
+ ```
437
+
438
+ Start a conversation from a prompt file:
439
+
440
+ ```bash
441
+ python skills/openhands-api/scripts/openhands_api.py start-conversation \
442
+ --prompt-file skills/openhands-api/references/example_prompt.md \
443
+ --repo owner/repo \
444
+ --branch main
445
+ ```
446
+
447
+ ## Notes for AI agents extending this client
448
+
449
+ - Prefer `.../search` endpoints with a small `limit`.
450
+ - Avoid loops that could generate many API calls.
451
+ - Start conversations only when asked: it may create sandboxes and cost money.
452
+ - For sandbox file operations and command execution, use the agent server endpoints with `X-Session-API-Key`.
453
+
454
+ See also:
455
+ - `skills/openhands-api/scripts/openhands_api.py`
456
+ - The original inspiration client: `enyst/llm-playground` → `openhands-api-client-v1/scripts/cloud_api_v1.py`
457
+ - Troubleshooting content and real-world usage feedback → `https://github.com/jpshackelford/.openhands/tree/main/skills/openhands-cloud-api`
458
+
459
+ ## Source of truth
460
+
461
+ This skill is aligned against the current OpenHands API docs and implementation:
462
+
463
+ - `OpenHands/docs/openhands/usage/cloud/cloud-api.mdx`
464
+ - `OpenHands/docs/openhands/usage/agent-canvas/backend-setup/local.mdx`
465
+ - `OpenHands/docs/sdk/arch/agent-server.mdx`
466
+ - `OpenHands/docs/openhands/usage/api/v1.mdx`
467
+ - `OpenHands/OpenHands/openhands/app_server/v1_router.py`
468
+ - `OpenHands/OpenHands/openhands/app_server/app_conversation/app_conversation_router.py`
469
+ - `OpenHands/OpenHands/openhands/app_server/app_conversation/app_conversation_models.py`
@@ -0,0 +1,33 @@
1
+ # OpenHands Cloud API references
2
+
3
+ This skill ships a minimal client plus a short list of the most useful endpoints.
4
+
5
+ The V1 app server routes are served from the OpenHands Cloud app host:
6
+
7
+ - Base URL (default): `https://app.all-hands.dev`
8
+ - API prefix: `/api/v1`
9
+
10
+ Key concepts:
11
+
12
+ - **App server** endpoints use Bearer auth (`Authorization: Bearer <OPENHANDS_CLOUD_API_KEY>`).
13
+ - **Agent server** endpoints are served by the sandbox runtime and use session auth (`X-Session-API-Key`).
14
+
15
+ ## Official docs
16
+
17
+ - https://docs.openhands.dev/openhands/usage/cloud/cloud-api
18
+ - https://docs.openhands.dev/openhands/usage/api/v1
19
+
20
+ ## Implementation source of truth
21
+
22
+ If you need deeper, up-to-date definitions, prefer the current app-server implementation in `OpenHands/OpenHands`:
23
+
24
+ - `openhands/app_server/v1_router.py`
25
+ - `openhands/app_server/app_conversation/app_conversation_router.py`
26
+ - `openhands/app_server/app_conversation/app_conversation_models.py`
27
+
28
+ For the authored docs source, see `OpenHands/docs`:
29
+
30
+ - `openhands/usage/cloud/cloud-api.mdx`
31
+ - `openhands/usage/api/v1.mdx`
32
+
33
+ (The legacy V0 API routes still live under `openhands/server/routes/`, but new integrations should use V1.)
@@ -0,0 +1,81 @@
1
+ # Troubleshooting / Common Issues
2
+
3
+ This file documents common issues encountered when working with the OpenHands Cloud API.
4
+
5
+ ## 1. Direct ID lookup returns HTML instead of JSON
6
+
7
+ **Symptom:** Calling `GET /api/v1/app-conversations/{id}` returns HTML (the frontend app) instead of JSON.
8
+
9
+ **Cause:** In OpenHands Cloud, this URL pattern is handled by the frontend router, not the API.
10
+
11
+ **Solution:** Use the batch endpoint with the `ids` query parameter:
12
+
13
+ ```bash
14
+ # ❌ Wrong (returns HTML)
15
+ curl "${BASE_URL:-https://app.all-hands.dev}/api/v1/app-conversations/${APP_CONVERSATION_ID}" \
16
+ -H "Authorization: Bearer ${OPENHANDS_CLOUD_API_KEY:-$OPENHANDS_API_KEY}" \
17
+ -H "Accept: application/json"
18
+
19
+ # ✅ Correct (returns JSON)
20
+ curl "${BASE_URL:-https://app.all-hands.dev}/api/v1/app-conversations?ids=${APP_CONVERSATION_ID}" \
21
+ -H "Authorization: Bearer ${OPENHANDS_CLOUD_API_KEY:-$OPENHANDS_API_KEY}" \
22
+ -H "Accept: application/json"
23
+ ```
24
+
25
+ ## 2. "Service Temporarily Unavailable" when calling sandbox/agent-server endpoints
26
+
27
+ This usually means the sandbox runtime is not currently reachable.
28
+
29
+ - Check the conversation record (`GET /api/v1/app-conversations?ids=...`) for a `runtime_status`-like field.
30
+ - If the sandbox is paused, call `POST /api/v1/sandboxes/{sandbox_id}/resume`.
31
+ - If the start-task isn't `READY` yet, poll `GET /api/v1/app-conversations/start-tasks?ids=...` for a bit.
32
+
33
+ ## 3. 404s when downloading trajectory or reading events
34
+
35
+ Common causes:
36
+
37
+ - Using a **start_task_id** where an **app_conversation_id** is required (see above).
38
+ - Using the wrong event path (V1 is `/api/v1/conversation/{id}/events/...`).
39
+ - The conversation was deleted or you don't have access.
40
+
41
+ ## 4. Timing expectations (typical, varies by load)
42
+
43
+ | Operation | Typical duration |
44
+ |---|---:|
45
+ | `POST /api/v1/app-conversations` returns | < 1s |
46
+ | start-task becomes `READY` | 5–15s |
47
+ | sandbox responds to agent-server calls | usually immediately after `READY` |
48
+
49
+ **Polling guidance:** poll every 3–5 seconds with a reasonable timeout (2–3 minutes). The minimal client implements polite exponential backoff.
50
+
51
+ ## Practical Tips
52
+
53
+ - **Save responses locally for analysis** — When debugging, pipe API responses to a file:
54
+ ```bash
55
+ curl ... > response.json
56
+ # Then analyze with jq or python
57
+ ```
58
+
59
+ - **Use jq for quick filtering** — For fast event inspection:
60
+ ```bash
61
+ curl ... | jq '.items[] | select(.kind == "ErrorEvent")'
62
+ ```
63
+
64
+ - **Check runtime_status before querying events** — Always verify the sandbox is ready:
65
+ ```bash
66
+ # Get conversation to check runtime_status
67
+ GET /api/v1/app-conversations?ids=<id>
68
+ # Only query events if runtime_status shows READY
69
+ ```
70
+
71
+ - **Use trajectory zip for offline analysis** — Download the full trajectory:
72
+ ```bash
73
+ GET /api/v1/app-conversations/{id}/download
74
+ ```
75
+ Then analyze all event files locally without making multiple API calls.
76
+
77
+ - **Monitor start-task status** — When starting conversations, poll the start-task until ready before querying events or executing agent commands.
78
+
79
+ ---
80
+
81
+ *Content adapted from user feedback and real-world usage patterns.*
@@ -0,0 +1,12 @@
1
+ # Example prompt file (OpenHands Cloud API)
2
+
3
+ Replace the text below with the task you want OpenHands to perform.
4
+
5
+ ---
6
+
7
+ Please:
8
+ 1) Explain what this repository does.
9
+ 2) List the existing test/lint commands you can find.
10
+ 3) Propose the smallest possible change to address the issue described in the task.
11
+
12
+ (Do not run long loops or poll APIs. Keep external calls minimal.)
@@ -0,0 +1,44 @@
1
+ # Windows Notes for OpenHands API Commands
2
+
3
+ Use these PowerShell forms when running this skill's shell examples natively on Windows.
4
+
5
+ ## Environment Variables
6
+
7
+ ```powershell
8
+ $env:OPENHANDS_CLOUD_API_KEY = "..."
9
+ ```
10
+
11
+ ## Curl Examples
12
+
13
+ Call `curl.exe` and use PowerShell backticks for line continuation:
14
+
15
+ ```powershell
16
+ curl.exe -X POST "https://app.all-hands.dev/api/v1/app-conversations" `
17
+ -H "Authorization: Bearer $env:OPENHANDS_CLOUD_API_KEY" `
18
+ -H "Content-Type: application/json" `
19
+ -d '{
20
+ "initial_message": {
21
+ "content": [{"type": "text", "text": "Investigate flaky tests in tests/test_api.py."}]
22
+ },
23
+ "selected_repository": "owner/repo"
24
+ }'
25
+ ```
26
+
27
+ ## Python Here-doc Debugging Examples
28
+
29
+ PowerShell does not support Bash here-docs like `python3 - <<'PY'`. Save the script to a temp file and pipe the API response into it.
30
+
31
+ ```powershell
32
+ $script = Join-Path $env:TEMP "openhands-events.py"
33
+ @'
34
+ import json, sys
35
+ items = (json.load(sys.stdin) or {}).get("items", [])
36
+ for i, e in enumerate(items):
37
+ print(f"{i:04d} {e.get('timestamp','')} {e.get('source','')} {e.get('kind','')}")
38
+ '@ | Set-Content -LiteralPath $script -Encoding utf8
39
+
40
+ curl.exe -s "https://app.all-hands.dev/api/v1/conversation/$env:APP_CONVERSATION_ID/events/search?limit=100" `
41
+ -H "Authorization: Bearer $env:OPENHANDS_CLOUD_API_KEY" `
42
+ -H "Accept: application/json" |
43
+ python $script
44
+ ```