Skip to content

feat(agents): expose installed skill search across harnesses - #158091

Merged
vincentkoc merged 9 commits into
mainfrom
feat/installed-skill-harnesses
Oct 1, 2026
Merged

vincentkoc merged 9 commits into
mainfrom
feat/installed-skill-harnesses

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Eligible installed skills outside the prompt budget cannot be discovered reliably. Runtime exposure must preserve tool policy, sandbox placement, and skill-use accounting.

Related: #61740
Related prior proposal: #75871

Why This Change Was Made

Bind the prepared catalog to its filesystem owner and effective sandbox placement. Route Code Mode search/read through normal tool dispatch, gate listing on admitted search access, and record successful reads with their original provenance.

Prompt guidance follows the actual tool surface. A known skill can be read directly without a mandatory search. The host retains its captured admitted catalog; a plugin-supplied read snapshot cannot enlarge that authority.

User Impact

Agents can use skills_search and skills_read; Code Mode exposes the corresponding skills.search(), skills.read(), and bounded listing operations. Codex receives host-owned dynamic tools without changing its native resource API.

No new configuration is required. Existing tool policy controls availability, and sandboxes expose only readable, delivered skills. Dedicated remote-worker protocols remain unchanged.

Existing read grants retain skill-read access unless that inherited grant or skills_read is explicitly denied. Prompt-listed instructions preserve their shipped whole-read contract; newly discovered instructions retain the 256 KiB limit.

Builds on #158090, now landed. Bounded instruction-body ranking follows in #160538.

Evidence

  • An unrelated Control UI locator ambiguity failed one hosted shard. Its single diagnostic retry passed on the unchanged head. The underlying test defect is tracked separately at test(ui): pending-handoff locator also matches screen-reader announcement #162620. All circuit-breaker-cancelled jobs then completed successfully; exact-head CI run https://github.com/openclaw/openclaw/actions/runs/36848731115 is green on attempt 3.

  • 74 focused regressions across nine files passed in 243.46 seconds: Code Mode, embedded policy, workspace ownership, sandbox reads, prompt guidance, accounting, resources, and Codex dynamic dispatch.

  • Review caught two Code Mode policy defects: dropping read access also dropped valid search access, and guidance advertised unavailable operations. Both are repaired. The new cases fail on the original code and pass after repair.

  • The final factory-registration move into the preceding PR preserves the combined source tree byte-for-byte.

  • CI exposed a hoisted mock initialization error and stale prepared-resource expectations. The helper now initializes hoisted factories independently, and the affected 61 regressions pass across scoped runs. The sandbox regression is grouped with skill-policy tests; both relocated suites pass all 36 tests in 100.77 seconds and the line-cap guard passes.

  • Updated the client-collision fixture to admit real installed-skill tools and assert that policy removal also removes skill guidance. All 16 client-tool regressions pass in 37.32 seconds; scoped review and the line-cap guard pass.

  • Repaired shared compaction and follow-up fixtures to produce valid skill snapshots. All 144 affected regressions pass in 100.16 seconds. Moving the compaction skill mocks into existing test support preserves coverage and passes the line-cap guard; its 88 consumer regressions pass again in 42.19 seconds. Fresh scoped review and targeted lint pass.

  • The typed fixture boundary also exposed a synchronous prompt mock for an asynchronous API. Its producer and one override now match the real promise contract; core type-checking and all 88 compaction regressions pass (42.67 seconds). All six commits retain identical patches after restacking onto the landed parent.

  • A proposed switch from the captured host catalog to caller-supplied snapshots was rejected after checking actual Codex, Copilot, and Agents API callers: snapshots are read inputs, not replacement eligibility authority.

  • Reproduced and repaired the released Code Mode grant and size regressions through the real worker bridge and canonical policy filter. The regression first failed on the missing binding, then on the 256 KiB refusal. All 83 focused Code Mode, policy, workspace, library, and host cases passed in 116.11 seconds. Review caught inherited read denial precedence; that regression also failed before its fix, then all three grant/denial cases passed in 49.32 seconds.

  • Fresh scoped review found no actionable P0-P2 findings after those repairs. Core typechecking, targeted lint, formatting, whitespace, and the line-cap guard pass.

  • The unrelated baseline fixture failures were reproduced and repaired separately in fix(test): honor session worker fixture lifecycle contracts #162598. All seven feature commits retain identical patches after restacking onto that landed prerequisite. Local results above precede the rebase; exact-head CI remains required before landing.

  • Final CI exposed a frozen Claw profile intersection that ignored denials while materializing inherited skill-read grants. The effective-access regression failed before repair; all 62 Claw profile, capability-change, and Code Mode cases pass in 76.45 seconds after repair. The Code Mode test dispatcher also now uses its concrete native tool contract; the affected test type graph passes.

  • A late review found that Codex could truncate an admitted instruction body while reporting a successful read. The production-host-to-Codex response regression failed before repair. Oversized skill instructions now produce an explicit refusal within the existing output budget before presentation, observer, and transcript projection. All 87 installed-skill and dynamic-tool bridge cases pass in 59.44 seconds; ordinary result truncation is unchanged.

  • Final scoped review, plugin-aware typed lint, formatting, whitespace, and line-cap checks pass. The checked Codex source contract is codex-rs/core/src/tools/handlers/dynamic.rs at 4b0d9669cc46ba97bf85fa6312431b630d80498d: it consumes the response's content items and success flag directly.

  • SkillsBench before/after proof is maintained separately; no live model result is claimed here.

