Skip to content

Profile-launched conversations never load project skills (load_project_skills stuck False in resolver) #4016

Closed

Description

@simonrosenberg

Summary

A conversation started from an AgentProfile (agent_profile_id) instead of an inline agent_settings payload never loads project skills — the workspace's .agents/skills/, .openhands/skills/, and AGENTS.md/third-party skill files are silently ignored. The agent can't activate any skill that lives in the repo it's working on.

This is deterministic (not flaky): the profile-resolution path never enables load_project_skills, so it is off for 100% of profile-launched conversations. It affects local agent-server, cloud, and eval identically, since all three build the agent purely from the stored profile fields. Same category as #3967 (exec tools / public skills dropped on the profile path) and #4014 (streaming never enabled on the profile path) — this time for project skills.

Root cause (traced)

  • AgentContext.load_project_skills (openhands-sdk/openhands/sdk/context/agent_context.py:126) defaults to False, and — unlike load_user_skills / load_public_skills, which AgentContext resolves itself — it is resolved lazily by LocalConversation on the first send_message() / run(), gated on this flag:

    # local_conversation.py:833
    if merged_context is not None and merged_context.load_project_skills:
        project_skills = load_available_skills(
            work_dir=self.workspace.working_dir,
            include_user=False, include_project=True, include_public=False,
        )
        # merge_skills_by_name(project_skills, merged_context.skills) — authoritative
  • So project-skill loading happens only when AgentContext.load_project_skills is True. Nothing in the SDK ever sets it to True programmatically — it's read-only in the codebase. A consuming client has to construct the AgentContext with it enabled.

  • On the legacy agent_settings path, the client does exactly that (agent-canvas's buildAgentContext() sets load_project_skills: true). But _build_openhands_settings (openhands-sdk/openhands/sdk/profiles/resolver.py:251), which builds the settings for every agent_profile_id launch, constructs the context without it:

    "agent_context": AgentContext(
        skills=skills,
        system_message_suffix=profile.system_message_suffix,
        # load_project_skills defaults to False → project skills never load
    ),

Agent-server resolution entry point: openhands-agent-server/openhands/agent_server/conversation_service.py:_resolve_agent_from_profile → resolve_agent_profile(...) → _build_openhands_settings(...).

Why the API-level skill catalog masks this

load_all_skills() / discover_profile_skills() in openhands-agent-server/.../skills_service.py (which back the /api/skills browser endpoint) do discover project skills independently — so a project skill shows up in the UI catalog and in a raw GET /api/skills, while the agent's own per-turn get_user_message_suffix() matching (which stamps MessageEvent.activated_skills) never sees it. Confirmed in a local agent-server debug run: Loaded 1 project skills: ['e2e-test-project-skill'] appears from the API path, but the agent's message pipeline emits activated_skills=[] for the same conversation because its AgentContext.load_project_skills was False.

Proposed fix

  • _build_openhands_settings should construct the resolved AgentContext with load_project_skills=True (matching what agent_settings-launching clients already set), so profile-launched conversations pick up workspace/repo skills the same way. Consider also defaulting load_user_skills / load_public_skills consistently with the non-profile path, and/or exposing these as profile-model fields if per-profile control is wanted — but the immediate regression is project skills being unconditionally off.
  • More broadly (cross-cutting with Profile-resolved OpenHands agents have no exec tools (and no public skills) #3967 / Profile-launched conversations never enable LLM streaming — on_token crash on switch_llm #4014): the profile resolver keeps dropping AgentContext/settings enrichments that the agent_settings path carries. A single audit of "what does a normal agent_settings launch set on AgentContext that _build_openhands_settings doesn't" would catch these as a class rather than one at a time.

Impact

Real functional regression, not just a test artifact: a user who launches from an agent profile (the default home-composed launch path in agent-canvas#1571) loses all project/repo skill support — .agents/skills/, .openhands/skills/, AGENTS.md. No client-side workaround is possible: load_project_skills is neither a stored-profile field nor a request-payload field — it's hardcoded (absent) inside the resolver, so only an SDK fix can restore it. (Contrast #4014, where canvas could self-heal a persisted profile field.)

Context / tracking

Activity

  1. added
    bug
    on Jul 7, 2026
  2. simonrosenberg commented on Jul 7, 2026

    @simonrosenberg
    MemberAuthor

    Consolidated into #4017 — same root cause as #4014/#3967: the profile resolver omits an AgentContext default the agent_settings path sets (here load_project_skills). #4017 also makes the point that project skills are repo-scoped, not profile-scoped — they should load always/additively, never filtered by skill_refs, never a profile field. This one has no client-side workaround, so it's the merge-blocker for agent-canvas#1571.

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