Skip to content

fix(agents): rebuild sandbox skill prompts from sandbox workspace#77661

Merged
sallyom merged 1 commit into
openclaw:mainfrom
sallyom:fix/sandbox-skill-paths-50590
May 5, 2026
Merged

fix(agents): rebuild sandbox skill prompts from sandbox workspace#77661
sallyom merged 1 commit into
openclaw:mainfrom
sallyom:fix/sandbox-skill-paths-50590

Conversation

@sallyom

@sallyom sallyom commented May 5, 2026

Copy link
Copy Markdown
Contributor

Summary:

Fixes #50590
Fixes #43383

Tests:

  • pnpm check
  • git diff --check origin/main..HEAD
  • pnpm test src/agents/pi-embedded-runner/run/attempt.spawn-workspace.context-engine.test.ts -t "rebuilds skill prompt inputs"
  • pnpm test src/agents/pi-embedded-runner/run/attempt.spawn-workspace.context-engine.test.ts -t "sends transcriptPrompt visibly"

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels May 5, 2026
@clawsweeper

clawsweeper Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

Summary
The branch ignores saved skill snapshots for sandboxed non-rw embedded attempt and direct compaction runs, adds a context-engine regression test, and moves related changelog entries to Unreleased/Fixes.

Reproducibility: no. live high-confidence reproduction was established in this read-only review. Source inspection gives a clear current-main path: non-rw sandbox runs use the sandbox workspace while snapshot prompt/env data can still come from host-path skill snapshots.

Real behavior proof
Needs real behavior proof before merge: The PR body reports checks and targeted tests, but does not show after-fix behavior from a real sandboxed non-rw run.

Next step before merge
This automerge PR needs contributor or maintainer real behavior proof before merge; there is no narrow code repair finding for ClawSweeper to apply.

Security
Cleared: The diff does not introduce dependency, workflow, permissions, or supply-chain changes, and it narrows sandbox prompt path exposure rather than broadening sandbox access.

Review details

Best possible solution:

Land this PR after maintainer review, green CI/Testbox, and real sandbox output showing <available_skills> points at the sandbox workspace copy for non-rw runs.

Do we have a high-confidence way to reproduce the issue?

No live high-confidence reproduction was established in this read-only review. Source inspection gives a clear current-main path: non-rw sandbox runs use the sandbox workspace while snapshot prompt/env data can still come from host-path skill snapshots.

Is this the best way to solve the issue?

Yes, the code direction appears to be the narrowest maintainable fix: bypass saved snapshots only for sandboxed non-rw runs and keep existing snapshot behavior elsewhere. Merge should still wait for real behavior proof and normal validation.

Acceptance criteria:

  • pnpm test src/agents/pi-embedded-runner/run/attempt.spawn-workspace.context-engine.test.ts -t "rebuilds skill prompt inputs"
  • pnpm test src/agents/pi-embedded-runner/run/attempt.spawn-workspace.context-engine.test.ts -t "sends transcriptPrompt visibly"
  • git diff --check origin/main..HEAD
  • pnpm check

What I checked:

  • Current main reuses snapshot in sandbox attempts: Current main switches non-rw sandbox attempts to effectiveWorkspace, but still passes params.skillsSnapshot into skill entry resolution, env setup, and prompt resolution. (src/agents/pi-embedded-runner/run/attempt.ts:716, 70f34bf1779c)
  • Current main reuses snapshot in direct compaction: The direct compaction path has the same shape: it uses effectiveWorkspace while continuing to use params.skillsSnapshot for entries, env overrides, and prompt resolution. (src/agents/pi-embedded-runner/compact.ts:579, 70f34bf1779c)
  • Snapshot prompt has precedence: resolveSkillsPromptForRun returns a non-empty snapshot prompt before rebuilding from current workspace skill entries, which explains how host-only skill locations survive the sandbox workspace switch. (src/agents/skills/workspace.ts:1032, 70f34bf1779c)
  • Sandbox skill copy is available: For non-rw sandbox workspace access, sandbox context setup syncs eligible skills from the agent workspace into the sandbox workspace before returning that workspace for the run. (src/agents/sandbox/context.ts:45, 70f34bf1779c)
  • PR applies the narrow bypass: The remote PR diff introduces skillsSnapshotForRun and sets it to undefined only when sandboxing is enabled with workspace access other than rw, preserving snapshot behavior otherwise. (src/agents/pi-embedded-runner/run/attempt.ts:713, 9db6f4f1e382)
  • Real behavior proof missing: The PR body lists pnpm check, git diff --check, and targeted tests, but it does not include terminal output, logs, screenshots, or other after-fix proof from an actual sandboxed non-rw run. (9db6f4f1e382)

