Skip to content

Conversation

@enyst
Copy link
Collaborator

@enyst enyst commented Dec 9, 2025

Summary of updates

This weekly refresh updates the SDK architecture documentation under sdk/arch based on the latest HEAD of OpenHands/software-agent-sdk (commit 93d405c9).

Updated pages

  1. sdk/arch/agent-server.mdx
  • Rewrote the page to accurately reflect the current FastAPI app, routers, services, and WebSocket endpoints.
  • Clarified that the Agent Server itself does not orchestrate containers; containerization is handled by workspace implementations (e.g., DockerWorkspace) that launch the server.
  • Added explicit endpoint inventory grouped by router, and authentication details (X-Session-API-Key header for HTTP and session_api_key query parameter for WebSockets).
  • Included component diagrams aligned with current code.
  • Added Last updated timestamp and source commit.
  1. sdk/arch/security.mdx
  • Fixed incorrect source link path (openhands-sdk/openhands/sdk/security).
  • Added ConfirmationPolicy reference to the key components table.
  • Appended Last updated timestamp and source commit.

Citations (inline in the docs)

  • openhands-agent-server/openhands/agent_server/api.py (app wiring, lifespan)
  • openhands-agent-server/openhands/agent_server/dependencies.py (authentication headers and query parameter for WebSocket)
  • openhands-agent-server/openhands/agent_server/conversation_router.py (conversation endpoints)
  • openhands-agent-server/openhands/agent_server/event_router.py (event endpoints)
  • openhands-agent-server/openhands/agent_server/sockets.py (WebSocket endpoints)
  • openhands-agent-server/openhands/agent_server/file_router.py (file upload/download)
  • openhands-agent-server/openhands/agent_server/git_router.py (git endpoints)
  • openhands-agent-server/openhands/agent_server/tool_router.py (tool listing)
  • openhands-workspace/openhands/workspace/docker/workspace.py (server launched by workspace)
  • openhands-sdk/openhands/sdk/security/* (analyzers, risks, confirmation policy)

Source of truth

  • software-agent-sdk commit: 93d405c91edbaccd84d7b0a356340123a911a6cb

Process notes

  • Followed the Guide for Writing Architecture Component Documentation.
  • Kept changes scoped to architecture pages; no guides or API reference modified beyond necessary link fixes.
  • CI: Please run pre-commit hooks in CI as configured.

@enyst can click here to continue refining the PR

- Update agent-server.mdx to reflect current server responsibilities and endpoints (source: openhands-agent-server/*)
- Fix security.mdx source link; add ConfirmationPolicy reference; add Last updated and Source commit footer

Co-authored-by: openhands <openhands@all-hands.dev>
…)\n\nCo-authored-by: openhands <openhands@all-hands.dev>
…thored-by: openhands <openhands@all-hands.dev>
Copy link
Contributor

@xingyaoww xingyaoww left a comment

Choose a reason for hiding this comment

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

Weird -- i don't think agent server package is included in docs.json?

…ples, inline source links\n\nCo-authored-by: openhands <openhands@all-hands.dev>
…inline source links\n\nCo-authored-by: openhands <openhands@all-hands.dev>
Place agent-server at the end of the SDK Components section for consistent ordering.

Co-authored-by: openhands <openhands@all-hands.dev>
…'Agent Server', and simplify selected endpoints

Also keeps concise Client SDK REST + WebSocket examples with inline GitHub source links.

Co-authored-by: openhands <openhands@all-hands.dev>
@enyst
Copy link
Collaborator Author

enyst commented Dec 22, 2025

Weird -- i don't think agent server package is included in docs.json?

Added! But now I'm not sure: did we leave it out intently, for a reason like, we recommend to use the remote workspace to handle communication? That doesn't apply to communication from other languages than python, so it seems like it can be useful.

On a side note, the existing document contained a lot of hallucinations, a lot fixed. 😅

@enyst
Copy link
Collaborator Author

enyst commented Dec 22, 2025

@OpenHands We have syntax errors in mintlify for the two initial diagrams, please fix. This is one, but look at the next one too:

Architecture
Syntax error in text
mermaid version 11.4.1
App construction and route wiring happen in api.py: a single /api router includes conversation, event, tool, bash, git, file, vscode, and desktop routers.
Event and VSCode/Desktop services are initialized in the lifespan context (api.py).

@openhands-ai
Copy link

openhands-ai bot commented Dec 22, 2025

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

…ards, avoid /* and braces in labels)

- Replace '/api/*' and '/sockets/*' with safe labels in diagrams
- Replace '{id}' with '<id>' in node label

Co-authored-by: openhands <openhands@all-hands.dev>
@openhands-ai
Copy link

openhands-ai bot commented Dec 22, 2025

Summary of changes just made

What I fixed

  • Resolved Mermaid syntax errors in Mintlify for the initial diagrams on the Agent Server architecture page.

Why it was failing

  • Labels containing “/api/” and “/sockets/” were parsed as the start of a comment (/*) by Mermaid v11, breaking the diagram.
  • A node label included curly braces “{id}”, which can also cause parsing issues.

Precise edits

  • sdk/arch/agent-server.mdx
    • Architecture diagram:
      • Routers label: “Routers (/api/*)” → “Routers (/api)”
      • Events node: “conversations/{id}/events” → “conversations//events”
      • WS node: “/sockets/* (WebSocket)” → “/sockets (WebSocket)”
    • Authentication diagram:
      • HTTP node: “HTTP /api/*” → “HTTP /api”
      • WS node: “/sockets/*” → “/sockets”

Validation

  • Checked the git diff to ensure only minimal, relevant changes were made.
  • Changes are concise and scoped to fixing Mermaid parsing errors in the two initial diagrams referenced.

Commit

  • sdk/arch(agent-server): fix Mermaid syntax for Mintlify (escape wildcards, avoid /* and braces in labels)
  • Co-authored-by: openhands openhands@all-hands.dev

Next steps

  • These diagrams should now render cleanly in Mintlify. If there are any other diagrams containing “/*” or “{…}” in labels, we should normalize them similarly.

View full conversation

…ver group\n\n- Remove sdk/arch/agent-server from SDK Components\n- Add sdk/arch/agent-server under Guides > Remote Agent Server (after overview)\n\nCo-authored-by: openhands <openhands@all-hands.dev>
Copy link
Contributor

@xingyaoww xingyaoww left a comment

Choose a reason for hiding this comment

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

The more i read into this doc, the more i feel it probably make sense to combine this docs with agent-server overview page we currently have, and have this doc link to specific docs of Docker/APIWorkspace when discussing about *Workspace that spawns agent server, wdyt?

@enyst
Copy link
Collaborator Author

enyst commented Dec 23, 2025

The more i read into this doc, the more i feel it probably make sense to combine this docs with agent-server overview page we currently have, and have this doc link to specific docs of Docker/APIWorkspace when discussing about *Workspace that spawns agent server, wdyt?

Yes I feel maybe there’s some duplication. @OpenHands review the pages under agent-server and use your taste to combine meaningfully; link to workspaces.

@openhands-ai
Copy link

openhands-ai bot commented Dec 23, 2025

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

- Refactored sdk/arch/agent-server.mdx to focus on technical architecture:
  - Removed duplicate content and client SDK examples
  - Added clear API endpoints table
  - Added authentication table
  - Added links to workspace implementations (Docker, API, Cloud)
  - Added See Also section linking to guides

- Refactored sdk/guides/agent-server/overview.mdx to focus on practical usage:
  - Renamed title to 'Remote Agent Server' for clarity
  - Removed duplicate architecture diagrams
  - Added workspace types comparison table
  - Added OpenHands Cloud workspace example
  - Simplified 'How It Works' section
  - Added links to architecture page for technical details

- Updated Next Steps sections in all agent-server guide pages for consistency

Co-authored-by: openhands <openhands@all-hands.dev>
@openhands-ai
Copy link

openhands-ai bot commented Dec 23, 2025

Summary of Changes

I've consolidated the agent-server documentation pages to reduce duplication and improve clarity, as requested. The changes have been pushed to the docs-weekly-arch-refresh branch.

What was done:

1. Refactored sdk/arch/agent-server.mdx (Architecture Page)

  • Focused on technical architecture details: API endpoints, authentication, component design
  • Removed duplicate client SDK examples (REST/WebSocket code snippets)
  • Added clear tables for API endpoints and authentication methods
  • Added links to workspace implementations (DockerWorkspace, APIRemoteWorkspace, OpenHandsCloudWorkspace)
  • Added "See Also" section linking to practical guides

2. Refactored sdk/guides/agent-server/overview.mdx (Guides Overview)

  • Renamed title from "Overview" to "Remote Agent Server" for clarity
  • Removed duplicate architecture diagrams
  • Added workspace types comparison table
  • Added OpenHands Cloud workspace example alongside Docker and API examples
  • Simplified "How It Works" section
  • Added note linking to architecture page for technical details

3. Updated cross-links in all agent-server guide pages

  • api-sandbox.mdx, docker-sandbox.mdx, local-server.mdx, cloud-workspace.mdx
  • Consistent "Next Steps" sections with proper descriptions

Result:

  • Architecture page → Technical reference (endpoints, auth, design)
  • Guides overview → Practical usage (workspace types, deployment options)
  • Both pages now link to each other and to specific workspace documentation
  • Net reduction of 79 lines while improving organization and clarity

The changes are already pushed to the PR branch.

View full conversation

@neubig
Copy link
Contributor

neubig commented Dec 31, 2025

Just checking in @enyst are you still working on this? If so you could re-request review or make any changes.

docs.json Outdated
"group": "Remote Agent Server",
"pages": [
"sdk/guides/agent-server/overview",
"sdk/arch/agent-server",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@OpenHands I think we already have in the overview page similar content with the agent-server page? Verify what I just said, and dedup: remove from agent-server page what we already basically cover in overview, and move from agent-server page to overview page the rest. Don't spend much explanations on workspaces, link to the respective workspace instead.

Do make sure to keep all contents about the seamless transition from local to remote, and of course the rest of the non-dupe content.

Copy link

Choose a reason for hiding this comment

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

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

Copy link

Choose a reason for hiding this comment

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

I've completed the deduplication of the overview and agent-server pages as requested. Here's a summary of the changes:

Changes Made

✅ Verified overlap and deduplicated content

  • Confirmed that sdk/arch/overview.mdx and sdk/arch/agent-server.mdx had significant overlap in describing the Agent Server Package

✅ Moved unique content from agent-server.mdx to overview.mdx

The following unique content was moved to the "Agent Server Package" section in overview.mdx:

  • Architecture diagram (FastAPI App, Routers, Services)
  • Key Components table with source links
  • API Endpoints tables (REST and WebSocket)
  • Authentication details (HTTP header and WebSocket query param)

✅ Removed agent-server.mdx

  • Deleted sdk/arch/agent-server.mdx since all its content is now consolidated in overview.mdx

✅ Updated navigation

  • Removed sdk/arch/agent-server from docs.json navigation

✅ Updated all references

Updated 8 files that referenced the deleted page to point to the new location (/sdk/arch/overview#agent-server-package-openhandsagent_server):

  • sdk/guides/agent-server/overview.mdx
  • sdk/guides/agent-server/api-sandbox.mdx
  • sdk/guides/agent-server/docker-sandbox.mdx
  • sdk/guides/agent-server/local-server.mdx
  • sdk/guides/agent-server/cloud-workspace.mdx
  • sdk/arch/sdk.mdx
  • sdk/arch/workspace.mdx

✅ Kept seamless transition content

The seamless local-to-remote transition content remains in sdk/guides/agent-server/overview.mdx (the practical guide)

✅ Linked to workspace docs instead of explaining

The overview now links to /sdk/arch/workspace for workspace implementation details rather than duplicating explanations

The changes have been pushed to the docs-weekly-arch-refresh branch on PR #169.

View full conversation

- Move unique content from sdk/arch/agent-server.mdx to sdk/arch/overview.mdx
- Remove sdk/arch/agent-server.mdx (content now in overview)
- Update all references to point to the new location
- Update docs.json navigation to remove agent-server page

Co-authored-by: openhands <openhands@all-hands.dev>
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.

4 participants