Skip to content

fix(agents): retain skill guidance for reader-enabled routines - #186306

Merged
steipete merged 3 commits into
mainfrom
fix/routine-skill-access
Oct 27, 2026
Merged

steipete merged 3 commits into
mainfrom
fix/routine-skill-access

Conversation

@giodl73-repo

@giodl73-repo giodl73-repo commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Closes #186285.

What Problem This Solves

Fixes: scheduled agents lose eligible skill guidance when their explicit tool limits still permit reading instructions. Also prevents readerless Code Mode runs from advertising skill instructions they cannot read.

User Impact

Reader-enabled routines retain their skill catalog. Excluded or unavailable readers, write-only Code Mode, and explicit toolsAllow: [] still receive no catalog. This adds no tools, filesystem access, permissions, configuration, or persistence changes. A model still decides whether to follow the instructions.

Why This Change Was Made

Keep Gio Della-Libera's original native-reader fix and remove the blanket finite-cap catalog suppression. The canonical skills renderer owns capability guidance: Code Mode now requires both its exec control and the admitted skills_read capability. Permission refresh uses the same final capability set. Runtime caps and minimal prompt mode remain enforced.

Thanks @giodl73-repo for the original fix and request-level regression coverage; the original commit is preserved. Redundant prompt fixtures and equivalent cases were consolidated so the new regressions add no net test lines.

Evidence

  • Red/green serialized-provider regressions: native read and skills_read positives fail on main; write-only Code Mode and reader-removal refresh fail on the original PR renderer. The final consolidated regression still produces exactly those two Code Mode failures with seven controls passing. Excluded/unavailable readers and explicit empty caps remain omitted.
  • Final focused run: 146 tests pass across six files, including prefix stability, in 129.84s wrapper wall time. Shard times including transforms: 19.17s, 37.24s, 27.33s. All 34 executed jobs in exact-head CI, attempt 1 passed (27 unrelated jobs skipped). Both its openclaw/ci-gate and the separate aggregate gate passed. The six changed-test jobs took 141s, 289s, 373s, 476s, 198s, and 220s wall time including setup.
  • Clean-main cron reproduction uses one disabled, no-delivery synthetic job and a recording Ollama relay: native read is offered but the canary catalog is absent. Real Qwen3 8B receives the same omission and guesses an incorrect token without reading the skill.
  • On the final head, the same fixture run offers native read plus the canary catalog, obtains successful skill-file and canary-file receipts, and returns the exact token. Real Qwen3 8B repeats those two reads and the exact answer in 4.457s; delivery remains not-requested. The token is absent from the initial request. Raw synthetic runtime captures are retained locally and are not attached to this PR.
  • Scoped production and final test TypeScript pass (3.13s and 2.63s); targeted lint passes (12.48s); formatting, whitespace, and applicable ratchets pass. No baseline was raised.
  • Fresh isolated Codex autoreview of the final committed head: scoped-clean through P2, no actionable findings. ClawSweeper reviewed the same head: no findings or before-merge items.
  • Prompt snapshots regenerated with no committed changes: 0 snapshot token delta. The initial Qwen wire request increases from 1,903 to 2,107 prompt tokens (+204; per-run session/runtime facts differ). Local validation is macOS only; no hosted deployment or other-platform proof is claimed.

Production +5/-7 (net -2), tests +254/-254 (net 0), documentation +5/-0 against the merge base. No compatibility path or new owner was added.

@clawsweeper

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling size: XS labels Oct 27, 2026
@giodl73-repo
giodl73-repo marked this pull request as ready for review October 27, 2026 20:54
@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 Oct 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Retain eligible skill catalogs for reader-enabled routines while suppressing guidance when Code Mode lacks an admitted skill reader.

Example: A scheduled weather routine has toolsAllow: ["read"] and an eligible weather skill.

  • Before: The model receives the read tool but no weather skill catalog.
  • After: The model receives the catalog and reader guidance without widening its tool allowance.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused repair and boundary regressions are sound, with the previous finding resolved; independently inspectable evidence remains strongest at the in-process boundary.
Proof confidence 🦐 gold shrimp (3/6) The body reports an isolated cron run through a recording relay and a real model, with successful skill-file reads and the exact canary answer; no raw runtime artifact is attached, and the supplied maintainer-authored exemption applies.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Scheduled agents can read skill instructions but receive no catalog identifying eligible skills.
Reason: Restoring discovery without expanding executable permissions has clear value, and the supplied maintainer-authored designation establishes direction approval.

Merge readiness

✅ Ready for maintainer review

This PR repairs a current skill-discovery bug, and the prior Code Mode finding is resolved; no actionable correctness or security findings remain.

Priority: P2
Reviewed head: 7a71a3673df6d573e708ad5d09710d4509561faf

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The reported isolated cron reproduction has no directly inspectable runtime output attached; serialized-request and refresh coverage are source-inspectable.
Agent review details

How this fits together

The embedded runner combines eligible skill metadata with final tool capabilities to produce provider instructions and context diagnostics.

