Skip to content

fix(worker): remote skills use the wrong filesystem paths - #138091

Merged
steipete merged 2 commits into
mainfrom
codex/worker-skill-execution-paths
Sep 4, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/worker-skill-execution-paths

Conversation

@steipete

@steipete steipete commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Remote-exec skill bundles were copied to the worker, but the skill catalog still listed the Gateway's original SKILL.md. Ordinary skill invocation could therefore read or execute from the Gateway path, which is unavailable on a separate machine. Explicit skill references also retained that source path.

This was found while live-testing the cleanup repair in #137800. The path mismatch predates that repair: the parent-relative patch for #134068 introduced the original-path-plus-remote-note representation, and it is present in stable v2026.9.1.

Why This Change Was Made

The transfer owner now gives the turn one location: the verified worker copy. Catalog entries use its file and directory, Code Mode reads the same prepared instruction bytes, and dispatch remaps explicit references with the existing sandbox path helper. Original source metadata remains provenance. The contradictory location note is removed; generic guidance tells the model to read the listed file without assuming a particular tool name.

This follows the existing worker materialization and sandbox ownership boundary. Registering remote files in Codex's shared skill catalog or adding a second resolver would create another state owner without fixing the incorrect turn snapshot.

User Impact

Named and explicit skill invocation use the current worker copy, including relative scripts and resources. Gateway source edits affect later turns. No SQLite, schema, migration, configuration, protocol, or dependency changes.

Production delta: +16 lines net, covering the remote projection and reuse of the existing explicit-reference mapping. Tests exercise both SSH and node transfer, ordinary sandbox behavior, original-source immutability, prepared reads after source edits, and actual harness dispatch.

Evidence

  • Before the fix, six SSH/node transfer cases and one actual-dispatch case failed because they received the Gateway path instead of the worker path.
  • 60 focused regression and sibling tests passed. The full changed gate passed, including core/core-test/root-test typechecks, lint, database guards and import-cycle checks.
  • Real Gateway + paired-node + openai/gpt-5.6-luna proof passed on f7d63dd6867cf4094c2b905a1a1a8fd486b7ec7a: ordinary named invocation and explicit $skill invocation used the worker copy while the Gateway source directory was hidden. Both read 168,000 verified bytes with SHA-256 d4bad64fd45be27881187c6d782515eacfe6f485e1fe0b880f036e3759d1f493; executable mode and node process ancestry passed. Normal cleanup removed the allocation. An actual moved allocation caused visible cleanup failure, then a no-skill turn reclaimed it while preserving attachment and project sentinels.
  • Live command: OPENCLAW_LIVE_TEST=1 OPENCLAW_E2E_USE_PREBUILT_DIST=1 node scripts/run-vitest.mjs run --config test/vitest/vitest.live.config.ts test/e2e/qa-lab/runtime/worker-skill-resources.live.test.ts. Backend: Blacksmith Testbox tbx_01m1nskj34rac1dnccadp1br0n; run, command exit 0, test 59.44 seconds. Testbox teardown can show the linked workflow as cancelled; the wrapper command result is the live verdict.
  • The first live attempt stopped before model execution because the fixture dispatched before runner inventory advertised session hosting. The final fixture waits for the existing sessionHost readiness signal; the rerun passed. Test-only lint findings were also fixed.
  • Fresh independent Codex reviews of the production candidate and final fixture corrections: no actionable P0–P2 findings.
  • Upstream contracts inspected directly: Codex codex-rs/ext/skills/src/tools/read.rs uses package catalog identity; codex-rs/ext/skills/src/selection.rs resolves explicit selections by exact catalog path. Existing OpenClaw Codex input handling omits unavailable native catalog selections and retains prompt guidance.

Related: #137800.

Maintainer review resolution

ClawSweeper identified no actionable code or security findings and accepted the real-behavior proof. Its sole merge-risk item is the +16 production lines. Accepted: those lines are limited to projecting the already-transferred skill's file/base path and verified instruction bytes (+6 net), and reusing the existing dispatcher/sandbox reference mapper (+10 net). The requested mitigation is already implemented: one per-turn snapshot and one worker-copy identity, with Gateway source retained only as provenance. A net-zero variant would leave either conflicting catalog paths or unremapped explicit references; adding another catalog/resolver would be less simple. No new state owner, configuration, schema, or fallback path was introduced.

