Skip to content

fix(skills): detect skill roots created after startup - #134136

Merged
steipete merged 14 commits into
mainfrom
codex/release82-skills-missing-root
Aug 31, 2026
Merged

steipete merged 14 commits into
mainfrom
codex/release82-skills-missing-root

Conversation

@steipete

@steipete steipete commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Creating a skills directory after Gateway startup could leave the active skills snapshot unchanged, especially when both levels of <workspace>/.agents/skills were missing. Pending file-stability work could also notify after its watcher closed.

Why This Change Was Made

Chokidar retains the final basename while falling back through missing parents. The refresh owner now watches the nearest existing ancestor and restricts traversal and events to the intended logical skills root. Shared subscriptions retain logical depth independently of their physical watch location, and closed watchers reject delayed notifications.

This composes with the Windows short-path fix landed in #134045: expand only the existing non-symlink prefix before choosing the ancestor. The canonical path normalizer preserves drive and UNC roots, so C:/ never becomes the drive-relative C:. Symlink restrictions, ignored directories, depth limits, and polling behavior remain intact. Redundant target keys and one-use wrappers are removed. Production changes are +80/-78, net +2; the root-boundary repair accounts for three lines beyond the original net-negative watcher repair.

Evidence

  • Real Chokidar before/after proof: an existing SKILL.md positive control passed in both versions; creating .agents/skills after parent-watch registration failed before and refreshed afterward. A separate regression reproduced notification after watcher closure.
  • The combined owner, state, path and real-filesystem suites pass 56 tests locally. One Windows-only owner/subscription case is intentionally skipped on macOS. Drive/UNC normalizer regressions failed three cases before the fix and pass afterward using Node's native path parsers.
  • Windows path fixtures now materialize the expanded directory returned by native realpath and verify logical subscription and physical ancestor separately. Windows cases are split into their own file with a shared mock watcher fixture; the canonical Windows CI inventory includes both new path suites and the real missing-root integration.
  • Earlier exact head 73e22afd024 passed two full CI runs, including the real missing-root Windows proof and required real-Gateway browser proof. Those are retained historical results; the final composition requires fresh exact-head CI before landing.
  • A Linux fixture readiness race was reproduced at the parent-registration boundary, then fixed by waiting for both actual parent and child registrations. No deadline or assertion was weakened. The test machine was released.

The PR also moves the real Gateway agent-file browser test out of ordinary mocked UI shards into the existing required real-Gateway job. Its read, agent-switch and durable-save assertions retain their 120-second deadline. Shared browser helpers are reused, and cleanup covers setup and close failures. The routing guard failed before the change and passes afterward; all three real/mocked browser cases passed. This portion changes no production code.

The actual main composition conflict was limited to the watcher path initialization and changelog placement. Already-landed release fixes are preserved. A combined test-file size lint failure was repaired by splitting the Windows tests, without suppressing or changing the limit. Final review is clean at the required blocking priority. No release is published by this PR.

@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: XL maintainer Maintainer-authored PR app: web-ui App: web-ui extensions: anthropic labels Aug 31, 2026
steipete and others added 12 commits August 31, 2026 08:01
Preserve the recovery coverage added in #134165 while using the actual WebSocket dependency and authored SecretRef fixture boundary.

Co-authored-by: Shakker <[email protected]>
Keep provider descriptors synchronous without importing credential stores, external auth discovery, or live catalog transport during registration. Load those implementations only when the existing asynchronous setup, doctor, usage, and catalog hooks need them.

Expose the existing lightweight API-key descriptor factory through provider-entry while preserving the shipped auth SDK helpers and their synchronous contracts. The unchanged fresh-process registry proof retains its original timeout and verifies scoped failover without global activation.
Wait for opening focus initialization and visible popup retirement before exercising selection and typing ownership. Preserve the existing focus, selected-agent, and composer assertions without changing product behavior or timeouts.
@steipete
steipete force-pushed the codex/release82-skills-missing-root branch from 7d3f3d0 to 5262cd8 Compare August 31, 2026 15:22
@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Aug 31, 2026
@steipete steipete closed this Aug 31, 2026
@steipete steipete reopened this Aug 31, 2026
@openclaw-barnacle openclaw-barnacle Bot removed gateway Gateway runtime scripts Repository scripts extensions: anthropic labels Aug 31, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. 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 Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 31, 2026, 2:23 PM ET / 18:23 UTC.

ClawSweeper review

