Repository navigation
Add auto-generated Python API reference documentation from software-agent-sdk #65
Description
Activity
- addeddocumentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request
on Nov 3, 2025 I'm on it! xingyaoww can track my progress at all-hands.dev
- added a commit that references this issue
on Nov 3, 2025 Summary
I've successfully implemented auto-generated Python API reference documentation for the OpenHands SDK as requested in issue #65. Here's what was delivered:
✅ Implementation Complete
New Files Created:
-
.github/workflows/sync-api-reference.yml- GitHub Actions workflow that:- Runs daily at 2 AM UTC to keep docs in sync
- Supports manual triggering via
workflow_dispatch - Automatically checks out both repos, generates docs, and commits changes
-
.github/scripts/generate_api_docs.py- Custom Python documentation generator that:- Uses AST parsing (no external dependencies required)
- Extracts docstrings, classes, methods, and function signatures
- Generates Mintlify-compatible MDX files with proper frontmatter
- Filters out private members (except
__init__) - Links to GitHub source code for each module
-
sdk/api/directory - 12 auto-generated documentation files:index.mdx- Overview page with module list- 11 module pages: agent, conversation, llm, tool, workspace, mcp, event, context, security, io, git
-
docs.jsonupdates - Added "API Reference" section to SDK tab navigation
🎯 Key Features
- Zero dependencies: Uses Python standard library only (ast, json, pathlib)
- Automated sync: Keeps documentation current with SDK changes
- Clean output: Professional MDX format with class hierarchies, method signatures, and docstrings
- Source links: Every module links to its GitHub source location
- Maintainable: Simple, readable code that's easy to extend
📋 All Requirements Met
✅ GitHub Actions workflow with schedule and workflow_dispatch
✅ Checks out software-agent-sdk repository
✅ Generates Python API documentation
✅ Outputs Mintlify-compatible MDX format
✅ Auto-commits and pushes changes
✅ Updates docs.json navigation
✅ Filters to public API only
✅ Documentation placed insdk/api/🔗 Pull Request
The PR has been created as a draft and includes all changes with a detailed description. The implementation is ready for review and testing.
-
I’ve been reading the documentation and the existing tools for automated document generation. I noticed there is already a solution in place, but I have a question regarding its current status: Is this solution functional?
Asking that because I found here the following description for the method
verify()This PR’s goal is to not reconcile configuration between persisted and runtime Agent instances. Instead, we verify compatibility requirements and then continue with the runtime-provided Agent.
This text appears to be a leftover PR description rather than actual documentation, and it doesn't match the docstring found in the
software-agent-sdk.If you need help, I’d be happy to take a look at it ;-)
Reacted by Engel NystReacted by Engel NystHey @VascoSch92 - yes, i think this solution is somewhat functional, but could be a little buggy based on your observation, so feel free to take a look to double check if you have time!
@xingyaoww FYI: I assigned myself so I don't forget to look into that
Reacted by Xingyao Wang
Background
The OpenHands SDK provides a Python API for building AI agents, but currently lacks comprehensive API reference documentation on the docs site. Having clear, auto-generated Python API documentation is standard practice and would:
Current State
We currently have two automated workflows that sync content from the
OpenHands/software-agent-sdkrepository:.github/workflows/sync-docs-code-blocks.yml) - Syncs example code snippets from the SDK repo into documentation pages.github/workflows/sync-agent-sdk-openapi.yml) - Generates and syncs OpenAPI specifications from the SDK's agent serverThese workflows demonstrate the pattern for automatically pulling content from the SDK repository and updating the docs.
Proposed Solution
Create a new GitHub Actions workflow similar to the existing sync workflows that:
OpenHands/software-agent-sdkrepositoryworkflow_dispatchImplementation Considerations
docs.jsonto include the new API reference sectionsdk/api/or similarExample Workflow Structure
Similar to
sync-agent-sdk-openapi.yml:Benefits
✅ Standard documentation practice for Python libraries
✅ Easier API discovery for users
✅ Automated - stays in sync with SDK changes
✅ Encourages better docstrings in the codebase
✅ Follows existing patterns in our docs infrastructure
Related