Final-head CI passed on f7d63dd6867cf4094c2b905a1a1a8fd486b7ec7a.

@clawsweeper

clawsweeper Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review September 4, 2026 08:34
@steipete steipete self-assigned this Sep 4, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: L maintainer Maintainer-authored PR labels Sep 4, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 4, 2026, 5:14 AM ET / 09:14 UTC.

ClawSweeper review

What this changes

The PR makes remote-worker skill catalogs and explicit skill references point to the worker’s transferred copy rather than the Gateway source path.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: current main still exposes Gateway source paths to remote-worker skill selection, while this PR repairs that mismatch at the transfer and dispatch boundaries with matching coverage.

Priority: P1
Reviewed head: f7d63dd6867cf4094c2b905a1a1a8fd486b7ec7a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The repair has source-aligned paired-worker coverage and a focused owner-boundary implementation.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The reported paired Gateway/node proof is source-aligned with the checked-in live scenario, which exercises transferred skills through the real worker boundary.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The reported paired Gateway/node proof is source-aligned with the checked-in live scenario, which exercises transferred skills through the real worker boundary.
Evidence reviewed 9 items Current-main catalog mismatch: Current main mounts each source directory remotely but retains the selected skill's Gateway file path and only adds a remote-location note, leaving the catalog identity inconsistent with the worker copy.
Current-main explicit selection mismatch: Current main creates path mappings only when no read-only worker mounts exist, then forwards explicit skill selections without remapping them.
Transfer-owner repair: The transfer owner projects each selected skill into the worker namespace, retains source provenance, caches verified instructions, and renders the prompt from that revised snapshot.
Findings None None.
Security None None.

How this fits together

The Gateway transfers selected skills into a remote worker for each turn. That transferred snapshot feeds Code Mode and explicit skill selection during the worker run.

flowchart LR
  A[Gateway skill selection] --> B[Per-turn resource transfer]
  B --> C[Worker-copy catalog]
  C --> D[Code Mode selection]
  D --> E[Remote worker run]
Loading

Before merge

  • Resolve merge risk (P1) - Production code grows by 16 net lines (+24/−8); the added per-turn projection and explicit-reference mapping are necessary for one canonical worker-copy identity, but should remain limited to this owner boundary.
Agent review details

Security

None.

PR surface

Source +16, Tests +460, Docs +2. Total +478 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 4 24 8 +16
Tests 3 470 10 +460
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 496 18 +478

Review metrics

Metric Value Why it matters
Production vs test LOC production +16 net (+24/−8); tests +460 net (+470/−10) The production increase implements the canonical worker-path projection and explicit-reference mapping; transfer, dispatch, and paired-node coverage exercise it.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep one transferred per-turn snapshot whose catalog and explicit references name the worker copy, retaining the Gateway source only as provenance.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep one transferred per-turn snapshot whose catalog and explicit references name the worker copy, retaining the Gateway source only as provenance.

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

Yes, source-reproducible: current main retains Gateway source paths in the transferred catalog and forwards explicit selections unchanged despite mounting worker copies; the read-only review did not rerun the live scenario.

Is this the best way to solve the issue?

Yes: projecting the catalog at the transfer owner and mapping explicit selections from the same mounts establishes one worker-copy identity without duplicate catalog state.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against b8cdd65bdf61.

Labels

Label changes:

  • add P1: Remote-worker skill selection is a broken agent workflow with a bounded but real user impact.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The reported paired Gateway/node proof is source-aligned with the checked-in live scenario, which exercises transferred skills through the real worker boundary.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The reported paired Gateway/node proof is source-aligned with the checked-in live scenario, which exercises transferred skills through the real worker boundary.

Label justifications:

  • P1: Remote-worker skill selection is a broken agent workflow with a bounded but real user impact.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The reported paired Gateway/node proof is source-aligned with the checked-in live scenario, which exercises transferred skills through the real worker boundary.
  • proof: sufficient: Contributor real behavior proof is sufficient. The reported paired Gateway/node proof is source-aligned with the checked-in live scenario, which exercises transferred skills through the real worker boundary.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • fuller-stack-dev: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 7abb0ec into main Sep 4, 2026
189 checks passed
@steipete
steipete deleted the codex/worker-skill-execution-paths branch September 4, 2026 09:19
@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 5, 2026
…38091)

* fix(worker): remote skills use the wrong filesystem paths

* test(worker): wait for session hosting before live dispatch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant