Skip to content

Scan per-sandbox HOMEs for skill discovery in cloud mode#657

Merged
Mng-dev-ai merged 1 commit into
mainfrom
fix/skill-discovery-per-sandbox-homes
Jun 21, 2026
Merged

Scan per-sandbox HOMEs for skill discovery in cloud mode#657
Mng-dev-ai merged 1 commit into
mainfrom
fix/skill-discovery-per-sandbox-homes

Conversation

@Mng-dev-ai

Copy link
Copy Markdown
Owner

Summary

In cloud (server) mode, skill discovery scanned a single STORAGE_PATH root, 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 /skills and /workspaces/{id}/resources returned no skills.

This generalizes SkillService to accept N home_bases:

  • /skills (global settings) aggregates every workspace's sandbox HOME.
  • /workspaces/{id}/resources scans that one workspace's sandbox HOME (plus its workspace_path).
  • Desktop mode is unchanged (single real ~).

Changes

  • Add Settings.get_host_sandbox_home(sandbox_id) and route the four duplicated 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 /skills/{source}/{name} 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; 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/user inside 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_service dependency 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

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>
@Mng-dev-ai Mng-dev-ai merged commit 005c806 into main Jun 21, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant