Add Narrative-First V0 to V1 Migration Guide (Alternative to #362)#363
Add Narrative-First V0 to V1 Migration Guide (Alternative to #362)#363jpshackelford wants to merge 5 commits intomainfrom
Conversation
This alternative approach restructures the migration guide to lead with a step-by-step narrative walkthrough, with reference tables moved to the end for lookup purposes. Structure: 1. Overview (brief architecture change + benefits accordion) 2. Migration Walkthrough (6 steps with V0→V1 examples) - Step 1: Create and Start a Conversation - Step 2: Track Conversation Startup - Step 3: Work with Events and Messages - Step 4: Manage Sandbox Lifecycle - Step 5: Access the Agent Server - Step 6: Handle Files and Workspace 3. Quick Reference: Endpoint Mapping (tables) 4. Agent Server API Reference 5. Known Gaps and Workarounds 6. Authentication Summary 7. Additional Resources Based on feedback from OpenHands/OpenHands#12578. Co-authored-by: openhands <openhands@all-hands.dev>
- Add link to App Server OpenAPI spec (openapi.json) in Additional Resources - Add new section explaining how to access Agent Server Swagger docs and OpenAPI spec - Includes step-by-step instructions for getting Agent Server URL from sandbox Co-authored-by: openhands <openhands@all-hands.dev>
… REST - Added note highlighting that V1's REST endpoint on Agent Server is a big improvement over V0's WebSocket requirement - Updated Step 3 examples to show Socket.IO code for V0 vs simple curl for V1 - Corrected V1 endpoint to use Agent Server URL with X-Session-API-Key - Added 'run: true' option explanation for auto-starting agent loop - Updated Quick Reference table to reflect WebSocket vs REST difference
- Document V0 trajectory endpoint vs V1 events search API - Show V1 advantages: filtering, pagination, incremental fetches - Include Python examples for bulk event fetching and real-time polling - Add trajectory to Quick Reference endpoint mapping table - Highlight that V1 events API works without active sandbox
Based on the official V1 migration guide from OpenHands/docs#363, this update corrects the design document to reflect the actual V1 API architecture: Key changes: - Document two-tier API: App Server (conversations/sandboxes) + Agent Server (runtime) - Correct authentication: App Server uses Authorization header, Agent Server uses X-Session-API-Key - Update flow: Must get sandbox info first to obtain Agent Server URL and session key - Add sandbox lifecycle states (STARTING, RUNNING, PAUSED, ERROR, MISSING) - Update all endpoint references to use correct APIs - Fix section numbering and remove duplicate content - Update implementation plan milestones for new architecture Reference: OpenHands/docs#363
|
@OpenHands Read this PR description and the linked issue so you understand the PR goal. You are free to investigate OpenHands/OpenHands and if you need, clone yourself that repo and the agent-sdk repo. Note that you need to pay attention, V1 routes are in openhands/app_server and its execution path; V0 routes are in openhands/server and their files are typically starting with a comment that says they're legacy V0. Understand all I said. Then do a /codereview on this PR. Submit your feedback as a review on the PR with gh api. |
|
I'm on it! enyst can track my progress at all-hands.dev |
enyst
left a comment
There was a problem hiding this comment.
Thanks for putting together the narrative-first flow — the structure lines up well with the migration journey described in OpenHands/OpenHands#12578. I reviewed this against the current V1 app-server routes under openhands/app_server/*, the legacy V0 routes under openhands/server/*, and the current software-agent-sdk agent-server/workspace APIs.
I found a few correctness issues that would make some of the copy/paste examples fail against the current implementations, so I’m requesting changes before merge.
Behavior / correctness
- Steps 1–3 currently document a few request/response shapes that don’t match the live V1 app-server contract (
ids,app_conversation_id, start-task statuses, batch event lookup params). stream-startis described as SSE, but the current implementation streams JSON chunks withapplication/json.- The sandbox example shows
exposed_urlsas an object map, but the actual model returns a list of named URL objects. - The guide currently teaches deprecated agent-server file/git routes and an SDK workspace interface that doesn’t exist in the current
software-agent-sdktree.
I’ve left inline comments with the concrete spots to update.
This comment was marked as duplicate.
This comment was marked as duplicate.
Today I learned that GPT-5.4 will “request changes” with a simple /codereview prompt. Sorry to mess with a draft PR, I’m happy here with what you see fit either way. Unblocking.
Address review comments from PR #363: 1. AppConversationStartTask schema corrections: - Change 'conversation_id' to 'app_conversation_id' in response examples - Change status 'STARTING' to 'WORKING' (correct initial status) - Use 'ids' parameter (plural) for batch endpoint, not 'id' - Document all status values: WORKING, WAITING_FOR_SANDBOX, PREPARING_REPOSITORY, RUNNING_SETUP_SCRIPT, SETTING_UP_GIT_HOOKS, SETTING_UP_SKILLS, STARTING_CONVERSATION, READY, ERROR 2. Stream endpoint clarification: - stream-start returns streaming JSON response, not SSE/EventSource - Add response format example and parsing guidance 3. Batch events endpoint: - Use 'id=' parameter, not 'event_id=' 4. SandboxInfo.exposed_urls format: - Show as array of {name, url, port} objects, not keyed object - Add note about filtering by name == 'AGENT_SERVER' 5. File routes use query parameters: - Change from /api/file/download/{path} to /api/file/download?path=... - Change from /api/file/upload/{path} to /api/file/upload?path=... - Add note that path-style routes are deprecated 6. SDK example corrections: - Replace incorrect Workspace class with actual RemoteWorkspace - Import from openhands.sdk.workspace, not openhands - Use correct parameters: host, api_key, working_dir - Show actual methods: execute_command, file_upload, file_download, git_changes, git_diff
Summary
This PR provides an alternative approach to the migration guide in #362. The key difference is the narrative-first structure that leads with a step-by-step walkthrough rather than reference tables.
Comparison with PR #362
Structure
Key Improvements
Rationale
Based on feedback that a narrative migration flow is important for users. This approach addresses @enyst's "Typical Migration Flow" suggestion from #12578:
Related