@vincentkoc vincentkoc self-assigned this Sep 25, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling extensions: codex plugin: code-mode-quickjs size: XL labels Sep 25, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 25, 2026
@clawsweeper

clawsweeper Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 1, 2026, 7:09 AM ET / 11:09 UTC (Revision 9).

ClawSweeper review

What this changes

Makes eligible installed skills searchable and readable across embedded agents, OpenClaw Code Mode, and Codex while preserving policy, sandbox placement, and usage accounting.

Merge readiness

✅ Ready for maintainer review

This PR remains necessary: merged prerequisites provide the catalog and tools, while current main lacks these runtime bindings. Prior blocking findings are repaired, and no new actionable defect was identified. Member-authored work is also protected from automatic closure.

Priority: P2
Reviewed head: 08c2c76ac9ff643da9a651231ea0d260d38a8593

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent integration with repaired prior findings, meaningful boundary coverage, and successful exact-head CI.
Proof confidence 🌊 off-meta tidepool Not applicable: The member-authored PR is exempt from ordinary external-contributor proof. Inspected production-boundary regressions cover Code Mode dispatch, workspace reads, sandbox placement, host closure, and Codex whole-or-error delivery; they are supplemental validation, and no live-model result is claimed. No unresolved authority violation or stored-data model change was identified.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The member-authored PR is exempt from ordinary external-contributor proof. Inspected production-boundary regressions cover Code Mode dispatch, workspace reads, sandbox placement, host closure, and Codex whole-or-error delivery; they are supplemental validation, and no live-model result is claimed. No unresolved authority violation or stored-data model change was identified.
Evidence reviewed 8 items Pinned introduction and clean checkout: Reviewed the introduced delta from the verified merge base to the exact original PR head. The stale test merge was not used to infer removal of current-main behavior. Whitespace validation passed, and the working tree remained clean.
Distinct work remains beyond merged prerequisites: Current main still prepares the old prompt-selected Code Mode catalog rather than the installed-skill runtime catalog. The merged foundation at #158090 explicitly leaves runtime catalog preparation to this PR; it does not supersede the harness integration.
Host-owned eligibility and filesystem placement: The host retains its captured snapshot, cannot remove an admitted sandbox through later placement options, and binds reads to delivered sandbox paths or the selected workspace owner. Readers check current authority around awaited reads; host-bound tools also check admission before execution and before returning results.
Findings None None.
Security None None.

How this fits together

Installed skills supply task instructions to agents. This integration carries the session’s eligible catalog into each harness and returns bounded search metadata or complete instructions through the normal tool dispatch path.

flowchart TD
 A[Installed skills] --> B[Eligible session catalog]
 B --> C[Tool policy]
 C --> D[Agent harness]
 D --> E[Search metadata]
 D --> F[Workspace or sandbox reader]
 F --> G[Complete instructions or refusal]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +279, Tests +575, Docs +48, Other -1. Total +901 across 55 files.

