Scan per-sandbox HOMEs for skill discovery in cloud mode#657
Merged
Conversation
Skill discovery previously scanned a single STORAGE_PATH root in server mode, but the host provider installs CLI skills into per-sandbox HOME dirs (get_host_sandbox_base_dir()/sandbox_id), so the root scan found nothing. Generalize SkillService to accept N home_bases and have the global /skills dependency aggregate every workspace's sandbox HOME and the workspace-resources path scan its own sandbox HOME. - Add Settings.get_host_sandbox_home(sandbox_id) and route the four host_base/sandbox_id call sites through it (config, deps, workspace, host_provider, acp/session). - Order the workspace query by id so duplicate skill names across workspaces resolve to the same sandbox home on every request — list and edit agree, so a PUT can't target a different workspace's skill than the one shown. - Drop the now-dead STORAGE_PATH server default in _default_home_bases; server mode always passes explicit bases. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In cloud (server) mode, skill discovery scanned a single
STORAGE_PATHroot, but the host provider installs CLI skills into per-sandbox HOME dirs (get_host_sandbox_base_dir()/sandbox_id). The root scan therefore matched nothing, so/skillsand/workspaces/{id}/resourcesreturned no skills.This generalizes
SkillServiceto accept Nhome_bases:/skills(global settings) aggregates every workspace's sandbox HOME./workspaces/{id}/resourcesscans that one workspace's sandbox HOME (plus itsworkspace_path).~).Changes
Settings.get_host_sandbox_home(sandbox_id)and route the four duplicatedhost_base / sandbox_idcall sites through it (config,deps,workspace,host_provider,acp/session).idso duplicate skill names across workspaces resolve to the same sandbox home on every request — list and edit agree, so aPUT /skills/{source}/{name}can't target a different workspace's skill than the one shown.STORAGE_PATHserver default in_default_home_bases(server mode always passes explicit bases; desktop returns~).Known limitation (pre-existing, unchanged)
Host-side skill discovery requires the sandbox HOME to live on the host filesystem (host provider). Docker workspaces keep
HOME=/home/userinside the container and bind-mount only the workspace, so CLI-installed skills there are not visible to the API — same as before this change. Exposing Docker skills would need a separate feature (exec-into-container listing or a home volume).Test notes
No automated tests run (repo policy: don't run verification unless asked). The existing skills API tests stub the
get_skill_servicedependency and assert workspace-resources returns a list, so they remain green; they don't exercise provider-specific discovery. Manual reasoning traced in the PR discussion confirms list/edit now resolve to a stable, identical sandbox home.🤖 Generated with Claude Code