Skip to content

Commit a4e82a5

Browse files
Fix marketplace source pyright issues
1 parent 6c61199 commit a4e82a5

File tree

2 files changed

+18
-6
lines changed
  • examples/01_standalone_sdk/43_mixed_marketplace_skills
  • openhands-sdk/openhands/sdk/skills

2 files changed

+18
-6
lines changed

examples/01_standalone_sdk/43_mixed_marketplace_skills/main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ def main():
101101

102102
print("\nSkills:")
103103
for entry in marketplace.skills:
104-
source_type = "remote" if entry.source.startswith("http") else "local"
104+
resolved_source, ref, _ = marketplace.resolve_skill_source(entry)
105+
source_type = (
106+
"remote" if ref is not None or "://" in resolved_source else "local"
107+
)
105108
print(f" - {entry.name} ({source_type})")
106109
print(f" Source: {entry.source}")
107110
if entry.description:

openhands-sdk/openhands/sdk/skills/installed.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from openhands.sdk.context.skills.skill import Skill, load_skills_from_dir
1818
from openhands.sdk.context.skills.utils import find_skill_md, validate_skill_name
1919
from openhands.sdk.logger import get_logger
20-
from openhands.sdk.skills.fetch import fetch_skill_with_resolution
20+
from openhands.sdk.skills.fetch import SkillFetchError, fetch_skill_with_resolution
2121

2222

2323
logger = get_logger(__name__)
@@ -533,10 +533,19 @@ def install_skills_from_marketplace(
533533

534534
# 1. Standalone skills from marketplace.skills
535535
for entry in marketplace.skills:
536-
resolved = resolve_source_path(
537-
entry.source, base_path=marketplace_path, update=True
538-
)
539-
if resolved and resolved.exists():
536+
try:
537+
source, ref, repo_path = marketplace.resolve_skill_source(entry)
538+
resolved, _ = fetch_skill_with_resolution(
539+
source=source,
540+
ref=ref,
541+
repo_path=repo_path,
542+
update=True,
543+
)
544+
except (SkillFetchError, ValueError) as exc:
545+
logger.warning(f"Failed to resolve skill '{entry.name}': {exc}")
546+
continue
547+
548+
if resolved.exists():
540549
skill_dirs.append((entry.name, resolved))
541550
else:
542551
logger.warning(f"Failed to resolve skill '{entry.name}'")

0 commit comments

Comments
 (0)