Skip to content

fix: let remote Codex app-servers use library skills instead of an unreadable Gateway path - #201491

Merged
freeqaz merged 3 commits into
mainfrom
fix/codex-remote-library-skill-location
Nov 19, 2026
Merged

freeqaz merged 3 commits into
mainfrom
fix/codex-remote-library-skill-location

Conversation

@freeqaz

@freeqaz freeqaz commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

With a remote Codex app-server (appServer.remoteWorkspaceRoot), the skills list shown to the model gives each Skill Library skill a location in the Gateway's state directory (<state>/skill-library/<id>/revisions/<rev>/SKILL.md). The model reads skills with Codex's own file tools on the remote machine, where that path does not exist, so the read fails and the skill is silently not followed.

User Impact

User impact: on a remote Codex app-server, library skills are listed with a pointer to skills_read (which reads the pinned revision on the Gateway) instead of a path the model cannot open. When skills_read is not offered, library skills stay listed by name and description with a note that their instructions cannot be read on this machine, instead of a broken path. Local app-servers (a child of the Gateway) and every other placement are unchanged.

Why This Change Was Made

The Codex extension passes the core skills catalog through as is. When the app-server is remote, it now finds the Skill Library entries by name (from the snapshot's resolved skills) and replaces their <location> line with a <location_note>: one that names skills_read, or, without skills_read, one that says the instructions cannot be read on this machine.

Library skills that a remote-exec placement has already copied into the worker workspace keep their location: the snapshot lists them at that copy, under remoteWorkspaceRoot, where the app-server can read them.

Entries are matched by name, not by path: the rendered catalog shows home-compacted paths (~/.openclaw/...) while the snapshot keeps canonical ones. The change adjusts the rendered catalog rather than re-rendering it, because the catalog is built and budgeted in core before the harness runs; re-rendering it in the extension would duplicate that budget and path compaction.

Without skills_read the options were inlining each SKILL.md body, dropping the entry, or keeping it with a note. Inlining would read every pinned body from Gateway disk on every turn (the catalog keeps only a content hash) and grow the prompt with instructions the turn may never use. Dropping hides a skill the user pinned. The note is one line per entry and tells the model, and through it the user, why the skill cannot be followed. Other skill sources keep their locations.

Accepted limits: only SKILL.md is reachable this way. Supporting files of a library skill are still not delivered to a remote app-server; that would need a copy step and is left for a follow-up.

Evidence

A new fake app-server test runs a full attempt with a library skill and a workspace skill and checks the developer instructions sent on thread/start, for a remote app-server with skills_read, a remote one without it, a remote one whose library skill was already copied into its workspace (no skills_read), and a local one. The catalog in the test shows the library skill at a home-compacted path while the snapshot keeps the canonical path, as production snapshots do. (The production snapshot builder is core code that extension tests cannot import without a new SDK export, so the test reproduces its output shape.)

  • With the fix: all four cases pass; the existing skill-read bridge tests (dynamic-tool-skills.test.ts) still pass.
  • On main, and on this PR's first head (which matched by path), the two Gateway-path remote cases fail (the compacted Gateway path is still listed). On the previous head (which rewrote every library entry), the copied-skill case fails (its readable location was replaced by the note).
  • oxfmt --check and oxlint on the touched files, pnpm tsgo:extensions and pnpm tsgo:extensions:test: clean.
Commands

Run on a remote test VM from a snapshot of main (c5ef395) plus this change:

CI=true pnpm test extensions/codex/src/app-server/run-attempt.remote-skills.test.ts extensions/codex/src/app-server/dynamic-tool-skills.test.ts --maxWorkers=1   # 7 passed
git checkout HEAD~1 -- extensions/codex/src/app-server/attempt-context.ts extensions/codex/src/app-server/run-attempt-context.ts
CI=true pnpm test extensions/codex/src/app-server/run-attempt.remote-skills.test.ts --maxWorkers=1   # fails on main and on earlier heads, see above

This patch has not been run against a live remote app-server and model. The problem itself on a real install, with the catalog listing the Gateway path, cat failing with ENOENT on the remote machine, and skills_read by name working once the tool is allowed: openclaw/openclaw-enterprise#6509 (comment)

…vers

A remote Codex app-server reads skills with its own file tools, so a Skill
Library pin listed at its Gateway state path cannot be opened there. With
remoteWorkspaceRoot set, library entries now point at skills_read when it is
offered, and are left out of the catalog when it is not. Local app-servers
are unchanged.
@clawsweeper

clawsweeper Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 18, 2026
@clawsweeper

clawsweeper Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR replaces inaccessible Gateway library-skill paths with remote loading guidance while preserving skills already copied into the remote workspace.

Example: A remote Codex app-server lists the pinned release-guide skill with skills_read available.

  • Before: The catalog points to ~/.openclaw/skill-library/id-1/revisions/rev-1/SKILL.md, which does not exist remotely.
  • After: The catalog directs Codex to read release-guide through skills_read.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused patch resolves the known code findings, but its user-visible behavior has only fake-app-server proof.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A remote Codex agent sees a pinned library skill but attempts to open its instructions at an unavailable Gateway filesystem path.
Reason: The change repairs misleading loading instructions using an existing tool, preserves readable copies and local behavior, and adds no configuration or public API.

Merge readiness

✅ Ready for maintainer review

This PR addresses a current remote skill-loading defect and resolves both earlier findings; no actionable code defect remains in the reviewed diff.

Priority: P2
Reviewed head: bdd5ef8d2971288f5f559927b5a13e4e523fccfa

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Provide redacted live Gateway-to-remote-Codex output on this head showing a pinned library skill read through skills_read and the unavailable-instructions guidance when that tool is denied.
Agent review details

How this fits together

The Codex plugin receives the Gateway's prepared skill catalog and available tools, adapts its loading guidance, and sends it through the existing native instruction carrier.

flowchart LR
  A[Gateway skill snapshot] --> B[Codex instruction renderer]
  C[Remote workspace and available tools] --> B
  B --> D[Native Codex instructions]
  D --> E[Remote model]
  E --> F[Gateway skills_read]
  E --> G[Delivered workspace files]
Loading

Technical review

Best possible solution:

Adapt inaccessible library locations in the existing Codex instruction renderer while retaining the canonical catalog, host reader, and delivered workspace copies.

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

Current-main catalog forwarding and production snapshot construction establish the inaccessible-path case, corroborated by the linked real-install ENOENT trace; no target code was executed during this review.

Is this the best way to solve the issue?

The focused adapter preserves existing catalog budgeting and skill-read authority, and its separate helper has a clear rendering responsibility without adding state or a competing delivery owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 0b18f610d325.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Raw commit b5b1029 adds extensions/codex/src/app-server/attempt-context.ts:405 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b5b1029990fd; files: extensions/codex/src/app-server/attempt-context.ts)
  • Dmitry Golubev: Raw commit 7f5697b adds extensions/codex/src/app-server/attempt-context.ts:476 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 7f5697b3bf9d; files: extensions/codex/src/app-server/attempt-context.ts)
  • Colton Harris: Raw commit b875c53 adds extensions/codex/src/app-server/run-attempt-context.ts:185 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b875c537be3b; files: extensions/codex/src/app-server/run-attempt-context.ts)

