fix(skills): install the renamed global skills into sandboxes (chat#1815)

Merged
SW
4mo ago
+36-13

The bug

Scheduled "send an email" tasks complete but deliver nothing. A diagnostic run of the "Daily Hello World Email" task (wrun_01KW0535…) shows the agent makes zero tool calls and replies "I don't have a tool to send emails."

The POST /api/emails endpoint, auth, ephemeral key, and recipient gate (api#708, on prod) all work — verified directly. The real problem: the sandbox agent never receives the recoup-api playbook.

Root cause

lib/skills/defaultGlobalSkillRefs.ts installs two skills by name:

{ source: "recoupable/skills", skillName: "recoup-api" },        // ❌ renamed
{ source: "recoupable/skills", skillName: "artist-workspace" },  // ❌ renamed/split

Both names were renamed in recoupable/skills (→ recoup-platform-api-access, and artist-workspace split into roster/platform skills). installGlobalSkills runs:

npx skills add recoupable/skills --skill recoup-api ...

which fails on the unknown name and throws (caught best-effort) → no platform skills land in the sandbox. So the agent has no /api/emails instructions and falls back to "I have no email tool." This breaks all platform-skill loading in sandboxes (interactive runs too), not just email.

Fix

  • defaultGlobalSkillRefs.ts → current slugs: recoup-platform-api-access, recoup-platform-build-workspace, recoup-roster-add-artist, recoup-roster-list-artists, recoup-roster-manage-artist (restores the old recoup-api + artist-workspace coverage, now split — all five confirmed present in recoupable/skills).
  • recoupApiSkillPrompt.ts → update the skill names the nudge tells the agent to load, and add send-email / deliver-report to the triggers so the agent reaches for recoup-platform-api-access on email tasks.

Verification

569 tests green (updated defaultGlobalSkillRefs.test.ts to assert the new slugs + guard against the legacy names); tsc 0 new errors; lint clean.

End-to-end re-test (scheduled "Daily Hello World Email" → delivered email) to run once this is on a preview/prod, since the install only happens at real sandbox creation.

Tracked on chat#1815.

🤖 Generated with Claude Code


Summary by cubic

Fixes broken platform skill installs in sandboxes by switching to the renamed recoupable/skills slugs. Restores email sending (POST /api/emails) and other platform actions so scheduled tasks and interactive runs make the right tool calls.

  • Bug Fixes
    • Replaced legacy recoup-api and artist-workspace with recoup-platform-api-access, recoup-platform-build-workspace, and recoup-roster-{add,list,manage}-artist in DEFAULT_GLOBAL_SKILL_REFS.
    • Updated the always-on nudge in recoupApiSkillPrompt to reference the new slugs and call out send-email/deliver-report so the agent loads recoup-platform-api-access.
    • Adjusted tests to assert the new slugs and guard against legacy names.