flowchart TD
  A[Scheduled routine] --> B[Tool construction and filtering]
  C[Eligible skill catalog] --> D[Prompt preparation]
  B --> D
  D --> E[Skills renderer]
  E --> F[Provider request]
  E --> G[Context diagnostics]
Loading

Technical review

Best possible solution:

Use the existing skills renderer to expose catalogs only through genuinely available readers while preserving runtime caps and permission refresh.

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

Current main directly establishes finite-reader catalog loss, and the revised serialized-request regression exercises that path; this read-only review executed no tests or runtime reproduction.

Is this the best way to solve the issue?

The production change is the smallest complete repair: remove caller-side suppression and keep reader availability in the existing renderer, including Code Mode.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Finite-cap catalog suppression changes intended behavior with a stated reason (e25434e: The wildcard repair deliberately retained finite-cap suppression; this PR explains why final reader capability is the appropriate catalog boundary.)
  • Code Mode and deferred invocation guidance keeps the original intent (ac493b8: The existing renderer owns capability access and invocation syntax; requiring an admitted reader preserves that intent and removes unusable guidance.)
  • Rendered-catalog diagnostics and permission refresh keeps the original intent (643ea65: Reports describe the catalog actually rendered, including reader changes and prompt overrides; consolidated coverage retains those contracts.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Raw commit b5b1029 adds docs/tools/skills.md:861 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: docs/tools/skills.md)
  • weiqinl: Raw commit ac493b8 adds src/agents/system-prompt-skills.ts:15 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: ac493b83340e; files: src/agents/system-prompt-skills.ts)

PR surface

Source -2, Tests 0, Docs +5. Total +3 across 7 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 5 7 -2
Tests 4 254 254 0
Docs 1 5 0 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 264 261 +3

Review metrics

Metric Value Why it matters
Production versus test LOC Production +5/-7; tests +254/-254 The repair removes duplicate production policy and consolidates existing fixtures while adding reader and permission-refresh regressions.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #186285
Summary: The linked issue owns finite-reader catalog loss, and this PR supplies its focused repair.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Finite-cap scheduled runs silently lose eligible skill discovery despite retaining a reader, with a bounded affected workflow.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Optionally attach sanitized cron request and skill-read receipts from the reported live run to strengthen behavior confidence.

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 (1 earlier review cycle)
  • reviewed 2026-10-27T21:12:25.197Z sha defecdc :: needs changes before merge. :: [P2] Require reader availability before exposing Code Mode skill catalogs

Reviewed October 27, 2026, 6:08 PM ET / 22:08 UTC (Revision 2).

Keep skill guidance aligned with the actual reader capability during initial prompt preparation and permission refresh. Preserve native reader catalogs, runtime caps, and explicit tool-less runs.
Preserve serialized reader and permission-refresh regressions while sharing equivalent prompt fixtures and removing duplicate cases. Keep the overall PR test-line delta at zero without changing the baseline.
@steipete

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed 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. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 27, 2026
@clawsweeper clawsweeper Bot removed clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 27, 2026
@steipete
steipete merged commit fc46600 into main Oct 27, 2026
155 of 160 checks passed
@steipete
steipete deleted the fix/routine-skill-access branch October 27, 2026 23:10
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

steipete added a commit that referenced this pull request Oct 27, 2026
#186306 stopped prompt preparation from discarding the skills catalog for
every finite tool cap; the renderer (buildSkillsSection) now gates on the
actually admitted reader. The Code Mode skill-policy table still expected
the old discard for `toolsAllow: ["message"]`, so main fails
attempt.skills-policy.test.ts:298 (seen on PR #186368's CI). The renderer
still omits the catalog there because no skills reader is admitted, and the
row keeps asserting that the skills.list() guidance is absent.

Proof: attempt.skills-policy 5/5 and system-prompt 60/60 green.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
…law#186306)

* fix(agents): retain skill guidance for reader-enabled routines

* fix(agents): require an admitted Code Mode skill reader

Keep skill guidance aligned with the actual reader capability during initial prompt preparation and permission refresh. Preserve native reader catalogs, runtime caps, and explicit tool-less runs.

* test(agents): consolidate prompt capability coverage

Preserve serialized reader and permission-refresh regressions while sharing equivalent prompt fixtures and removing duplicate cases. Keep the overall PR test-line delta at zero without changing the baseline.

---------

Co-authored-by: Gio Della-Libera <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
openclaw#186306 stopped prompt preparation from discarding the skills catalog for
every finite tool cap; the renderer (buildSkillsSection) now gates on the
actually admitted reader. The Code Mode skill-policy table still expected
the old discard for `toolsAllow: ["message"]`, so main fails
attempt.skills-policy.test.ts:298 (seen on PR openclaw#186368's CI). The renderer
still omits the catalog there because no skills reader is admitted, and the
row keeps asserting that the skills.list() guidance is absent.

Proof: attempt.skills-policy 5/5 and system-prompt 60/60 green.
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 P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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.

Skills catalog disappears for routines with an explicit reader tool allowlist

2 participants