Skip to content

Add Narrative-First V0 to V1 Migration Guide (Alternative to #362)#363

Draft
jpshackelford wants to merge 5 commits intomainfrom
narrative-migration-guide
Draft

Add Narrative-First V0 to V1 Migration Guide (Alternative to #362)#363
jpshackelford wants to merge 5 commits intomainfrom
narrative-migration-guide

Conversation

@jpshackelford
Copy link
Copy Markdown
Contributor

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

Aspect PR #362 This PR
Lead section Endpoint mapping tables Step-by-step migration walkthrough
Examples Isolated operations Build on each other in a workflow
Agent Server Explained abstractly Shown in context (Step 5) with full curl example
Reference tables Primary content Secondary, for lookup
Flow Reader assembles pieces Guide walks through complete journey

Structure

1. Overview (brief - architecture change + benefits accordion)

2. Migration Walkthrough (THE NARRATIVE)
   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 for lookup)

4. Agent Server API Reference

5. Known Gaps and Workarounds

6. Authentication Summary

7. Additional Resources

Key Improvements

  1. Actionable from the start - Users can follow along and migrate step-by-step
  2. Context for each change - "Here's what you did in V0, here's why V1 is different"
  3. Complete examples - Each step builds on previous, showing real workflow
  4. Agent Server fully demonstrated - Step 5 shows getting sandbox → extracting session key → making calls
  5. Reference stays available - Endpoint tables at end for quick lookup

Rationale

Based on feedback that a narrative migration flow is important for users. This approach addresses @enyst's "Typical Migration Flow" suggestion from #12578:

  1. Create/Start conversation
  2. Track startup (poll or stream)
  3. Events/messages operations
  4. Sandbox ops
  5. Agent-server operations

Related

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
jpshackelford pushed a commit to jpshackelford/oh-utils that referenced this pull request Mar 9, 2026
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
@enyst
Copy link
Copy Markdown
Collaborator

enyst commented Mar 19, 2026

@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.

@openhands-ai
Copy link
Copy Markdown

openhands-ai bot commented Mar 19, 2026

I'm on it! enyst can track my progress at all-hands.dev

enyst
enyst previously requested changes Mar 19, 2026
Copy link
Copy Markdown
Collaborator

@enyst enyst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-start is described as SSE, but the current implementation streams JSON chunks with application/json.
  • The sandbox example shows exposed_urls as 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-sdk tree.

I’ve left inline comments with the concrete spots to update.

@openhands-ai

This comment was marked as duplicate.

@enyst enyst dismissed their stale review March 19, 2026 13:43

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

V0 to V1 Migration Guide

3 participants