What this changes

The PR watches the nearest existing ancestor of each skills root so roots created after startup refresh the skill snapshot, and relocates an agent-file browser test to the real-Gateway CI job.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep this maintainer-authored PR open. The watcher repair targets the snapshot owner and is covered by a real-filesystem regression, but the introduced real-Gateway UI test bypasses manual proof capture/upload and the branch edits release-owned changelog content.

Priority: P2
Reviewed head: 0eafd2c6fa978b7afeaf5332f24850c4463d15a7

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The core repair and boundary test are credible, but two small introduced workflow/release-process defects need correction before merge.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its supplied real-filesystem regression targets the changed watcher path, while current-head CI remains incomplete.
Patch quality 🦐 gold shrimp (3/6) 2 actionable review findings remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its supplied real-filesystem regression targets the changed watcher path, while current-head CI remains incomplete.
Evidence reviewed 7 items Current-main behavior: Current main still constructs Chokidar with the logical target path, so the missing-root repair is not already present there.
Watcher owner boundary: The introduced code finds an existing ancestor, watches it, and filters events to the logical root or its ancestor chain before invalidating subscribers.
Snapshot caller: Session snapshot resolution ensures watchers before reading the version that determines whether the cached skill snapshot is rebuilt.
Findings 2 actionable findings [P2] Route agent-file proof capture through the real-Gateway job
[P2] Remove the release-owned changelog entry
Security None None.

How this fits together

The skills runtime observes workspace skill directories and invalidates the versioned snapshot used by later agent turns. The PR changes how missing directories are observed and adds real-Gateway browser coverage for a separate Control UI file workflow.

flowchart LR
A[Workspace skill roots] --> B[Skills watcher]
B --> C[Existing ancestor watch]
C --> D[Logical root filter]
D --> E[Snapshot invalidation]
E --> F[Later agent turn]
Loading

Before merge

  • Route agent-file proof capture through the real-Gateway job (P2) - This new test runs after the only real-Gateway proof upload and receives neither its capture flag nor artifact root. A manual capture_ui_proof run therefore cannot retain screenshots from the newly moved browser path; use the established capture directory and upload after this test, then cover that routing in the workflow guard.
  • Remove the release-owned changelog entry (P2) - This normal PR adds an unreleased CHANGELOG.md bullet even though release generation owns that file. Keep the release-note context in the PR body or squash message and let the release workflow compose the changelog.
  • Resolve merge risk (P1) - The newly relocated browser path cannot produce or upload its screenshots during the workflow's manual proof-capture mode until its capture environment and upload ordering are aligned.
  • Resolve merge risk (P1) - The bug fix is net +2 production lines; the added root-preserving normalizer appears necessary for drive and UNC roots, but should remain confined to the existing watch-path owner.

Findings

  • [P2] Route agent-file proof capture through the real-Gateway job — .github/workflows/ci.yml:2422-2427
  • [P2] Remove the release-owned changelog entry — CHANGELOG.md:147
Agent review details

Security

None.

PR surface

Source +92, Tests +136, Docs +2, Config +7. Total +237 across 16 files.

View PR surface stats
Area Files Added Removed Net
Source 4 170 78 +92
Tests 8 862 726 +136
Docs 2 3 1 +2
Config 2 8 1 +7
Generated 0 0 0 0
Other 0 0 0 0
Total 16 1043 806 +237

Review metrics

Metric Value Why it matters
Production versus test delta production +80/-78 (net +2); tests/test support +952/-726 The small production increase implements root-preserving ancestor watching; most churn is focused watcher and UI regression coverage.

Merge-risk options

Maintainer options:

  1. Restore agent-file proof capture (recommended)
    Pass the existing capture/artifact contract to the new test, upload after it runs, and guard that routing so manual proof runs retain its evidence.

Technical review

Best possible solution:

Remove the release-owned changelog entry and make the agent-file real-Gateway test share the job’s capture directory and upload sequence, with a workflow guard for that contract.

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

Yes, source-reproducible: current main watches the absent logical root directly, while the new real-filesystem test creates the missing project-agent tree after watcher startup and observes the intended refresh.

Is this the best way to solve the issue?

No: ancestor watching with logical-root filtering is the right repair boundary, but this branch also needs the two focused CI/release-process corrections before it is the best mergeable solution.

