fix(skills): load repository skills into conversations and scope skill menus to the conversation workspace#707
fix(skills): load repository skills into conversations and scope skill menus to the conversation workspace#707VascoSch92 wants to merge 2 commits into
Conversation
…l menus to the conversation workspace
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
all-hands-bot
left a comment
There was a problem hiding this comment.
Taste Rating: 🟢 Good taste - Clean, focused bug fix that solves a real problem
This PR properly addresses the repository skills loading gap with a pragmatic approach:
✅ Clean data flow: Skills are fetched from the workspace root (not ephemeral worktree subdirs), converted to SDK wire format, and injected into the agent context
✅ Appropriate scope: The conversation-scoped skill hooks (useConversationSkills) ensure the slash-command menu and skills modal show exactly what's loaded into each conversation
✅ Solid error handling: getProjectSkills() returns an empty array on failure rather than blocking conversation start
✅ Comprehensive testing: Covers the SkillInfo→Skill conversion, workspace root resolution (with regression guard), cloud backend fallback, and both OpenHands/ACP agent paths
[RISK ASSESSMENT]
- [Overall PR]
⚠️ Risk Assessment: 🟢 LOW
Bug fix that restores expected functionality (repository skills loading into conversations). Additive change with good test coverage, error handling prevents blocking conversation start, and the temporary nature of the workaround is documented.
VERDICT:
✅ Worth merging: Solid implementation that fixes the reported issue. Clean separation of concerns, appropriate error handling, and comprehensive test coverage.
KEY INSIGHT:
The workspace root resolution is crucial - project skills must be loaded from the workspace root, not the per-conversation worktree subdirectory, which is ephemeral and has no .agents/skills/ directory.
Was this automated review useful? React with 👍 or 👎 to this review to help us measure review quality.
Workflow run: https://github.com/OpenHands/agent-canvas/actions/runs/26226841601
all-hands-bot
left a comment
There was a problem hiding this comment.
Taste Rating: 🟢 Good taste - Clean, focused bug fix that solves a real problem
This PR properly addresses the repository skills loading gap with a pragmatic approach:
✅ Clean data flow: Skills are fetched from the workspace root (not ephemeral worktree subdirs), converted to SDK wire format, and injected into the agent context
✅ Appropriate scope: The conversation-scoped skill hooks (useConversationSkills) ensure the slash-command menu and skills modal show exactly what's loaded into that conversation
✅ Robust error handling: getProjectSkills() fails gracefully (returns []) so a skills loading hiccup never blocks conversation creation
✅ Comprehensive tests: Covers SkillInfo→Skill conversion, project-only requests, cloud/error fallbacks, injection into both OpenHands and ACP agent contexts, and a regression guard for workspace root loading
Agent Context Change Note: This PR changes what content is available in agent context (project skills from .agents/skills/ are now loaded). This is a bug fix restoring intended functionality - the skills were designed to load but never did due to the missing wiring. Since this adds repository-specific context to prompts, maintainers may want to run lightweight evals before merging if there's concern about benchmark performance impact.
[RISK ASSESSMENT]
- [Overall PR]
⚠️ Risk Assessment: 🟢 LOW
This is a straightforward bug fix with comprehensive test coverage. The change is additive (doesn't break existing functionality), fails gracefully on errors, and the implementation is clean and well-documented. The only consideration is that it changes agent context content, but it's restoring functionality that should have worked from the start.
VERDICT:
✅ Worth merging: Solid bug fix with clean implementation and thorough testing
KEY INSIGHT:
The workspace root vs. per-conversation worktree distinction (skillsProjectDir vs. workingDir) is critical - the regression test guarding this ensures skills load from the persistent .agents/skills/ directory rather than ephemeral conversation subdirs.
Was this automated review useful? React with 👍 or 👎 to this review to help us measure review quality.
Workflow run: https://github.com/OpenHands/agent-canvas/actions/runs/26227020974
📸 Snapshot Test ReportWarning Snapshot comparison step crashed (timeout, OOM, or runner error) — diff results below may be incomplete or absent. Warning One or more snapshot tests crashed during generation — some snapshots below may be incomplete. ❌ 1 snapshot differ from the main branch baseline. Add the
✅ Unchanged snapshots (72)
Generated by the Snapshot Tests workflow. This comment was created by an AI agent (OpenHands) on behalf of the repo maintainers. |



Summary
Repository skills under
.agents/skills/(e.g. this repo'scustom-codereview-guide.md) were visible on the Skills settings page but never reached conversations: they weren't injected into the agent context, and they didn't appear in the in-conversation/slash-command autocomplete or the skills menu. This wires project skills through both the conversation-start payload and the conversation-scoped skill UIs.Closes #574.
Issue Number
#574
Root cause
AgentContextonly auto-loads user and public skills (load_user_skills/load_public_skills). Verified against the releasedopenhands-sdkv1.23.0 (the versionconfig/defaults.jsonpins):
_load_auto_skills()hardcodesinclude_project=False, and there is noextension_config/ wire field to request project skills for a conversation. So project skills had no path into a conversation at all.use-slash-command.ts) and skills modal both calluseSkills(), which queried the globalgetAgentServerWorkingDir()rather than the conversation's own workspace— so a conversation attached to a repo never listed that repo's skills.
Changes
skills-service.ts: addgetProjectSkills(projectDir?)which loads only project skills and rebuilds the SDKSkillwire shape from the flattenedSkillInfo(reversingSkill.to_skill_info(), reconstructingKeywordTrigger/TaskTrigger).getSkills(projectDir?)gains an optional dir.agent-server-adapter.ts: inject the pre-loaded project skills intoagent_context.skillsat conversation start (valid on both the OpenHands and ACP paths —skillsisacp_compatible).agent-server-conversation-service.api.ts: resolve the skills source as the workspace root (workingDirOverride ?? getAgentServerWorkingDir()), not the per-conversation worktree subdir (which has no.agents/skills/andmay not exist yet at request time).
use-conversation-skills.ts(new): auseConversationSkillshook that scopes the catalog to the active conversation'sselected_workspace. The slash-command hook and skills modal now use it, so the menu lists exactly theproject skills loaded into that conversation.
Testing
npm run typecheck && npm run buildpass (the pre-existing unrelatedinterruptConversationtype error onmainis untouched).SkillInfo→Skillconversion + project-only request, cloud/error fallbacks, injection into the Agent and ACPagent_context,project_dirforwarding, and a regression test that skills load from the workspaceroot (not the per-conversation worktree dir) — verified to fail if the resolution is reverted.
Video/Screenshots
Screen.Recording.2026-05-21.at.14.36.23.mov
Type
Notes
extension_config, this can be replaced by that top-level field andgetProjectSkillsdropped./-prefixed triggers (or AgentSkills-type), which is existing behavior — a keyword-only knowledge skill still won't appear there by design.🐳 Docker images for this PR
• GHCR package: https://github.com/OpenHands/agent-canvas/pkgs/container/agent-canvas
ghcr.io/openhands/agent-canvasghcr.io/openhands/agent-server:1.23.0-pythonopenhands-automation==1.0.0a3ff396f72f83682a57cf12312b9b8f6e39a6ba78cPull (multi-arch manifest)
# Multi-arch manifest — Docker automatically pulls the correct architecture docker pull ghcr.io/openhands/agent-canvas:sha-ff396f7Run
All tags pushed for this build
About Multi-Architecture Support
sha-ff396f7) is a multi-arch manifest supporting both amd64 and arm64sha-ff396f7-amd64) are also available if needed