View PR surface stats
Area Files Added Removed Net
Source 31 556 277 +279
Tests 21 723 148 +575
Docs 2 48 0 +48
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 55 1327 426 +901

Review metrics

Metric Value Why it matters
Production versus test growth production net +289 lines; tests and test support net +565 lines Production growth has a stated purpose: shared catalog ownership and harness integration rather than separate discovery implementations.

Technical review

Best possible solution:

Keep one host-owned eligible catalog and shared dispatch path across harnesses, preserving existing read grants and complete-instruction delivery.

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

Not applicable as a feature review. Source and regression inspection establish the runtime integration gap; this read-only review did not execute the behavior.

Is this the best way to solve the issue?

Yes. The branch extends the existing installed-skill tools and normal dispatch owner, preserving policy and filesystem ownership instead of introducing a competing discovery service.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Installed-skill discovery is a bounded agent capability improvement without evidence of an urgent current regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The member-authored PR is exempt from ordinary external-contributor proof. Inspected production-boundary regressions cover Code Mode dispatch, workspace reads, sandbox placement, host closure, and Codex whole-or-error delivery; they are supplemental validation, and no live-model result is claimed. No unresolved authority violation or stored-data model change was identified.

Evidence

What I checked:

  • Pinned introduction and clean checkout: Reviewed the introduced delta from the verified merge base to the exact original PR head. The stale test merge was not used to infer removal of current-main behavior. Whitespace validation passed, and the working tree remained clean. (08c2c76ac9ff)
  • Distinct work remains beyond merged prerequisites: Current main still prepares the old prompt-selected Code Mode catalog rather than the installed-skill runtime catalog. The merged foundation at feat(skills): add installed skill search and read tools #158090 explicitly leaves runtime catalog preparation to this PR; it does not supersede the harness integration. (src/agents/embedded-agent-runner/skill-runtime.ts:138, d07e6df877a2)
  • Host-owned eligibility and filesystem placement: The host retains its captured snapshot, cannot remove an admitted sandbox through later placement options, and binds reads to delivered sandbox paths or the selected workspace owner. Readers check current authority around awaited reads; host-bound tools also check admission before execution and before returning results. (src/agents/harness/host-skills.ts:19, 08c2c76ac9ff)
  • Earlier policy and compatibility findings repaired: Explicit denials precede inherited read grants, frozen profile intersections now retain denial semantics, and prompt-listed instructions preserve whole reads. Worker-bridge regressions cover independent search/read availability and read-denial precedence. The previous completed review covered this same head and retained no findings. (src/agents/tool-policy-match.ts:58, 08c2c76ac9ff)
  • Codex whole-or-error response boundary: Oversized successful skill results become explicit errors before presentation, observer notification, and response conversion. The production-host-to-Codex regression covers denied access, complete delivery, and oversized refusal. This changed response contract establishes the affirmative dependency signal for inspecting Codex itself. (extensions/codex/src/app-server/dynamic-tool-content.ts:14, 08c2c76ac9ff)
  • Exact Codex consumer contract inspected: Verified repository ownership through the sibling cache’s upstream remote, inspected the sibling implementation, and independently read the exact revision cited by the PR through GitHub. DynamicToolHandler consumes response content_items and success directly, supporting the whole-or-error adapter behavior. (codex-rs/core/src/tools/handlers/dynamic.rs:169, 4b0d9669cc46)

Likely related people:

  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: 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.

History

