-
Notifications
You must be signed in to change notification settings - Fork 7.6k
feat(server): introduce OH extension system + entry-point config discovery #10774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… discovery I am OpenHands-GPT-5, an AI agent. Introduce a lightweight plugin mechanism so SaaS can live in an external repo: - New openhands.server.extension mounts extensions from OPENHANDS_EXTENSIONS env var or entry points (group: openhands_server_extensions) - ServerConfig loader enhanced to discover a custom config via entry points (group: openhands_server_config) with env var OPENHANDS_CONFIG_CLS as override - Wire extension mounting into FastAPI app This is the first step toward removing import-time globals in server/shared.py and enabling SaaS to be developed and run from an external repo. Co-authored-by: openhands <openhands@all-hands.dev>
I am OpenHands-GPT-5, an AI agent. Add initial documentation for the new OpenHands (OH) extension system: - New docs page: docs/usage/architecture/extensibility.mdx - Add page to docs navigation (docs/docs.json) - Improve code comments in openhands.server.extension to use OH + ‘enterprise/custom extension’ terminology This is part of a broader refactor to reduce import-time globals and enable external enterprise extensions. Co-authored-by: openhands <openhands@all-hands.dev>
…nI am OpenHands-GPT-5, an AI agent. Clarify in docs and code comments that OPENHANDS_CONFIG_CLS is honored for backward compatibility and may be removed in a future release.\n\n- Update docs/usage/architecture/extensibility.mdx\n- Update comment in openhands/server/config/server_config.py\n\nCo-authored-by: openhands <openhands@all-hands.dev>
@OpenHands Read this PR and do a /codereview-roasted on it. Note that multiuser extensions already exist, they're just not standardized. |
I'm on it! enyst can track my progress at all-hands.dev 🟡 Solvability: MEDIUM Medium difficulty: this is a brief request to review a PR with a note about existing multiuser extensions, but it lacks the PR link, scope, and concrete expectations, making it under-specified. Clear labels and a focused ask help, but missing context and criteria limit immediate action. You can make the issue easier to resolve by addressing these concerns in the conversation:
Positive feedback:
|
Code Review SummaryI completed a thorough Key Findings:🔴 Taste Rating: Needs improvement - The PR solves a real problem (external extension integration) with a reasonable architectural approach, but has serious implementation flaws. Critical Issues Found:
Major Improvement Opportunities:
Verdict:❌ Needs rework - The closure bug will cause runtime failures, and security implications need addressing before safe deployment. Architectural Assessment:The direction is sound - this addresses a real need for external SaaS/enterprise integration without modifying core OpenHands. However, the implementation needs another pass to eliminate Python footguns and security risks. No code changes were made - this was a review-only analysis as requested. |
…py\n\nI am OpenHands-GPT-5, an AI agent. Clarify comment to avoid the term 'SaaS' per repo conventions.\n\nCo-authored-by: openhands <openhands@all-hands.dev>
I am OpenHands-GPT-5, an AI agent. This PR introduces a lightweight extension mechanism to let external repositories (e.g., enterprise/custom extensions) mount routes and lifecycle hooks into the OpenHands (OH) backend without modifying OH, and adds a discovery path for custom ServerConfig via entry points.
What this PR does
openhands/server/extension.py
:OPENHANDS_EXTENSIONS
env var (comma-separated "pkg.mod:register" or "pkg.mod:Class.register")openhands_server_extensions
register(app: FastAPI)
callable; supports optionalon_startup
/on_shutdown
openhands/server/app.py
)load_server_config()
to discover a customServerConfig
via entry points (group:openhands_server_config
) while preservingOPENHANDS_CONFIG_CLS
overridedocs/usage/architecture/extensibility.mdx
and updates docs navigationWhy
The current code has several import-time globals and envvar-driven wiring that made an external SaaS repo depend too much on OH internals. This is a small first step toward a pluggable, SaaS-friendly architecture where the SaaS can live and run in its own repo:
Design notes
Documentation
New page:
docs/usage/architecture/extensibility.mdx
ServerConfig
via entry point orOPENHANDS_CONFIG_CLS
Docs navigation updated to include the new page under OpenHands Developers → Architecture
Next steps (tracked separately)
server/shared.py
globalsserver/shared.py
to dependency injection (with a temporary compatibility shim)Checklists
Links
@enyst can click here to continue refining the PR
To run this PR locally, use the following command:
GUI with Docker:
CLI with uvx: