Skip to content

promote: test → main (skill installation)#528

Merged
sweetmantech merged 1 commit intomainfrom
test
May 7, 2026
Merged

promote: test → main (skill installation)#528
sweetmantech merged 1 commit intomainfrom
test

Conversation

@sweetmantech
Copy link
Copy Markdown
Contributor

@sweetmantech sweetmantech commented May 7, 2026

Promotes the skill-installation port from test to main.

What lands on main

  • feat(sandbox): port skill installation from open-agents (feat(sandbox): port skill installation from open-agents #527, squash-merged into test as af57348d)
  • 6 new helpers (`shellEscape`, `resolveSandboxHomeDirectory`, `globalSkillRef` schemas, `defaultGlobalSkillRefs`, `installGlobalSkills`, `installSessionGlobalSkills`)
  • Wired into `createSandboxHandler` as best-effort post-provision install

Verification

🤖 Generated with Claude Code


Summary by cubic

Promotes skill installation to main so new session sandboxes auto-install platform defaults plus any user-configured global skills on creation. Installation is best-effort and never blocks sandbox creation.

  • New Features
    • Hooks into createSandboxHandler to run installSessionGlobalSkills after the session update.
    • Adds platform defaults: recoup-api and artist-workspace from recoupable/skills.
    • Validates and dedupes refs with Zod; merges defaults with user global_skill_refs.
    • Runs npx skills add ... in-sandbox with safe quoting and $HOME detection (shellEscape, resolveSandboxHomeDirectory).

Written for commit af57348. Summary will update on new commits.

Closes the second-largest gap identified in the cutover analysis: every
session sandbox now installs the platform default skills (recoup-api,
artist-workspace) plus any user-configured globalSkillRefs from the
session row, so agents come up with their tools loaded.

Best-effort: wraps installSessionGlobalSkills in try/catch inside
createSandboxHandler. A skill-install failure does NOT fail the
sandbox creation request — sandbox + DB stay consistent, agent runs
without skills (or whichever subset got through), and the user can
recover with a follow-up request once the underlying issue is fixed.
Mirrors open-agents' error handling exactly.

New files:
- lib/sandbox/shellEscape.ts — POSIX single-quote escaper
- lib/sandbox/resolveSandboxHomeDirectory.ts — probes $HOME, falls
  back to /root
- lib/skills/globalSkillRef.ts — Zod schema + dedup transform +
  normalizeGlobalSkillRefs (best-effort parse)
- lib/skills/defaultGlobalSkillRefs.ts — recoup-api + artist-workspace
- lib/skills/installGlobalSkills.ts — runs `npx skills add ...` per
  ref via sandbox.exec, throws on first failure
- lib/sandbox/installSessionGlobalSkills.ts — combines defaults + user
  refs, no-op on empty

Wired into lib/sandbox/createSandboxHandler.ts after the session-row
update so the DB write happens first.

TDD red -> green throughout. +22 new unit tests across 6 helper files
covering: shell-escape edge cases (apostrophes, empty, metacharacters),
home-directory probe success/failure/empty fallback, ref schema
validation (owner/repo regex, skillName whitespace), case-insensitive
dedup, normalize on invalid input, default refs constant, install per
ref + dedup + failure throw, session-level wrapper merging defaults +
user refs (rejects whole user array on any invalid item — matches
open-agents). Plus 3 new tests on createSandboxHandler asserting
installSessionGlobalSkills is invoked, that a thrown skill-install
still 200s the response, and that no-sessionId paths skip the install.

Suite: 2534 -> 2559 (+25 net new tests). pnpm lint:check clean.
TS clean for new files (verified via tsc --noEmit; pre-existing TS
errors in lib/tasks and lib/trigger remain on main, unrelated).

What's still missing from the open-agents cutover gap analysis:
- Org base-snapshot warm boot
- Lifecycle workflow kicks (sandbox-created, status-check-overdue)
- Failure-state self-healing in /status
- Transient/unavailable error distinction in /reconnect

Each of these blocks on workflow infra in api or is its own follow-up.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
api Building Building Preview May 7, 2026 6:42pm

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Warning

Rate limit exceeded

@sweetmantech has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 41 minutes and 49 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 17a0b32f-d914-44e9-98e9-c4eaca72a8a1

📥 Commits

Reviewing files that changed from the base of the PR and between 50133c3 and af57348.

⛔ Files ignored due to path filters (7)
  • lib/sandbox/__tests__/createSandboxHandler.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/sandbox/__tests__/installSessionGlobalSkills.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/sandbox/__tests__/resolveSandboxHomeDirectory.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/sandbox/__tests__/shellEscape.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/skills/__tests__/defaultGlobalSkillRefs.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/skills/__tests__/globalSkillRef.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/skills/__tests__/installGlobalSkills.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
📒 Files selected for processing (7)
  • lib/sandbox/createSandboxHandler.ts
  • lib/sandbox/installSessionGlobalSkills.ts
  • lib/sandbox/resolveSandboxHomeDirectory.ts
  • lib/sandbox/shellEscape.ts
  • lib/skills/defaultGlobalSkillRefs.ts
  • lib/skills/globalSkillRef.ts
  • lib/skills/installGlobalSkills.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sweetmantech sweetmantech merged commit 0e4ac9c into main May 7, 2026
5 of 6 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