Likely related people:

  • vincentkoc: Local blame on the affected attempt, compaction, skills prompt, and sandbox sync paths points to commit b378a91, and related recent skills work is also by Vincent Koc. (role: current path maintainer; confidence: high; commits: b378a912573e, a093b5b2de98; files: src/agents/pi-embedded-runner/run/attempt.ts, src/agents/pi-embedded-runner/compact.ts, src/agents/skills/workspace.ts)
  • steipete: Recent current-main history on the embedded runner includes adjacent changes to runtime tool allowlists and post-compaction guard wiring near this surface. (role: recent adjacent maintainer; confidence: medium; commits: 25b30c95200d, 1af6855bb0a6; files: src/agents/pi-embedded-runner/run/attempt.ts, src/agents/pi-embedded-runner/compact.ts)
  • zhangguiping-xydt: Recent merged work changed plugin-declared skill discovery paths, adjacent to the skill entry and prompt discovery surface involved here. (role: adjacent skills discovery owner; confidence: low; commits: 1df2ac442a75; files: src/agents/skills/workspace.ts)

Remaining risk / open question:

  • This read-only review did not run the PR’s targeted tests, pnpm check, or a live sandbox scenario.
  • The PR still needs after-fix real behavior proof showing a sandboxed non-rw run no longer exposes host-only skill paths.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 70f34bf1779c.

@sallyom
sallyom force-pushed the fix/sandbox-skill-paths-50590 branch 4 times, most recently from 3d4f1a3 to 9db6f4f Compare May 5, 2026 04:44
@sallyom

sallyom commented May 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper automerge

@clawsweeper clawsweeper Bot added the clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge label May 5, 2026
@clawsweeper

clawsweeper Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper automerge is enabled.

  • Head: 9db6f4f1e382
  • Label: clawsweeper:automerge
  • Action: exact-head review queued (workflow sweep.yml, event repository_dispatch).
  • Flow: review this head, repair/rebase only if needed, then re-review the exact repaired head before merge.

Draft PRs stay fix-only until GitHub marks them ready for review. Pause with /clawsweeper stop.

Automerge progress:

  • 2026-05-05 04:48:34 UTC review queued 9db6f4f1e382 (queued)

@clawsweeper clawsweeper Bot added the clawsweeper:human-review Needs maintainer review before ClawSweeper can continue label May 5, 2026
@clawsweeper

clawsweeper Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

🦞✅
ClawSweeper is pausing this repair loop for human review.

Source: clawsweeper[bot]
Reason: This automerge PR needs contributor or maintainer real behavior proof before merge; there is no narrow code repair finding for ClawSweeper to apply.; Cleared: The diff does not introduce dependency, workflow, permissions, or supply-chain changes, and it narrows sandbox prompt path exposure rather than broadening sandbox access. (sha=9db6f4f1e382e3df75ffb3de87ad815218f27de9)

I added clawsweeper:human-review and left the final call with a maintainer.

@sallyom
sallyom force-pushed the fix/sandbox-skill-paths-50590 branch from 9db6f4f to 2c7c63c Compare May 5, 2026 05:01
@sallyom sallyom added proof: override Maintainer override for the external PR real behavior proof gate. and removed clawsweeper:human-review Needs maintainer review before ClawSweeper can continue labels May 5, 2026
@sallyom
sallyom merged commit 349ce00 into openclaw:main May 5, 2026
114 of 115 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
@sallyom
sallyom deleted the fix/sandbox-skill-paths-50590 branch May 29, 2026 15:15
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge maintainer Maintainer-authored PR proof: override Maintainer override for the external PR real behavior proof gate. size: S

Projects

None yet

1 participant