mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 13:47:19 +08:00
fix: address review comments for marketplace_path setting
- Fix Data Model Inconsistency: Change backend default from 'marketplaces/default.json' to None. Now null means 'load all skills without filtering', and any string value means use that marketplace. - Add Alembic migration: Create migration 099 to add marketplace_path column to user_settings table for enterprise deployments. - Simplify frontend handling: Use parseMarketplacePath() utility to consistently convert empty string to null. Remove confusing DEFAULT_MARKETPLACE_PATH constant, use MARKETPLACE_PATH_PLACEHOLDER for UI hint only. - Add validation: Implement isValidMarketplacePath() to validate marketplace path formats (simple paths like 'marketplaces/default.json' or cross-repo paths like 'owner/repo:path/file.json'). Show validation errors inline and disable save button for invalid input. - Add tests: Frontend tests for isValidMarketplacePath() and parseMarketplacePath(). Backend tests for marketplace_path default and custom value handling. - Add i18n: Translation for marketplace path validation error message. Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
@@ -55,8 +55,9 @@ class Settings(BaseModel):
|
||||
git_user_email: str | None = None
|
||||
v1_enabled: bool = True
|
||||
# Path to the marketplace JSON file for public skills loading
|
||||
# Defaults to 'marketplaces/default.json' in the public skills repository
|
||||
marketplace_path: str | None = 'marketplaces/default.json'
|
||||
# None = Load all skills without marketplace filtering
|
||||
# String value = Use that marketplace path (e.g., 'marketplaces/default.json')
|
||||
marketplace_path: str | None = None
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_assignment=True,
|
||||
|
||||
Reference in New Issue
Block a user