PR surface

Source +53, Tests +73. Total +126 across 4 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 2 54 1 +53
Tests 2 73 0 +73
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 127 1 +126

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Pinned library instructions can be missed on remote Codex deployments, with limited impact outside that placement.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-11-18T22:41:14.385Z sha 294a03e :: needs changes before merge. :: [P2] [P2] Match library entries independently of compacted prompt paths
  • reviewed 2026-11-18T23:33:08.088Z sha 99c3c54 :: needs changes before merge. :: [P2] [P2] Preserve locations for skills already delivered to the worker

Reviewed November 18, 2026, 7:56 PM ET / November 19, 2026, 00:56 UTC (Revision 3).

The skills catalog renders home-compacted paths (~/...) while the snapshot keeps
canonical paths, so matching location strings missed library entries on a
normal install. Library entries are now matched by name. When skills_read is
not offered, the entry stays listed with a note that its instructions cannot be
read on this machine instead of being dropped.
@freeqaz

freeqaz commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Nov 18, 2026
A remote-exec placement copies pinned skills into the worker workspace before
the turn and lists them at that copy, which the remote app-server can read.
Only library entries outside remoteWorkspaceRoot are rewritten now.
@freeqaz

freeqaz commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Nov 19, 2026
@freeqaz
freeqaz merged commit 44f24d8 into main Nov 19, 2026
125 of 127 checks passed
@freeqaz
freeqaz deleted the fix/codex-remote-library-skill-location branch November 19, 2026 01:03
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 19, 2026
…readable Gateway path (openclaw#201491)

* fix(codex): keep Gateway-only library skill paths from remote app-servers

A remote Codex app-server reads skills with its own file tools, so a Skill
Library pin listed at its Gateway state path cannot be opened there. With
remoteWorkspaceRoot set, library entries now point at skills_read when it is
offered, and are left out of the catalog when it is not. Local app-servers
are unchanged.

* fix(codex): match remote library skills by name and keep them listed

The skills catalog renders home-compacted paths (~/...) while the snapshot keeps
canonical paths, so matching location strings missed library entries on a
normal install. Library entries are now matched by name. When skills_read is
not offered, the entry stays listed with a note that its instructions cannot be
read on this machine instead of being dropped.

* fix(codex): keep library skills already copied into the remote workspace

A remote-exec placement copies pinned skills into the worker workspace before
the turn and lists them at that copy, which the remote app-server can read.
Only library entries outside remoteWorkspaceRoot are rewritten now.
RomneyDa added a commit that referenced this pull request Nov 19, 2026
…readable Gateway path (#201491)

* fix(codex): keep Gateway-only library skill paths from remote app-servers

A remote Codex app-server reads skills with its own file tools, so a Skill
Library pin listed at its Gateway state path cannot be opened there. With
remoteWorkspaceRoot set, library entries now point at skills_read when it is
offered, and are left out of the catalog when it is not. Local app-servers
are unchanged.

* fix(codex): match remote library skills by name and keep them listed

The skills catalog renders home-compacted paths (~/...) while the snapshot keeps
canonical paths, so matching location strings missed library entries on a
normal install. Library entries are now matched by name. When skills_read is
not offered, the entry stays listed with a note that its instructions cannot be
read on this machine instead of being dropped.

* fix(codex): keep library skills already copied into the remote workspace

A remote-exec placement copies pinned skills into the worker workspace before
the turn and lists them at that copy, which the remote app-server can read.
Only library entries outside remoteWorkspaceRoot are rewritten now.

(cherry picked from commit 44f24d8)

Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to clawhaven/openclaw that referenced this pull request Nov 23, 2026
…readable Gateway path (openclaw#201491)

* fix(codex): keep Gateway-only library skill paths from remote app-servers

A remote Codex app-server reads skills with its own file tools, so a Skill
Library pin listed at its Gateway state path cannot be opened there. With
remoteWorkspaceRoot set, library entries now point at skills_read when it is
offered, and are left out of the catalog when it is not. Local app-servers
are unchanged.

* fix(codex): match remote library skills by name and keep them listed

The skills catalog renders home-compacted paths (~/...) while the snapshot keeps
canonical paths, so matching location strings missed library entries on a
normal install. Library entries are now matched by name. When skills_read is
not offered, the entry stays listed with a note that its instructions cannot be
read on this machine instead of being dropped.

* fix(codex): keep library skills already copied into the remote workspace

A remote-exec placement copies pinned skills into the worker workspace before
the turn and lists them at that copy, which the remote app-server can read.
Only library entries outside remoteWorkspaceRoot are rewritten now.

(cherry picked from commit 44f24d8)
Release adaptation: approved 2026.11.7 models replay; see models-hook-safe-v2/REPORT.md.
Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: codex P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S 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