Repository navigation
Description
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 toFalse, and — unlikeload_user_skills/load_public_skills, whichAgentContextresolves itself — it is resolved lazily byLocalConversationon the firstsend_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 toTrueprogrammatically — it's read-only in the codebase. A consuming client has to construct theAgentContextwith it enabled. -
On the legacy
agent_settingspath, the client does exactly that (agent-canvas'sbuildAgentContext()setsload_project_skills: true). But_build_openhands_settings(openhands-sdk/openhands/sdk/profiles/resolver.py:251), which builds the settings for everyagent_profile_idlaunch, 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_settingsshould construct the resolvedAgentContextwithload_project_skills=True(matching whatagent_settings-launching clients already set), so profile-launched conversations pick up workspace/repo skills the same way. Consider also defaultingload_user_skills/load_public_skillsconsistently 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 theagent_settingspath carries. A single audit of "what does a normalagent_settingslaunch set onAgentContextthat_build_openhands_settingsdoesn'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
- Epic: [AgentProfile] Epic: first-class Agent Profiles (named launch setups) across SDK, agent-server, canvas, cloud #3713 (Agent Profiles)
- Sibling gaps on the same profile-launch path: Profile-resolved OpenHands agents have no exec tools (and no public skills) #3967 (exec tools / public skills), Profile-launched conversations never enable LLM streaming — on_token crash on switch_llm #4014 (streaming / on_token)
- Surfaced by: feat(agent-profiles): Agent Profiles — Settings → Agent as the profile library (local + cloud) agent-canvas#1571's
mock-llm-skills.spec.ts"project skill in workspace/.agents/skills/ triggers on matching keyword" — fails deterministically on the profile-launch path
Activity
simonrosenberg commentedon Jul 7, 2026
Consolidated into #4017 — same root cause as #4014/#3967: the profile resolver omits an
AgentContextdefault theagent_settingspath sets (hereload_project_skills). #4017 also makes the point that project skills are repo-scoped, not profile-scoped — they should load always/additively, never filtered byskill_refs, never a profile field. This one has no client-side workaround, so it's the merge-blocker for agent-canvas#1571.