-
Notifications
You must be signed in to change notification settings - Fork 4
fix: sandbox reliability — push org changes, skip redundant setup #140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sidneyswift
wants to merge
8
commits into
main
Choose a base branch
from
fix/push-org-repos-gitlink-detection
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a0bd51f
fix: detect gitlink files when pushing org repos
sidneyswift 692975a
test: add regression test for gitlink detection in pushOrgRepos
sidneyswift 9ad9255
fix: skip setup when sandbox already provisioned, remove setup-artist
sidneyswift 74edc58
chore: trigger CI
sidneyswift f7e74b3
fix: use absolute path for setup skip check
sidneyswift d3e0ad1
debug: add logging to pushOrgRepos to diagnose find failure
sidneyswift d6d45d2
fix: clone org repos deterministically instead of via AI agent
sidneyswift 274405e
refactor: scope PR to skills consolidation only
sidneyswift File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| import type { Sandbox } from "@vercel/sandbox"; | ||
| import { logger } from "@trigger.dev/sdk/v3"; | ||
|
|
||
| /** | ||
| * Installs all skills from a skills.sh repo into the OpenClaw workspace. | ||
| * | ||
| * Runs `npx skills add <source> -y` which installs to .agents/skills/, | ||
| * then copies everything to ~/.openclaw/workspace/skills/ so OpenClaw | ||
| * discovers them natively. | ||
| * | ||
| * @param sandbox - The Vercel Sandbox instance | ||
| * @param source - The skills.sh source (e.g. "recoupable/skills") | ||
| */ | ||
| export async function installSkills( | ||
| sandbox: Sandbox, | ||
| source: string | ||
| ): Promise<void> { | ||
| logger.log("Installing skills via skills.sh", { source }); | ||
|
|
||
| const install = await sandbox.runCommand({ | ||
| cmd: "npx", | ||
| args: ["skills", "add", source, "-y"], | ||
| }); | ||
|
|
||
| const installStdout = (await install.stdout()) || ""; | ||
| const installStderr = (await install.stderr()) || ""; | ||
|
|
||
| logger.log("skills.sh install result", { | ||
| exitCode: install.exitCode, | ||
| stdout: installStdout, | ||
| stderr: installStderr, | ||
| }); | ||
|
|
||
| if (install.exitCode !== 0) { | ||
| logger.warn("Skills install failed, continuing without them", { | ||
| source, | ||
| stderr: installStderr, | ||
| }); | ||
| return; | ||
| } | ||
|
|
||
| const copy = await sandbox.runCommand({ | ||
| cmd: "sh", | ||
| args: [ | ||
| "-c", | ||
| "mkdir -p ~/.openclaw/workspace/skills && cp -r .agents/skills/* ~/.openclaw/workspace/skills/", | ||
| ], | ||
| }); | ||
|
|
||
| const copyStderr = (await copy.stderr()) || ""; | ||
|
|
||
| if (copy.exitCode !== 0) { | ||
| logger.warn("Failed to copy skills to OpenClaw workspace, continuing without them", { | ||
| source, | ||
| stderr: copyStderr, | ||
| }); | ||
| return; | ||
| } | ||
|
|
||
| logger.log("Skills installed to OpenClaw workspace", { source }); | ||
| } | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fail fast when required skill setup fails.
In the current
ensureSetupSandboxflow, returning here means we still try to run/setup-sandboxwithout the skills being available in OpenClaw. That turns an install/copy failure into a later agent failure and hides the real cause.Proposed fix
if (install.exitCode !== 0) { - logger.warn("Skills install failed, continuing without them", { + logger.error("Skills install failed", { source, stderr: installStderr, }); - return; + throw new Error(`Failed to install skills from ${source}`); } @@ if (copy.exitCode !== 0) { - logger.warn("Failed to copy skills to OpenClaw workspace, continuing without them", { + logger.error("Failed to copy skills to OpenClaw workspace", { source, stderr: copyStderr, }); - return; + throw new Error("Failed to copy skills to OpenClaw workspace"); }📝 Committable suggestion
🤖 Prompt for AI Agents