Skip to content

Skills & MCP: drop embedded profile skills — one server-owned catalog, per-profile refs, uniform tri-state #3979

Closed

Description

@simonrosenberg

Problem

The profile model carries two skill channels with different semantics: embedded skills: list[Skill] (full objects whose mcp_tools can carry secrets) and skill_refs (a name filter whose [] default deliberately breaks symmetry with mcp_server_refs' None default). The embedded channel is what drags a whole secrets apparatus into profiles: resolver _decrypt_skill_mcp_tools + cipher threading, safe_validation_error_detail, the profile store's skill-secret handling, and on cloud (OpenHands/OpenHands#15060) ~150 lines of mask/restore/duplicate-degradation plus the documented X-Expose-Secrets deviation — all to protect secrets inside a model whose docstring says it is "reference-bearing and secret-free at rest".

Worse, the catalogs don't line up across surfaces:

  • Canvas has two skill pipelines: settings-path launches inject a build-time npm bundle (SKILLS_CATALOG from @openhands/extensions) as agent_context.skills, while profile-path launches rely on server-side load_all_skills discovery filtered by skill_refs — which defaults to [] = none. A profile-launched agent gets no public skills while a settings-launched one gets the whole bundle. The picker a profile editor would show (npm names) and the catalog skill_refs resolves against (server discovery) can drift.
  • The global /skills page's disabled_skills toggle is a dead switch on local launches — stored in misc_settings.app_preferences, consulted by nothing in the conversation-start adapter or the server.
  • Cloud has no resolve-time catalog at all: skills arrive via workspace discovery at conversation start (_load_skills_onto_request) filtered by a per-user disabled_skills blacklist; the pinned SDK predates skill_refs entirely.

MCP, by contrast, already has the right shape (mcp_server_refs filtering the named global mcp_config.mcpServers) — canvas just never renders a per-profile picker, so every profile is None = all.

Design

Product model: customisation defines what's globally available; profiles tick a subset. The line that makes it work: the profile catalog is the user/org-curated skill set; workspace/project skills stay runtime-additive and outside profiles (they belong to the repo, not the agent identity, and can't be seen at resolve time anyway).

  1. Drop skills: list[Skill] from OpenHandsAgentProfile. Profiles hold only skill_refs. Nothing is in production — bump AGENT_PROFILE_SCHEMA_VERSION (migration machinery is already scaffolded). Deletes outright: resolver skill-decryption + cipher threading, profile-store skill-secret handling, cloud mask/restore/duplicate-drop + the X-Expose-Secrets deviation, merge_skills_by_name composition in _build_openhands_settings, and the seed's skill-embedding (the sharpest edge of the "first caller's skills become the org default" problem). org.agent_profiles stops needing EncryptedJSON to be load-bearing.
  2. One server-owned catalog. The agent-server already discovers user + public/marketplace skills (load_all_skills) and has a full install/enable/uninstall subsystem for the user tier. Make it the only source: canvas drops the client-side npm-bundle injection; the /skills page, the profile-editor picker, and resolution all read the same server catalog.
  3. Global availability is enforced, not decorative. disabled_skills (or an inverted enabled-set) becomes a server-side filter applied when building the catalog. "Globally available skills" then has one authoritative meaning: G = user-authored ∪ installed ∪ enabled-public.
  4. User-authored skills become named entries in G, stored in the user tier (the existing installed-skills store fits, or a small authored-skills sibling) with their mcp_tools secrets encrypted once, there. This is what makes dropping embedded profile skills lossless.
  5. skill_refs: list[str] | None defaults to None = all of G, restoring symmetry with mcp_server_refs. The old argument for the [] default was "don't auto-inject the whole marketplace" — but once the catalog is the curated set G rather than "everything that exists", None=all is what users expect from a fresh profile, and the seed simplifies to skill_refs=None (genuinely behavior-preserving once global path == catalog path).
  6. Cloud needs a home for G — the natural mirror of mcp_config: an org-level skills container (column + router, same shape as everything else on the org row), with skill_refs resolved against it and workspace discovery remaining an orthogonal additive tier on both paths.

The unified contract (tools axis from the companion issue)

Axis Global catalog Profile field null means Dangling ref
MCP agent_settings.mcp_config.mcpServers mcp_server_refs all servers 422 / diagnostics
Skills server catalog G (curated) skill_refs all of G 422 / diagnostics
Tools runtime registry (GET /tools) tools default preset start-time error + usability greying

One profile-editor "Capabilities" section, three checkbox groups, each with a "use default" master toggle. resolve_agent_profile_dry_run already reports resolved/dangling for MCP and skills; /materialize powers the preview.

Checklist

  • [sdk] profile model v2: drop embedded skills, skill_refs default [] → None, delete skill-secret machinery from resolver/store, schema-version bump + migration
  • [sdk/agent-server] catalog = curated G: enforce enabled/disabled server-side when building available_skills; authored-skills storage in the user tier
  • [canvas] drop npm-bundle injection (server is the sole skill source on both launch paths); fold /skills page semantics into G; per-profile Skills + MCP checkbox groups in the profile editor (needs canvas feat(agent-profiles): Agent Profiles — Settings → Agent as the profile library (local + cloud) agent-canvas#1571's merge-on-save fix first)
  • [cloud] org-level skill catalog (column + router mirroring mcp_config); wire available_skills at the SDK pin bump (note: the bump makes available_skills a required kwarg — the never-brick load path must catch broadly)

Open product call

Whether a fresh profile's null skill selection means "all curated skills" — argued yes above, but needs a product ack since it changes the current []-default behavior.

Part of #3713. Companion issue: #3978 (tools). Related: PR #3968, OpenHands/agent-canvas#1571, OpenHands/OpenHands#15060.

Activity

  1. all-hands-bot commented on Jul 3, 2026

    @all-hands-bot
    Collaborator

    #3979 subsumes #3959 — both address the same root problem (dual skill channels: embedded skills + skill_refs on profiles) with the same desired end-state (one secret-free ref-based field). #3979 effectively answers #3959's decision fork by choosing path (B) 'finish the vertical' and providing the full cross-surface design. Same author, 1 day apart, both under epic #3713, but #3979 does not reference #3959. Discussion will fragment unless consolidated.

    Found 3 possible duplicate issues:

    1. #3959 — [AgentProfile] skill_refs is unfinished + duplicates embedded skills — decide: finish the vertical or revert until the canvas selector exists
    2. #3967 — Profile-resolved OpenHands agents have no exec tools (and no public skills)
    3. #3868 — [AgentProfile][sdk] Per-profile skill selection: add a name filter (like mcp_server_refs) instead of embedded Skill objects

    These may not be exact duplicates, but the scope appears to overlap enough that keeping discussion in one place may be more useful.

    This comment was created by an AI assistant (OpenHands) on behalf of the repository maintainer.

  2. added
    bug
    on Jul 6, 2026
  3. all-hands-bot commented on Jul 6, 2026

    @all-hands-bot
    Collaborator

    [Automatic Post]: This issue has been waiting for triage. @xingyaoww @neubig @enyst, could you
    please take a look and add the appropriate priority label when you have a chance?

    This comment was created by an AI agent (OpenHands) on behalf of the user.

  4. simonrosenberg commented on Jul 7, 2026

    @simonrosenberg
    MemberAuthor

    Confirming this manifested concretely, with a fix now shipped as a client-side workaround: agent-canvas#1571's mock-llm e2e suite caught exactly the failure mode described in the second bullet above — a slash-command-triggered skill never activated on a profile-launched conversation, because the "default" agent profile's skill_refs was never set and resolves to [] = none server-side, while the equivalent agent_settings-launched conversation gets the full frontend-bundled public-skill catalog via buildAgentContext/agent_context.skills.

    Workaround (commit a30683a2): useSaveAgentProfile — the single choke point for every real profile save (onboarding seed + Settings create/edit) — now defaults skill_refs to null (all discovered) whenever a caller doesn't set it explicitly. This is a client-only mitigation for new/edited profiles; it doesn't retroactively fix skill_refs on profiles that predate the change and are never re-saved, and it doesn't address the broader duplication/catalog-drift issues this issue and #3959 describe. Flagging as supporting evidence for prioritizing (B) here, or at minimum reconciling the []-default called out in #3959 point 5 — the "profile created without touching skills resolves to zero skills" failure mode is not hypothetical, it broke a real e2e test.

  5. simonrosenberg commented on Jul 7, 2026

    @simonrosenberg
    MemberAuthor

    Folded into #4017, which adopts this issue's design (drop embedded skills, one server-owned catalog, per-profile refs, uniform tri-state) and pairs it with the broader resolver fix — the embedded-skills secrets apparatus and the skill_refs backwards default are two faces of the same 'resolver builds minimal-from-scratch' flaw behind #4014/#4016. #4017 also nails down that project skills are repo-scoped and stay outside the profile model entirely (loaded always/additively), which resolves the 'catalog doesn't line up across surfaces' concern for the project tier.

  6. simonrosenberg commented on Jul 10, 2026

    @simonrosenberg
    MemberAuthor

    Superseded by the reviewed #4018 architecture. Agent Profiles no longer embed skills or use skill_refs; they use disabled_skills over discovered skills, which cannot fail launch on catalog drift. Per-profile capability/editor work that still makes sense is tracked in OpenHands/OpenHands#15563 and the remaining tools work in #3978.

  7. simonrosenberg commented on Sep 11, 2026

    @simonrosenberg
    MemberAuthor

    Concrete measurements from wiring the profile path in Agent Canvas, since this issue frames the fix as "canvas must drop the npm-bundle skill injection" without recording what that costs.

    The two paths do not differ in whether skills load — they differ in which pipeline supplies them.

    source version cost
    inline agent_settings npm bundle from @openhands/extensions, injected by the client with load_public_skills: false pinned at canvas build time none
    agent_profile_id discover_profile_skills() → load_all_skills(load_public=True, load_user=True) → a git clone of https://github.com/OpenHands/extensions tracks repo HEAD clone on first run

    The profile path is already "one server-owned catalog" in design. It resolved to zero skills on a stock local dev stack simply because the clone was never populated.

    The bundle is smaller than it looks. The catalog holds 60 skills but is allow-listed, not deny-listed: a launch injects DEFAULT_ENABLED_SKILL_NAMES — 11 (add-skill, agent-canvas-environment, agent-memory, agent-sdk-builder, code-review, docker, github, openhands-api, openhands-automation, openhands-sdk, skill-creator) — unless the user has set an explicit enabled_skills. Canvas made that choice deliberately (OpenHands/OpenHands#16302): with a build-time snapshot, a deny-list would push every future catalog addition into every system prompt.

    So the parity gap today is 11 → 0, and the practical effect is that Agent Canvas routes the seeded default profile through agent_settings specifically to keep those 11 — which is why per-profile fields set on default are silently ignored at launch (OpenHands/OpenHands#17235 exposes tool/prompt scoping that hits exactly this).

    The trade-off this issue should record before choosing: the npm bundle exists because the clone has latency. The canvas migration note is explicit — "the former VITE_LOAD_PUBLIC_SKILLS env var was removed because bundled skills have no clone latency". Moving the profile path onto the server clone reintroduces that, and the two sources can drift in version, not only content: one is pinned at build, the other tracks HEAD.

    Three ways out, with what each costs:

    1. Server clone wins (this issue as written). One catalog, no drift. Costs first-run clone latency on every deployment, including local dev where it is most visible.
    2. Client bundle wins for client-driven launches. Needs a channel: AgentLaunchAdditions currently carries only system_message_suffix_append, so a client sending agent_profile_id has no way to supply skills. Adding one keeps the bundle's zero-latency property but entrenches two pipelines.
    3. Server clone, pre-warmed. Same as (1), with the clone populated at image build or first boot rather than first launch, so the latency is paid once and off the critical path.

    (3) looks like the honest version of (1) to me, but it is a deployment question as much as an SDK one, which is why I am adding the data rather than picking.

    Related: OpenHands/OpenHands#17279 (runtime-services context now rides AgentLaunchAdditions on the profile path — the same class of client-owned enrichment, already solved for the suffix).

  8. openhands-ai commented on Sep 11, 2026

    @openhands-ai

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

  9. openhands-ai commented on Sep 11, 2026

    @openhands-ai

    Implemented and opened draft PR: #4959

    What changed

    • Prewarms the server-owned user + public profile skill catalog during agent-server startup.
    • Runs blocking Git/catalog work via asyncio.to_thread.
    • Keeps startup nonfatal if the catalog is unavailable.
    • Adds OH_PREWARM_PROFILE_SKILLS=0 to restore lazy loading for offline deployments.
    • Includes a temporary .pr/design.html before/after design artifact.

    Verification

    • make build passed.
    • 125 affected tests passed, including real wsproto server startup.
    • All pre-commit gates passed: Ruff, pycodestyle, Pyright, import rules, and tool registration.
    • Real cold-start test cloned OpenHands/extensions and loaded 60 skills before Uvicorn reported startup complete.

    Commit: b84ef11 (fix(agent-server): prewarm profile skill catalog)

    CI is currently running. The PR remains draft; a human must complete the reserved HUMAN: field before marking it ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions