@openhands/extensions 0.1.0 → 0.2.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.
- package/.agents/skills/custom-codereview-guide.md +25 -0
- package/.github/pull_request_template.md +38 -0
- package/.github/release.yml +14 -0
- package/.github/workflows/check-extensions.yml +72 -0
- package/.github/workflows/npm-publish.yml +89 -0
- package/.github/workflows/pr.yml +30 -0
- package/.github/workflows/release.yml +24 -0
- package/.github/workflows/tests.yml +25 -0
- package/.github/workflows/vulnerability-scan.yml +87 -0
- package/.release-please-manifest.json +3 -0
- package/AGENTS.md +132 -0
- package/README.md +10 -0
- package/analysis_results.md +162 -0
- package/marketplaces/large-codebase.json +66 -0
- package/marketplaces/openhands-extensions.json +682 -0
- package/package.json +4 -10
- package/plugins/README.md +30 -0
- package/plugins/city-weather/.plugin/plugin.json +13 -0
- package/plugins/city-weather/README.md +145 -0
- package/plugins/city-weather/commands/now.md +56 -0
- package/plugins/cobol-modernization/.plugin/plugin.json +19 -0
- package/plugins/cobol-modernization/README.md +201 -0
- package/plugins/cobol-modernization/references/troubleshooting.md +18 -0
- package/plugins/cobol-modernization/skills/build-setup/SKILL.md +78 -0
- package/plugins/cobol-modernization/skills/build-setup/scripts/install-gnucobol.sh +32 -0
- package/plugins/cobol-modernization/skills/cobol-modernization-overview/SKILL.md +113 -0
- package/plugins/cobol-modernization/skills/mainfraime-removal/SKILL.md +62 -0
- package/plugins/cobol-modernization/skills/mainfraime-removal/references/cics-transformation-examples.md +45 -0
- package/plugins/cobol-modernization/skills/mainframe-planning/SKILL.md +78 -0
- package/plugins/cobol-modernization/skills/to-java-migration/SKILL.md +59 -0
- package/plugins/cobol-modernization/skills/to-java-migration/references/cobol-to-java-example.md +58 -0
- package/plugins/cobol-modernization/skills/to-java-migration/references/datatype-mappings.md +19 -0
- package/plugins/issue-duplicate-checker/.plugin/plugin.json +13 -0
- package/plugins/issue-duplicate-checker/README.md +51 -0
- package/plugins/issue-duplicate-checker/action.yml +349 -0
- package/plugins/issue-duplicate-checker/scripts/auto_close_duplicate_issues.py +569 -0
- package/plugins/issue-duplicate-checker/scripts/issue_duplicate_check_openhands.py +681 -0
- package/plugins/issue-duplicate-checker/scripts/post_duplicate_notice.js +220 -0
- package/plugins/issue-duplicate-checker/scripts/remove_duplicate_candidate_label.js +27 -0
- package/plugins/magic-test/.plugin/plugin.json +13 -0
- package/plugins/magic-test/skills/magic-word/SKILL.md +33 -0
- package/plugins/migration-scoring/.plugin/plugin.json +19 -0
- package/plugins/migration-scoring/README.md +244 -0
- package/plugins/migration-scoring/skills/migration-mapping/SKILL.md +72 -0
- package/plugins/migration-scoring/skills/migration-report/SKILL.md +118 -0
- package/plugins/migration-scoring/skills/migration-scoring-overview/SKILL.md +126 -0
- package/plugins/migration-scoring/skills/score-quality/SKILL.md +54 -0
- package/plugins/migration-scoring/skills/score-quality/references/scoring-criteria.md +30 -0
- package/plugins/migration-scoring/skills/score-style/SKILL.md +106 -0
- package/plugins/onboarding/.plugin/plugin.json +20 -0
- package/plugins/onboarding/README.md +30 -0
- package/plugins/onboarding/references/criteria.md +144 -0
- package/plugins/onboarding/skills/agent-readiness-report/README.md +23 -0
- package/plugins/onboarding/skills/agent-readiness-report/SKILL.md +122 -0
- package/plugins/onboarding/skills/agent-readiness-report/scripts/scan_agent_instructions.sh +88 -0
- package/plugins/onboarding/skills/agent-readiness-report/scripts/scan_build_env.sh +114 -0
- package/plugins/onboarding/skills/agent-readiness-report/scripts/scan_feedback_loops.sh +133 -0
- package/plugins/onboarding/skills/agent-readiness-report/scripts/scan_policy.sh +113 -0
- package/plugins/onboarding/skills/agent-readiness-report/scripts/scan_workflows.sh +127 -0
- package/plugins/onboarding/skills/improve-agent-readiness/README.md +19 -0
- package/plugins/onboarding/skills/improve-agent-readiness/SKILL.md +167 -0
- package/plugins/onboarding/skills/setup-agents-md/README.md +15 -0
- package/plugins/onboarding/skills/setup-agents-md/SKILL.md +150 -0
- package/plugins/onboarding/skills/setup-openhands/README.md +20 -0
- package/plugins/onboarding/skills/setup-openhands/SKILL.md +56 -0
- package/plugins/onboarding/skills/setup-pr-review/README.md +23 -0
- package/plugins/onboarding/skills/setup-pr-review/SKILL.md +72 -0
- package/plugins/openhands/.plugin/plugin.json +13 -0
- package/plugins/openhands/README.md +52 -0
- package/plugins/openhands/SKILL.md +61 -0
- package/plugins/openhands/commands/create.md +55 -0
- package/plugins/openhands/commands/openhands-cloud.md +8 -0
- package/plugins/openhands/scripts/run.sh +69 -0
- package/plugins/pr-review/.plugin/plugin.json +13 -0
- package/plugins/pr-review/README.md +393 -0
- package/plugins/pr-review/action.yml +298 -0
- package/plugins/pr-review/scripts/agent_script.py +1282 -0
- package/plugins/pr-review/scripts/evaluate_review.py +655 -0
- package/plugins/pr-review/scripts/prompt.py +260 -0
- package/plugins/pr-review/workflows/pr-review-by-openhands.yml +51 -0
- package/plugins/pr-review/workflows/pr-review-evaluation.yml +85 -0
- package/plugins/qa-changes/.plugin/plugin.json +11 -0
- package/plugins/qa-changes/README.md +185 -0
- package/plugins/qa-changes/action.yml +181 -0
- package/plugins/qa-changes/scripts/agent_script.py +406 -0
- package/plugins/qa-changes/scripts/evaluate_qa_changes.py +385 -0
- package/plugins/qa-changes/scripts/prompt.py +174 -0
- package/plugins/qa-changes/workflows/qa-changes-by-openhands.yml +50 -0
- package/plugins/qa-changes/workflows/qa-changes-evaluation.yml +85 -0
- package/plugins/release-notes/.plugin/plugin.json +19 -0
- package/plugins/release-notes/README.md +283 -0
- package/plugins/release-notes/SKILL.md +83 -0
- package/plugins/release-notes/action.yml +117 -0
- package/plugins/release-notes/commands/release-notes.md +8 -0
- package/plugins/release-notes/scripts/agent_script.py +292 -0
- package/plugins/release-notes/scripts/generate_release_notes.py +733 -0
- package/plugins/release-notes/scripts/prompt.py +90 -0
- package/plugins/release-notes/scripts/validate_release_notes.py +328 -0
- package/plugins/release-notes/workflows/release-notes.yml +76 -0
- package/plugins/vulnerability-remediation/.plugin/plugin.json +19 -0
- package/plugins/vulnerability-remediation/README.md +217 -0
- package/plugins/vulnerability-remediation/action.yml +187 -0
- package/plugins/vulnerability-remediation/scripts/scan_and_remediate.py +561 -0
- package/plugins/vulnerability-remediation/workflows/vulnerability-scan.yml +87 -0
- package/pyproject.toml +12 -0
- package/release-please-config.json +16 -0
- package/scripts/sync_extensions.py +494 -0
- package/scripts/sync_openhands_sdk_skill.py +264 -0
- package/skills/README.md +159 -0
- package/skills/add-javadoc/.plugin/plugin.json +18 -0
- package/skills/add-javadoc/README.md +40 -0
- package/skills/add-javadoc/SKILL.md +35 -0
- package/skills/add-javadoc/references/example.md +32 -0
- package/skills/add-skill/.plugin/plugin.json +18 -0
- package/skills/add-skill/README.md +67 -0
- package/skills/add-skill/SKILL.md +47 -0
- package/skills/add-skill/scripts/fetch_skill.py +259 -0
- package/skills/agent-creator/.plugin/plugin.json +20 -0
- package/skills/agent-creator/README.md +104 -0
- package/skills/agent-creator/SKILL.md +190 -0
- package/skills/agent-creator/commands/agent-creator.md +8 -0
- package/skills/agent-creator/references/fallback.md +117 -0
- package/skills/agent-memory/.plugin/plugin.json +18 -0
- package/skills/agent-memory/README.md +35 -0
- package/skills/agent-memory/SKILL.md +30 -0
- package/skills/agent-memory/commands/remember.md +8 -0
- package/skills/agent-sdk-builder/.plugin/plugin.json +18 -0
- package/skills/agent-sdk-builder/README.md +40 -0
- package/skills/agent-sdk-builder/SKILL.md +37 -0
- package/skills/agent-sdk-builder/commands/agent-builder.md +8 -0
- package/skills/azure-devops/.plugin/plugin.json +18 -0
- package/skills/azure-devops/README.md +55 -0
- package/skills/azure-devops/SKILL.md +50 -0
- package/skills/bitbucket/.plugin/plugin.json +17 -0
- package/skills/bitbucket/README.md +50 -0
- package/skills/bitbucket/SKILL.md +45 -0
- package/skills/code-review/.plugin/plugin.json +19 -0
- package/skills/code-review/README.md +18 -0
- package/skills/code-review/SKILL.md +208 -0
- package/skills/code-review/commands/codereview-roasted.md +8 -0
- package/skills/code-review/commands/codereview.md +8 -0
- package/skills/code-review/references/risk-evaluation.md +41 -0
- package/skills/code-review/references/supply-chain-security.md +31 -0
- package/skills/code-simplifier/.plugin/plugin.json +21 -0
- package/skills/code-simplifier/README.md +30 -0
- package/skills/code-simplifier/SKILL.md +91 -0
- package/skills/code-simplifier/commands/simplify.md +8 -0
- package/skills/code-simplifier/references/code-quality-review.md +86 -0
- package/skills/code-simplifier/references/code-reuse-review.md +63 -0
- package/skills/code-simplifier/references/efficiency-review.md +81 -0
- package/skills/datadog/.plugin/plugin.json +19 -0
- package/skills/datadog/README.md +100 -0
- package/skills/datadog/SKILL.md +95 -0
- package/skills/deno/.plugin/plugin.json +18 -0
- package/skills/deno/README.md +5 -0
- package/skills/deno/SKILL.md +99 -0
- package/skills/deno/references/README.md +6 -0
- package/skills/discord/.plugin/plugin.json +18 -0
- package/skills/discord/README.md +31 -0
- package/skills/discord/SKILL.md +109 -0
- package/skills/discord/__init__.py +0 -0
- package/skills/discord/references/REFERENCE.md +78 -0
- package/skills/discord/scripts/__init__.py +0 -0
- package/skills/discord/scripts/_http.py +127 -0
- package/skills/discord/scripts/post_webhook.py +106 -0
- package/skills/discord/scripts/send_message.py +102 -0
- package/skills/docker/.plugin/plugin.json +17 -0
- package/skills/docker/README.md +34 -0
- package/skills/docker/SKILL.md +29 -0
- package/skills/evidence-based-citations/.plugin/plugin.json +20 -0
- package/skills/evidence-based-citations/README.md +31 -0
- package/skills/evidence-based-citations/SKILL.md +59 -0
- package/skills/flarglebargle/.plugin/plugin.json +16 -0
- package/skills/flarglebargle/README.md +14 -0
- package/skills/flarglebargle/SKILL.md +9 -0
- package/skills/frontend-design/.plugin/plugin.json +21 -0
- package/skills/frontend-design/LICENSE.txt +177 -0
- package/skills/frontend-design/README.md +42 -0
- package/skills/frontend-design/SKILL.md +42 -0
- package/skills/github/.plugin/plugin.json +19 -0
- package/skills/github/README.md +42 -0
- package/skills/github/SKILL.md +106 -0
- package/skills/github-pr-review/.plugin/plugin.json +18 -0
- package/skills/github-pr-review/README.md +145 -0
- package/skills/github-pr-review/SKILL.md +148 -0
- package/skills/github-pr-review/commands/github-pr-review.md +8 -0
- package/skills/github-pr-reviewer/.plugin/plugin.json +20 -0
- package/skills/github-pr-reviewer/README.md +34 -0
- package/skills/github-pr-reviewer/SKILL.md +89 -0
- package/skills/github-pr-reviewer/commands/pr-reviewer:setup.md +8 -0
- package/skills/github-repo-monitor/.plugin/plugin.json +22 -0
- package/skills/github-repo-monitor/README.md +70 -0
- package/skills/github-repo-monitor/SKILL.md +316 -0
- package/skills/github-repo-monitor/commands/github-monitor:poll.md +8 -0
- package/skills/github-repo-monitor/references/github-api.md +241 -0
- package/skills/github-repo-monitor/references/state-schema.md +160 -0
- package/skills/github-repo-monitor/scripts/main.py +915 -0
- package/skills/github-repo-monitor/tests/test_main.py +400 -0
- package/skills/gitlab/.plugin/plugin.json +17 -0
- package/skills/gitlab/README.md +37 -0
- package/skills/gitlab/SKILL.md +32 -0
- package/skills/incident-retrospective/.plugin/plugin.json +21 -0
- package/skills/incident-retrospective/README.md +34 -0
- package/skills/incident-retrospective/SKILL.md +98 -0
- package/skills/incident-retrospective/commands/incident-retro:setup.md +8 -0
- package/skills/iterate/.plugin/plugin.json +13 -0
- package/skills/iterate/README.md +25 -0
- package/skills/iterate/SKILL.md +399 -0
- package/skills/iterate/commands/babysit.md +8 -0
- package/skills/iterate/commands/iterate.md +8 -0
- package/skills/iterate/commands/verify.md +8 -0
- package/skills/iterate/references/heuristics.md +58 -0
- package/skills/iterate/references/verification.md +96 -0
- package/skills/jupyter/.plugin/plugin.json +18 -0
- package/skills/jupyter/README.md +55 -0
- package/skills/jupyter/SKILL.md +50 -0
- package/skills/kubernetes/.plugin/plugin.json +18 -0
- package/skills/kubernetes/README.md +53 -0
- package/skills/kubernetes/SKILL.md +48 -0
- package/skills/learn-from-code-review/.plugin/plugin.json +19 -0
- package/skills/learn-from-code-review/README.md +64 -0
- package/skills/learn-from-code-review/SKILL.md +186 -0
- package/skills/learn-from-code-review/commands/learn-from-reviews.md +8 -0
- package/skills/linear/.plugin/plugin.json +19 -0
- package/skills/linear/README.md +58 -0
- package/skills/linear/SKILL.md +213 -0
- package/skills/linear-triage/.plugin/plugin.json +21 -0
- package/skills/linear-triage/README.md +34 -0
- package/skills/linear-triage/SKILL.md +91 -0
- package/skills/linear-triage/commands/linear-triage:setup.md +8 -0
- package/skills/notion/.plugin/plugin.json +17 -0
- package/skills/notion/README.md +114 -0
- package/skills/notion/SKILL.md +109 -0
- package/skills/npm/.plugin/plugin.json +17 -0
- package/skills/npm/README.md +14 -0
- package/skills/npm/SKILL.md +9 -0
- package/skills/openhands-api/.plugin/plugin.json +22 -0
- package/skills/openhands-api/README.md +48 -0
- package/skills/openhands-api/SKILL.md +399 -0
- package/skills/openhands-api/references/README.md +33 -0
- package/skills/openhands-api/references/TROUBLESHOOTING.md +81 -0
- package/skills/openhands-api/references/example_prompt.md +12 -0
- package/skills/openhands-api/scripts/openhands_api.py +606 -0
- package/skills/openhands-api/scripts/openhands_api.ts +252 -0
- package/skills/openhands-automation/.plugin/plugin.json +19 -0
- package/skills/openhands-automation/README.md +89 -0
- package/skills/openhands-automation/SKILL.md +875 -0
- package/skills/openhands-automation/commands/automation:create.md +8 -0
- package/skills/openhands-automation/references/ab-testing.md +185 -0
- package/skills/openhands-automation/references/custom-automation.md +644 -0
- package/skills/openhands-sdk/.plugin/plugin.json +20 -0
- package/skills/openhands-sdk/README.md +22 -0
- package/skills/openhands-sdk/SKILL.md +229 -0
- package/skills/openhands-sdk/commands/sdk.md +8 -0
- package/skills/pdflatex/.plugin/plugin.json +18 -0
- package/skills/pdflatex/README.md +39 -0
- package/skills/pdflatex/SKILL.md +34 -0
- package/skills/prd/.plugin/plugin.json +19 -0
- package/skills/prd/README.md +28 -0
- package/skills/prd/SKILL.md +237 -0
- package/skills/prd/commands/prd.md +8 -0
- package/skills/qa-changes/README.md +18 -0
- package/skills/qa-changes/SKILL.md +229 -0
- package/skills/qa-changes/commands/qa-changes.md +8 -0
- package/skills/release-notes/README.md +24 -0
- package/skills/release-notes/SKILL.md +19 -0
- package/skills/release-notes/commands/release-notes.md +8 -0
- package/skills/research-brief/.plugin/plugin.json +20 -0
- package/skills/research-brief/README.md +34 -0
- package/skills/research-brief/SKILL.md +99 -0
- package/skills/research-brief/commands/research-brief:setup.md +8 -0
- package/skills/security/.plugin/plugin.json +18 -0
- package/skills/security/README.md +38 -0
- package/skills/security/SKILL.md +33 -0
- package/skills/skill-creator/.plugin/plugin.json +17 -0
- package/skills/skill-creator/LICENSE.txt +202 -0
- package/skills/skill-creator/README.md +182 -0
- package/skills/skill-creator/SKILL.md +545 -0
- package/skills/skill-creator/references/output-patterns.md +82 -0
- package/skills/skill-creator/references/workflows.md +28 -0
- package/skills/skill-creator/scripts/init_skill.py +303 -0
- package/skills/skill-creator/scripts/quick_validate.py +95 -0
- package/skills/slack-channel-monitor/.plugin/plugin.json +21 -0
- package/skills/slack-channel-monitor/README.md +91 -0
- package/skills/slack-channel-monitor/SKILL.md +276 -0
- package/skills/slack-channel-monitor/commands/slack-monitor:poll.md +8 -0
- package/skills/slack-channel-monitor/references/slack-api.md +207 -0
- package/skills/slack-channel-monitor/references/state-schema.md +180 -0
- package/skills/slack-channel-monitor/scripts/main.py +962 -0
- package/skills/slack-standup-digest/.plugin/plugin.json +21 -0
- package/skills/slack-standup-digest/README.md +34 -0
- package/skills/slack-standup-digest/SKILL.md +92 -0
- package/skills/slack-standup-digest/commands/standup-digest:setup.md +8 -0
- package/skills/spark-version-upgrade/.plugin/plugin.json +20 -0
- package/skills/spark-version-upgrade/README.md +54 -0
- package/skills/spark-version-upgrade/SKILL.md +233 -0
- package/skills/ssh/.plugin/plugin.json +18 -0
- package/skills/ssh/README.md +140 -0
- package/skills/ssh/SKILL.md +135 -0
- package/skills/swift-linux/.plugin/plugin.json +17 -0
- package/skills/swift-linux/README.md +86 -0
- package/skills/swift-linux/SKILL.md +81 -0
- package/skills/theme-factory/.plugin/plugin.json +19 -0
- package/skills/theme-factory/LICENSE.txt +202 -0
- package/skills/theme-factory/README.md +58 -0
- package/skills/theme-factory/SKILL.md +59 -0
- package/skills/theme-factory/theme-showcase.pdf +0 -0
- package/skills/theme-factory/themes/arctic-frost.md +19 -0
- package/skills/theme-factory/themes/botanical-garden.md +19 -0
- package/skills/theme-factory/themes/desert-rose.md +19 -0
- package/skills/theme-factory/themes/forest-canopy.md +19 -0
- package/skills/theme-factory/themes/golden-hour.md +19 -0
- package/skills/theme-factory/themes/midnight-galaxy.md +19 -0
- package/skills/theme-factory/themes/modern-minimalist.md +19 -0
- package/skills/theme-factory/themes/ocean-depths.md +19 -0
- package/skills/theme-factory/themes/sunset-boulevard.md +19 -0
- package/skills/theme-factory/themes/tech-innovation.md +19 -0
- package/skills/uv/.plugin/plugin.json +18 -0
- package/skills/uv/README.md +5 -0
- package/skills/uv/SKILL.md +95 -0
- package/skills/uv/references/README.md +5 -0
- package/skills/vercel/.plugin/plugin.json +18 -0
- package/skills/vercel/README.md +108 -0
- package/skills/vercel/SKILL.md +103 -0
- package/tests/test_add_skill_installs_to_agents_dir.py +42 -0
- package/tests/test_catalogs.py +109 -0
- package/tests/test_code_review_risk_evaluation.py +94 -0
- package/tests/test_issue_duplicate_checker.py +240 -0
- package/tests/test_openhands_api_python.py +152 -0
- package/tests/test_plugin_manifest.py +83 -0
- package/tests/test_pr_review_diff_payload.py +202 -0
- package/tests/test_pr_review_feedback.py +263 -0
- package/tests/test_pr_review_prompt.py +152 -0
- package/tests/test_pr_review_review_context.py +253 -0
- package/tests/test_qa_changes.py +232 -0
- package/tests/test_qa_changes_evaluation.py +259 -0
- package/tests/test_release_notes_generator.py +990 -0
- package/tests/test_sdk_loading.py +150 -0
- package/tests/test_skill_plugin_loading.py +149 -0
- package/tests/test_skills_have_readme.py +66 -0
- package/tests/test_sync_extensions.py +292 -0
- package/tests/test_workflow_sync.py +46 -0
- package/utils/analysis/README.md +7 -0
- package/utils/analysis/laminar_signals/README.md +211 -0
- package/utils/analysis/laminar_signals/analyze.py +780 -0
- package/utils/analysis/laminar_signals/templates/default.j2 +49 -0
- package/utils/analysis/laminar_signals/templates/pr_review.j2 +61 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# openhands-api
|
|
2
|
+
|
|
3
|
+
Reference skill + minimal clients for the **OpenHands Cloud API** (V1).
|
|
4
|
+
|
|
5
|
+
This skill now also covers the **multi-conversation delegation pattern**: start additional Cloud conversations when you want fresh context windows, background work, or parallel tasks.
|
|
6
|
+
|
|
7
|
+
- Skill instructions and endpoint overview: [`SKILL.md`](./SKILL.md)
|
|
8
|
+
- Minimal Python client: [`scripts/openhands_api.py`](./scripts/openhands_api.py)
|
|
9
|
+
- Minimal TypeScript client: [`scripts/openhands_api.ts`](./scripts/openhands_api.ts)
|
|
10
|
+
- References: [`references/README.md`](./references/README.md)
|
|
11
|
+
|
|
12
|
+
## Quick start
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
export OPENHANDS_CLOUD_API_KEY="..."
|
|
16
|
+
python skills/openhands-api/scripts/openhands_api.py search-conversations --limit 5
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The Python client prefers `OPENHANDS_CLOUD_API_KEY` and falls back to `OPENHANDS_API_KEY`.
|
|
20
|
+
|
|
21
|
+
## Delegating work with new Cloud conversations
|
|
22
|
+
|
|
23
|
+
Use `POST /api/v1/app-conversations` to create a separate OpenHands Cloud conversation for a self-contained task, then poll `GET /api/v1/app-conversations/start-tasks?ids=...` until you have an `app_conversation_id`.
|
|
24
|
+
|
|
25
|
+
Keep delegated prompts self-contained: include the repository, branch, relevant files, constraints, and expected output. Prefer five or fewer concurrently running delegated conversations.
|
|
26
|
+
|
|
27
|
+
## Start-task vs app conversation id
|
|
28
|
+
|
|
29
|
+
In many deployments, `POST /api/v1/app-conversations` returns a **start-task** object.
|
|
30
|
+
|
|
31
|
+
- `id` is the **start_task_id**
|
|
32
|
+
- `app_conversation_id` is what you should use for `/download` and `/conversation/.../events/...`
|
|
33
|
+
|
|
34
|
+
If `app_conversation_id` is missing from the initial response, fetch it via:
|
|
35
|
+
|
|
36
|
+
- `GET /api/v1/app-conversations/start-tasks?ids=<start_task_id>`
|
|
37
|
+
|
|
38
|
+
(If you accidentally use a start-task id with `/download`, you’ll get `404 Not Found`.)
|
|
39
|
+
|
|
40
|
+
## Source of truth
|
|
41
|
+
|
|
42
|
+
This skill is aligned against:
|
|
43
|
+
|
|
44
|
+
- `OpenHands/docs/openhands/usage/cloud/cloud-api.mdx`
|
|
45
|
+
- `OpenHands/docs/openhands/usage/api/v1.mdx`
|
|
46
|
+
- `OpenHands/OpenHands/openhands/app_server/v1_router.py`
|
|
47
|
+
- `OpenHands/OpenHands/openhands/app_server/app_conversation/app_conversation_router.py`
|
|
48
|
+
- `OpenHands/OpenHands/openhands/app_server/app_conversation/app_conversation_models.py`
|
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: openhands-api
|
|
3
|
+
description: Reference skill for the OpenHands Cloud REST API (V1), including how to start additional cloud conversations for fresh-context or delegated work. Use when you need to automate common OpenHands Cloud actions; don't use for general sandbox/dev tasks unrelated to the OpenHands API.
|
|
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) and provides small, easy-to-copy clients.
|
|
14
|
+
|
|
15
|
+
It is intentionally focused on common OpenHands Cloud workflows:
|
|
16
|
+
|
|
17
|
+
- Defaults to OpenHands Cloud (`https://app.all-hands.dev`).
|
|
18
|
+
- Targets the **V1 app server REST API** under `/api/v1/...`.
|
|
19
|
+
- Includes a few **agent server** endpoints (inside a sandbox) that use `X-Session-API-Key`.
|
|
20
|
+
- Covers the **multi-conversation delegation pattern**: start separate Cloud conversations when you want fresh context windows or background work.
|
|
21
|
+
|
|
22
|
+
## When to use this skill
|
|
23
|
+
|
|
24
|
+
Use this skill when you need to:
|
|
25
|
+
|
|
26
|
+
- start or inspect OpenHands Cloud conversations from code
|
|
27
|
+
- monitor async startup via start-task polling
|
|
28
|
+
- monitor execution status for long-running jobs
|
|
29
|
+
- create separate Cloud conversations for parallel or background work
|
|
30
|
+
- access sandbox agent-server endpoints once a conversation is running
|
|
31
|
+
|
|
32
|
+
## Auth
|
|
33
|
+
|
|
34
|
+
### App server (Cloud)
|
|
35
|
+
|
|
36
|
+
Use Bearer auth:
|
|
37
|
+
|
|
38
|
+
- Header: `Authorization: Bearer <OPENHANDS_CLOUD_API_KEY>`
|
|
39
|
+
- Preferred env var: `OPENHANDS_CLOUD_API_KEY`
|
|
40
|
+
- Backward-compatible env var: `OPENHANDS_API_KEY`
|
|
41
|
+
|
|
42
|
+
### Agent server (inside a sandbox)
|
|
43
|
+
|
|
44
|
+
Use session auth:
|
|
45
|
+
|
|
46
|
+
- Header: `X-Session-API-Key: <session_api_key>`
|
|
47
|
+
|
|
48
|
+
How to obtain `agent_server_url` and `session_api_key`:
|
|
49
|
+
|
|
50
|
+
1. Start or fetch an app conversation via the app server (Bearer auth), e.g.:
|
|
51
|
+
- `POST /api/v1/app-conversations`
|
|
52
|
+
- or `GET /api/v1/app-conversations?ids=<conversation_id>`
|
|
53
|
+
2. In the returned JSON, look for sandbox/runtime connection fields (names vary slightly by deployment/version). Common patterns:
|
|
54
|
+
- a sandbox object containing `agent_server_url` (or similar)
|
|
55
|
+
- a session key such as `session_api_key` (or similar)
|
|
56
|
+
3. Use those values to call the agent server directly:
|
|
57
|
+
- Base: `{agent_server_url}/api/...`
|
|
58
|
+
- Header: `X-Session-API-Key: <session_api_key>`
|
|
59
|
+
|
|
60
|
+
Example (common field names; adjust to your deployment):
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
# using the minimal Python client (`OpenHandsAPI`)
|
|
64
|
+
conv = api.app_conversation_get(app_conversation_id)
|
|
65
|
+
|
|
66
|
+
session_api_key = conv.get("session_api_key")
|
|
67
|
+
conversation_url = conv.get("conversation_url", "")
|
|
68
|
+
|
|
69
|
+
# `conversation_url` often looks like: https://<runtime-host>/api/conversations/<id>
|
|
70
|
+
agent_server_url = conversation_url.rsplit("/api/conversations", 1)[0]
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
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.
|
|
75
|
+
|
|
76
|
+
## Common V1 app server endpoints
|
|
77
|
+
|
|
78
|
+
The following are the main endpoints implemented in the minimal client:
|
|
79
|
+
|
|
80
|
+
- `GET /api/v1/users/me` — validate auth and inspect current account
|
|
81
|
+
- `GET /api/v1/app-conversations/search?limit=...` — list recent conversations
|
|
82
|
+
- `GET /api/v1/app-conversations?ids=...` — fetch conversation records by id (batch)
|
|
83
|
+
- `GET /api/v1/app-conversations/count` — count conversations
|
|
84
|
+
- `POST /api/v1/app-conversations` — start a new conversation (creates a sandbox)
|
|
85
|
+
- `GET /api/v1/app-conversations/start-tasks?ids=...` — check async start-task status
|
|
86
|
+
- `GET /api/v1/conversation/{app_conversation_id}/events/search?limit=...` — read conversation events
|
|
87
|
+
- `GET /api/v1/conversation/{app_conversation_id}/events/count` — count events
|
|
88
|
+
- `GET /api/v1/sandboxes/search?limit=...` — list sandboxes
|
|
89
|
+
- `POST /api/v1/sandboxes/{sandbox_id}/pause` / `.../resume` — manage sandbox lifecycle
|
|
90
|
+
- `GET /api/v1/app-conversations/{app_conversation_id}/download` — download trajectory zip
|
|
91
|
+
|
|
92
|
+
## Delegating work with additional Cloud conversations
|
|
93
|
+
|
|
94
|
+
Use the Cloud API when you want a **separate OpenHands conversation** with its own fresh context window.
|
|
95
|
+
This is useful for:
|
|
96
|
+
|
|
97
|
+
- background jobs that can run independently
|
|
98
|
+
- parallel investigations or implementation tasks
|
|
99
|
+
- long-running work where you want to keep the current conversation focused
|
|
100
|
+
- task-specific contexts, such as one conversation building a component while another runs tests
|
|
101
|
+
|
|
102
|
+
### Delegation checklist
|
|
103
|
+
|
|
104
|
+
When you start a delegated Cloud conversation:
|
|
105
|
+
|
|
106
|
+
1. Write a **self-contained task description**. Do not assume the new conversation has any context from the current one.
|
|
107
|
+
2. Include the **repository**, branch, relevant file paths, constraints, and expected output.
|
|
108
|
+
3. Start the new conversation with `POST /api/v1/app-conversations`.
|
|
109
|
+
4. Poll the start-task until `status` is `READY` and you have an `app_conversation_id`.
|
|
110
|
+
5. Monitor the delegated conversation via `GET /api/v1/app-conversations?ids=...`.
|
|
111
|
+
6. Share or store the Cloud URL: `https://app.all-hands.dev/conversations/<app_conversation_id>`.
|
|
112
|
+
|
|
113
|
+
### Minimal cURL flow
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
curl -X POST "https://app.all-hands.dev/api/v1/app-conversations" \
|
|
117
|
+
-H "Authorization: Bearer ${OPENHANDS_CLOUD_API_KEY}" \
|
|
118
|
+
-H "Content-Type: application/json" \
|
|
119
|
+
-d '{
|
|
120
|
+
"initial_message": {
|
|
121
|
+
"content": [{"type": "text", "text": "Investigate flaky tests in tests/test_api.py. Report the root cause and propose a fix."}]
|
|
122
|
+
},
|
|
123
|
+
"selected_repository": "owner/repo"
|
|
124
|
+
}'
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
If the response does not already include `app_conversation_id`, poll the start-task:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
curl -s "https://app.all-hands.dev/api/v1/app-conversations/start-tasks?ids=${START_TASK_ID}" \
|
|
131
|
+
-H "Authorization: Bearer ${OPENHANDS_CLOUD_API_KEY}"
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Then check execution status:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
curl -s "https://app.all-hands.dev/api/v1/app-conversations?ids=${APP_CONVERSATION_ID}" \
|
|
138
|
+
-H "Authorization: Bearer ${OPENHANDS_CLOUD_API_KEY}"
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Minimal Python flow
|
|
142
|
+
|
|
143
|
+
```python
|
|
144
|
+
from openhands_api import OpenHandsAPI
|
|
145
|
+
|
|
146
|
+
api = OpenHandsAPI() # prefers OPENHANDS_CLOUD_API_KEY
|
|
147
|
+
|
|
148
|
+
start = api.app_conversation_start(
|
|
149
|
+
initial_message=(
|
|
150
|
+
"Implement the requested dashboard component in src/dashboard.tsx. "
|
|
151
|
+
"Update any related tests and summarize the changes."
|
|
152
|
+
),
|
|
153
|
+
selected_repository="owner/repo",
|
|
154
|
+
selected_branch="main",
|
|
155
|
+
title="Dashboard component task",
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
ready = start
|
|
159
|
+
if not ready.get("app_conversation_id"):
|
|
160
|
+
ready = api.poll_start_task_until_ready(start["id"])
|
|
161
|
+
|
|
162
|
+
conversation_id = ready["app_conversation_id"]
|
|
163
|
+
print(f"Delegated conversation: {api.base_url}/conversations/{conversation_id}")
|
|
164
|
+
|
|
165
|
+
status = api.app_conversation_get(conversation_id)
|
|
166
|
+
print(status.get("sandbox_status"), status.get("execution_status"))
|
|
167
|
+
|
|
168
|
+
api.close()
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Parallelism guidance
|
|
172
|
+
|
|
173
|
+
- Prefer **5 or fewer** concurrently running delegated conversations.
|
|
174
|
+
- Before starting more, check recent conversations and count how many are still `execution_status == "running"`.
|
|
175
|
+
- Batch specific conversation lookups with `GET /api/v1/app-conversations?ids=...` when you already know their ids.
|
|
176
|
+
|
|
177
|
+
Example:
|
|
178
|
+
|
|
179
|
+
```python
|
|
180
|
+
items = api.app_conversations_search(limit=50).get("items", [])
|
|
181
|
+
running = [item for item in items if item.get("execution_status") == "running"]
|
|
182
|
+
if len(running) >= 5:
|
|
183
|
+
print("Wait for some delegated conversations to finish before starting more.")
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
### Start-task vs `app_conversation_id` (common pitfall)
|
|
188
|
+
|
|
189
|
+
In many deployments, `POST /api/v1/app-conversations` is **asynchronous** and returns a **start-task** object:
|
|
190
|
+
|
|
191
|
+
- `id` is the **start_task_id**
|
|
192
|
+
- `app_conversation_id` is the id you should use for conversation operations like:
|
|
193
|
+
- `GET /api/v1/app-conversations/{app_conversation_id}/download`
|
|
194
|
+
- `GET /api/v1/conversation/{app_conversation_id}/events/...`
|
|
195
|
+
|
|
196
|
+
If `app_conversation_id` is not present in the initial response, fetch it via:
|
|
197
|
+
|
|
198
|
+
- `GET /api/v1/app-conversations/start-tasks?ids=<start_task_id>`
|
|
199
|
+
|
|
200
|
+
If you pass a **start_task_id** to `/download`, you will get `404 Not Found`.
|
|
201
|
+
|
|
202
|
+
## Common agent server endpoints
|
|
203
|
+
|
|
204
|
+
These run against `agent_server_url` (not the app server):
|
|
205
|
+
|
|
206
|
+
- `POST {agent_server_url}/api/bash/execute_bash_command`
|
|
207
|
+
- `GET {agent_server_url}/api/file/download/<absolute_path>`
|
|
208
|
+
- `POST {agent_server_url}/api/file/upload/<absolute_path>` (multipart)
|
|
209
|
+
- `GET {agent_server_url}/api/conversations/{conversation_id}/events/search`
|
|
210
|
+
- `GET {agent_server_url}/api/conversations/{conversation_id}/events/count`
|
|
211
|
+
|
|
212
|
+
### Counting events (recommended approach)
|
|
213
|
+
|
|
214
|
+
If you need to know how many events a conversation has, you can:
|
|
215
|
+
|
|
216
|
+
1. **App server count (fastest when working)**
|
|
217
|
+
- `GET /api/v1/conversation/{app_conversation_id}/events/count`
|
|
218
|
+
2. **Agent server count (reliable fallback)**
|
|
219
|
+
- `GET {agent_server_url}/api/conversations/{app_conversation_id}/events/count`
|
|
220
|
+
3. **Trajectory zip fallback (heavier, but still one call + gives full payloads)**
|
|
221
|
+
- `GET /api/v1/app-conversations/{app_conversation_id}/download`
|
|
222
|
+
- Unzip and count `event_*.json` files
|
|
223
|
+
|
|
224
|
+
Do **not** rely on the last event `id` to infer the total number of events.
|
|
225
|
+
In the agent-server API, event IDs are UUIDs (not monotonically increasing integers).
|
|
226
|
+
|
|
227
|
+
## Troubleshooting
|
|
228
|
+
|
|
229
|
+
For common issues and solutions, see [TROUBLESHOOTING.md](references/TROUBLESHOOTING.md).
|
|
230
|
+
|
|
231
|
+
## Event structure (for debugging)
|
|
232
|
+
|
|
233
|
+
Events returned by:
|
|
234
|
+
|
|
235
|
+
- app server: `GET /api/v1/conversation/{id}/events/search`
|
|
236
|
+
- agent server: `GET {agent_server_url}/api/conversations/{id}/events/search`
|
|
237
|
+
|
|
238
|
+
…share the same high-level shape.
|
|
239
|
+
|
|
240
|
+
Each event typically includes:
|
|
241
|
+
|
|
242
|
+
- `id` (UUID)
|
|
243
|
+
- `timestamp`
|
|
244
|
+
- `kind`
|
|
245
|
+
- `source`
|
|
246
|
+
|
|
247
|
+
Common `kind` values:
|
|
248
|
+
|
|
249
|
+
| kind | source (typical) | key fields (common) | purpose |
|
|
250
|
+
|---|---|---|---|
|
|
251
|
+
| `ActionEvent` | `agent` | `tool_name`, `tool_call_id`, `action` | tool call requested by the agent |
|
|
252
|
+
| `ObservationEvent` | `environment` | `tool_name`, `tool_call_id`, `action_id`, `observation` | tool result produced by the sandbox/environment |
|
|
253
|
+
| `MessageEvent` | `user` / `assistant` | `message` (or similar) | user/assistant chat messages |
|
|
254
|
+
| `ConversationStateUpdateEvent` | `environment` | `key`, `value` | state transitions/metadata |
|
|
255
|
+
|
|
256
|
+
Linking tool calls:
|
|
257
|
+
|
|
258
|
+
- `ActionEvent.tool_call_id` == `ObservationEvent.tool_call_id`
|
|
259
|
+
- `ObservationEvent.action_id` == `ActionEvent.id`
|
|
260
|
+
|
|
261
|
+
Example (simplified):
|
|
262
|
+
|
|
263
|
+
```json
|
|
264
|
+
{
|
|
265
|
+
"id": "<action-event-uuid>",
|
|
266
|
+
"kind": "ActionEvent",
|
|
267
|
+
"source": "agent",
|
|
268
|
+
"tool_name": "terminal",
|
|
269
|
+
"tool_call_id": "toolu_...",
|
|
270
|
+
"action": {"command": "ls"}
|
|
271
|
+
}
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
```json
|
|
275
|
+
{
|
|
276
|
+
"id": "<observation-event-uuid>",
|
|
277
|
+
"kind": "ObservationEvent",
|
|
278
|
+
"source": "environment",
|
|
279
|
+
"tool_name": "terminal",
|
|
280
|
+
"tool_call_id": "toolu_...",
|
|
281
|
+
"action_id": "<action-event-uuid>",
|
|
282
|
+
"observation": {"exit_code": 0, "stdout": "..."}
|
|
283
|
+
}
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
## Debugging one-liners (events)
|
|
287
|
+
|
|
288
|
+
These assume you're querying the **app server** endpoint. For agent-server queries, swap the URL base + use `X-Session-API-Key`.
|
|
289
|
+
|
|
290
|
+
### Print a quick timeline
|
|
291
|
+
|
|
292
|
+
```bash
|
|
293
|
+
curl -s "${BASE_URL:-https://app.all-hands.dev}/api/v1/conversation/${APP_CONVERSATION_ID}/events/search?limit=100" \
|
|
294
|
+
-H "Authorization: Bearer ${OPENHANDS_CLOUD_API_KEY:-$OPENHANDS_API_KEY}" \
|
|
295
|
+
-H "Accept: application/json" | \
|
|
296
|
+
python3 - <<'PY'
|
|
297
|
+
import json, sys
|
|
298
|
+
items = (json.load(sys.stdin) or {}).get("items", [])
|
|
299
|
+
for i, e in enumerate(items):
|
|
300
|
+
print(f"{i:04d} {e.get('timestamp','')} {e.get('source','')} {e.get('kind','')}")
|
|
301
|
+
PY
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### Find error-like events
|
|
305
|
+
|
|
306
|
+
```bash
|
|
307
|
+
curl -s "${BASE_URL:-https://app.all-hands.dev}/api/v1/conversation/${APP_CONVERSATION_ID}/events/search?limit=200" \
|
|
308
|
+
-H "Authorization: Bearer ${OPENHANDS_CLOUD_API_KEY:-$OPENHANDS_API_KEY}" \
|
|
309
|
+
-H "Accept: application/json" | \
|
|
310
|
+
python3 - <<'PY'
|
|
311
|
+
import json, sys
|
|
312
|
+
items = (json.load(sys.stdin) or {}).get("items", [])
|
|
313
|
+
for i, e in enumerate(items):
|
|
314
|
+
if e.get("kind") == "ErrorEvent" or ("code" in e and "detail" in e):
|
|
315
|
+
print(i, e.get("kind"), e.get("code"), str(e.get("detail", ""))[:400])
|
|
316
|
+
PY
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### Check tool-call matching (unmatched actions / duplicate observations)
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
curl -s "${BASE_URL:-https://app.all-hands.dev}/api/v1/conversation/${APP_CONVERSATION_ID}/events/search?limit=200" \
|
|
323
|
+
-H "Authorization: Bearer ${OPENHANDS_CLOUD_API_KEY:-$OPENHANDS_API_KEY}" \
|
|
324
|
+
-H "Accept: application/json" | \
|
|
325
|
+
python3 - <<'PY'
|
|
326
|
+
import json, sys
|
|
327
|
+
from collections import Counter
|
|
328
|
+
items = (json.load(sys.stdin) or {}).get("items", [])
|
|
329
|
+
action_ids = {e.get("id") for e in items if e.get("kind") == "ActionEvent"}
|
|
330
|
+
obs_action_ids = [e.get("action_id") for e in items if e.get("kind") == "ObservationEvent" and e.get("action_id")]
|
|
331
|
+
observed = set(obs_action_ids)
|
|
332
|
+
print("actions:", len(action_ids))
|
|
333
|
+
print("observations:", len(observed))
|
|
334
|
+
unmatched = action_ids - observed
|
|
335
|
+
print("unmatched actions:", list(unmatched)[:20] if unmatched else "none")
|
|
336
|
+
dups = [aid for aid, c in Counter(obs_action_ids).items() if c > 1]
|
|
337
|
+
print("duplicate observation action_ids:", list(dups)[:20] if dups else "none")
|
|
338
|
+
PY
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
## Quick start (Python)
|
|
343
|
+
|
|
344
|
+
```python
|
|
345
|
+
# Copy `skills/openhands-api/scripts/openhands_api.py` into your project (e.g. as `openhands_api.py`),
|
|
346
|
+
# then import it normally:
|
|
347
|
+
from openhands_api import OpenHandsAPI
|
|
348
|
+
|
|
349
|
+
api = OpenHandsAPI() # prefers OPENHANDS_CLOUD_API_KEY
|
|
350
|
+
|
|
351
|
+
me = api.users_me()
|
|
352
|
+
print(me)
|
|
353
|
+
|
|
354
|
+
recent = api.app_conversations_search(limit=5)
|
|
355
|
+
print(recent)
|
|
356
|
+
|
|
357
|
+
api.close()
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
## CLI examples
|
|
361
|
+
|
|
362
|
+
Search conversations:
|
|
363
|
+
|
|
364
|
+
```bash
|
|
365
|
+
export OPENHANDS_CLOUD_API_KEY="..."
|
|
366
|
+
python skills/openhands-api/scripts/openhands_api.py search-conversations --limit 5
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
Start a conversation from a prompt file:
|
|
370
|
+
|
|
371
|
+
```bash
|
|
372
|
+
python skills/openhands-api/scripts/openhands_api.py start-conversation \
|
|
373
|
+
--prompt-file skills/openhands-api/references/example_prompt.md \
|
|
374
|
+
--repo owner/repo \
|
|
375
|
+
--branch main
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
## Notes for AI agents extending this client
|
|
379
|
+
|
|
380
|
+
- Prefer `.../search` endpoints with a small `limit`.
|
|
381
|
+
- Avoid loops that could generate many API calls.
|
|
382
|
+
- Start conversations only when asked: it may create sandboxes and cost money.
|
|
383
|
+
- For sandbox file operations and command execution, use the agent server endpoints with `X-Session-API-Key`.
|
|
384
|
+
|
|
385
|
+
See also:
|
|
386
|
+
- `skills/openhands-api/scripts/openhands_api.py`
|
|
387
|
+
- The original inspiration client: `enyst/llm-playground` → `openhands-api-client-v1/scripts/cloud_api_v1.py`
|
|
388
|
+
- Troubleshooting content and real-world usage feedback → `https://github.com/jpshackelford/.openhands/tree/main/skills/openhands-cloud-api`
|
|
389
|
+
|
|
390
|
+
## Source of truth
|
|
391
|
+
|
|
392
|
+
This skill is aligned against the current V1 docs and implementation:
|
|
393
|
+
|
|
394
|
+
- `OpenHands/docs/openhands/usage/cloud/cloud-api.mdx`
|
|
395
|
+
- `OpenHands/docs/openhands/usage/api/v1.mdx`
|
|
396
|
+
- `OpenHands/OpenHands/openhands/app_server/v1_router.py`
|
|
397
|
+
- `OpenHands/OpenHands/openhands/app_server/app_conversation/app_conversation_router.py`
|
|
398
|
+
- `OpenHands/OpenHands/openhands/app_server/app_conversation/app_conversation_models.py`
|
|
399
|
+
|
|
@@ -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.)
|