Review history (8 earlier review cycles)
  • reviewed 2026-09-25T11:47:08.564Z sha edf53bb :: needs changes before merge. :: [P2] Keep listing available when search alone is admitted | [P2] Advertise only admitted Code Mode skill operations
  • reviewed 2026-09-26T20:04:39.818Z sha edf53bb :: blocked before merge. :: [P1] Preserve released skill reads under existing read grants | [P2] Keep listing available when search alone is admitted | [P2] Advertise only admitted Code Mode skill operations
  • reviewed 2026-10-01T08:48:05.193Z sha 2c7f3b8ec2726db7de724ffa8c887d13d4345ff1 :: blocked before merge. :: [P1] Preserve released skill reads under existing read grants
  • reviewed 2026-10-01T09:02:53.785Z sha fbf7a2600d7905b6220d4e1794a3367eabafbd41 :: blocked before merge. :: [P1] Preserve released skill reads under existing read grants
  • reviewed 2026-10-01T09:37:45.979Z sha 590036a :: blocked before merge. :: [P1] Preserve released skill reads under existing read grants
  • reviewed 2026-10-01T10:11:26.311Z sha 8c581a0 :: needs changes before merge. :: [P2] Preserve whole-or-error reads at the Codex response boundary
  • reviewed 2026-10-01T10:30:57.661Z sha 08c2c76 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-01T10:44:17.131Z sha 08c2c76 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Sep 26, 2026
@vincentkoc
vincentkoc force-pushed the feat/installed-skill-search branch 2 times, most recently from 9f77708 to ef00124 Compare October 1, 2026 08:16
@vincentkoc
vincentkoc force-pushed the feat/installed-skill-harnesses branch from edf53bb to 730943d Compare October 1, 2026 08:20
@vincentkoc
vincentkoc marked this pull request as ready for review October 1, 2026 08:21
@clawsweeper

clawsweeper Bot commented Oct 1, 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.

@vincentkoc
vincentkoc force-pushed the feat/installed-skill-harnesses branch from 730943d to 95b0015 Compare October 1, 2026 08:27
@vincentkoc
vincentkoc force-pushed the feat/installed-skill-harnesses branch 2 times, most recently from 77ae04b to 2c7f3b8 Compare October 1, 2026 08:41
Base automatically changed from feat/installed-skill-search to main October 1, 2026 09:28
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components. This comment is informational because the PR author has repository Maintain or Admin access.

  • Current SHA: 08c2c76ac9ff643da9a651231ea0d260d38a8593
  • Maintainer: @vincentkoc
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/embedded-agent-runner/sandbox-skills.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/agents/tool-policy-match.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.

Carefully review these changes before merging.

@vincentkoc
vincentkoc force-pushed the feat/installed-skill-harnesses branch from 87c20fb to 590036a Compare October 1, 2026 09:30
Keep installed-skill eligibility host-owned while applying normal tool policy to discovery and complete instruction reads. Preserve current main's prepared tool surface and consolidated Code Mode coverage. Caller-provided snapshot options supply read paths, not replacement eligibility authority.
@clawsweeper clawsweeper Bot added 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 1, 2026
@vincentkoc
vincentkoc merged commit b5b1029 into main Oct 1, 2026
338 of 380 checks passed
@vincentkoc
vincentkoc deleted the feat/installed-skill-harnesses branch October 1, 2026 11:11
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 2, 2026
…w#158091)

* feat(agents): expose installed skill search across harnesses

Keep installed-skill eligibility host-owned while applying normal tool policy to discovery and complete instruction reads. Preserve current main's prepared tool surface and consolidated Code Mode coverage. Caller-provided snapshot options supply read paths, not replacement eligibility authority.

* test(agents): preserve hoisted skill harness initialization

Keep mock factory dependencies owned by vi.hoisted when splitting skill fixtures. Assemble skill-specific mocks only when the test consumer requests them. Update two prior expectations for the prepared empty snapshot/resource contracts while preserving sandbox host-skill exclusion.

Exact-head reproduction failed on the original hoisting and resource-array assertions. Nine affected suites covered 61 tests; after the hoisting repair, a stale sandbox snapshot assertion was found and the 32-test owner file passed on focused retry. Fresh lifecycle autoreview found no actionable P0-P2 issues; formatting and whitespace checks pass.

* test(agents): group sandbox skill coverage with policy tests

* test(agents): admit skill tools in client collision coverage

* test(agents): provide complete prepared skill fixtures

* test(agents): match async skill prompt contract

* fix(skills): preserve existing Code Mode read grants and whole reads

* fix(skills): preserve read denials in frozen tool profiles

* fix(codex): refuse partial installed skill instructions

Co-authored-by: Vincent Koc <[email protected]>
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 extensions: codex P2 Normal backlog priority with limited blast radius. plugin: code-mode-quickjs rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. security-sensitive-changed size: XL 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