Full review comments:

  • [P2] Route agent-file proof capture through the real-Gateway job — .github/workflows/ci.yml:2422-2427
    This new test runs after the only real-Gateway proof upload and receives neither its capture flag nor artifact root. A manual capture_ui_proof run therefore cannot retain screenshots from the newly moved browser path; use the established capture directory and upload after this test, then cover that routing in the workflow guard.
    Confidence: 0.98
  • [P2] Remove the release-owned changelog entry — CHANGELOG.md:147
    This normal PR adds an unreleased CHANGELOG.md bullet even though release generation owns that file. Keep the release-note context in the PR body or squash message and let the release workflow compose the changelog.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: A bounded skills-refresh bug can leave newly created local skills unavailable until another refresh occurs.
  • add merge-risk: 🚨 automation: The CI change moves a real browser test outside the job’s existing proof-capture environment and upload sequence.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its supplied real-filesystem regression targets the changed watcher path, while current-head CI remains incomplete.

Label justifications:

  • P2: A bounded skills-refresh bug can leave newly created local skills unavailable until another refresh occurs.
  • merge-risk: 🚨 automation: The CI change moves a real browser test outside the job’s existing proof-capture environment and upload sequence.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its supplied real-filesystem regression targets the changed watcher path, while current-head CI remains incomplete.

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)

Rank-up moves

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

  • Remove the release-owned changelog bullet.
  • Route the real-Gateway agent-file test through capture/upload and add a focused workflow-routing assertion.

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

Copy link
Copy Markdown
Contributor Author

Reviewed the latest ClawSweeper findings and rank-up moves against the current and pre-move source.

  • The changelog entry is retained intentionally: this PR is part of the explicitly authorized release closeout and forward-port work, using the supported release-maintainer exception. It preserves the reviewed release note beside the related skills entry.
  • Manual agent-file screenshot capture is deferred to the named follow-up real-Gateway manual screenshot capture. The previous ordinary UI job also supplied neither the capture flag nor an artifact upload, and the helper already used its own fixed output directory. This is an optional evidence-capture gap, not a lost working artifact or a runtime regression. The follow-up will use the existing artifact-directory helper, pass the established capture environment, upload after all capture-producing tests, and add the routing guard and fixture-capture proof. It will be delivered separately without changing this verified head.
  • The net +2 production lines are justified by the canonical drive/UNC-root boundary: trimming C:/ into C: would change an absolute ancestor into a drive-relative watch. The repair stays in the existing path owner; it adds no configuration or fallback.

Exact head 0eafd2c6fa978b7afeaf5332f24850c4463d15a7 now has successful full CI, including both Windows shards and the aggregate gate. Windows test-2 passed all 11 targeted skills cases, including the drive-root owner subscription and real missing-root Chokidar integration. Local focused checks, the required changed-file gate, and final review also pass. No test deadline or assertion was weakened.

@steipete
steipete merged commit fece7a5 into main Aug 31, 2026
273 checks passed
@steipete
steipete deleted the codex/release82-skills-missing-root branch August 31, 2026 18:45
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 1, 2026
* fix: restore gateway recovery fixture lint and types

Preserve the recovery coverage added in openclaw#134165 while using the actual WebSocket dependency and authored SecretRef fixture boundary.

Co-authored-by: Shakker <[email protected]>

* fix(skills): refresh roots created after startup

* fix: authenticate CI checkout and lazy blob fetches

* fix: prepare immutable reader history during CI checkout

* fix(ci): declare historical reader selector entry point

* docs: group the skills refresh release note

* test(skills): await positive-control directory watch readiness

* perf(anthropic): defer auth and catalog runtime imports

Keep provider descriptors synchronous without importing credential stores, external auth discovery, or live catalog transport during registration. Load those implementations only when the existing asynchronous setup, doctor, usage, and catalog hooks need them.

Expose the existing lightweight API-key descriptor factory through provider-entry while preserving the shipped auth SDK helpers and their synchronous contracts. The unchanged fresh-process registry proof retains its original timeout and verifies scoped failover without global activation.

* test(ui): await agent menu lifecycle before keyboard navigation

Wait for opening focus initialization and visible popup retirement before exercising selection and typing ownership. Preserve the existing focus, selected-agent, and composer assertions without changing product behavior or timeouts.

* test: include historical prerequisite in routing expectations

* fix(ci): prepare Testbox against the checked-out merge base

* docs(plugins): use public provider auth import in tutorial

* test(ui): route agent file proof through real Gateway CI

---------

Co-authored-by: Shakker <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant