Skip to content

fix(skills): preserve canonical names through discovery and workshop - #136495

Merged
steipete merged 5 commits into
mainfrom
codex/qa30b-skill-name-resolution
Sep 2, 2026
Merged

steipete merged 5 commits into
mainfrom
codex/qa30b-skill-name-resolution

Conversation

@steipete

@steipete steipete commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #136493.

What Problem This Solves

An exact skill name could silently select an earlier skill's metadata alias. Even after selecting the correct file, retry guidance could redirect the agent to the conflicting alias, and update/revision drafts could replace the live frontmatter name with that key. Inspection and Workshop now keep the requested skill's canonical name throughout the workflow.

Why This Change Was Made

The shared resolver checks exact names, exact metadata keys, case-insensitive matches and normalized matches in order; ambiguity in the strongest matching tier stops selection. Writable summaries and read/prepare results expose the canonical name. Retry instructions, generated update/revision frontmatter, proposal projections and Gateway revision instructions carry that same name. Creation still uses its existing normalized name.

The repair deletes four match/count accumulators, duplicate summary construction, duplicate update/patch proposal construction, a copied patch-target type and a redundant nullable instruction branch. Metadata keys, target files, content/revision hashes, receipt maps and authority bindings keep their existing contracts.

Production +82 / −115 = −33 LOC; tests/support +343 / −64 = +279; docs +10. No new config option, dependency, schema or material store change.

User Impact

skills info and Workshop select exact names consistently regardless of discovery order. Following read/patch guidance stays on the intended skill, and applying a revision preserves the name needed to read that skill again. Unique aliases and normalized lookup remain supported. Existing pending drafts are not silently rewritten; their normal revision owner changes draft content.

Evidence

The original compiled CLI on 65e5b2e19c9db6460494682bacc4bee10db755fd listed both synthetic skills, then selected qa-alias-skill for skills info qa-exact-target --json --agent proof. The rebuilt CLI selected qa-exact-target and its actual file in both JSON and text. Original owner/sibling validation passed 226 tests and the canonical runtime build.

The final native tool/filesystem/proposal flows reproduce the complete failure and repair:

Flow Before After
Follow read guidance for alpha-guide, whose metadata key is beta-guide Update/patch proposal targets the other skill named beta-guide Guidance and proposal retain alpha-guide and its original file
Update, revise and apply alpha-guide Live name becomes beta-guide; reading alpha-guide fails Proposed, revised and live names remain alpha-guide; read succeeds
Create and revise Friendly New Guide Normalizes to friendly-new-guide Same normalized name and successful read
  • Four final identity regressions fail before the follow-through and pass after. The Gateway revision-instruction regression also fails before while its creation control passes. Final recorded batches cover 174 distinct cases across twelve files, including all 22 Gateway proposal cases and bound revision/identity siblings.
  • The complete nineteen-file changed gate passes. One cumulative independent Codex review of all final source is clean through P2, with frozen source/index and one connected input. Root personally inspected the complete changed owners, shared proposal/name contracts, actual before/after results and preserved authorization bindings.
  • The existing startup-recovery CI fixture uses the queue owner's pending-depth contract and both exact queued message identities, preserving replacement cancellation, surviving delivery and cleanup. Its actual Gateway regression passed; this test-only correction is not another product issue.

The original CLI proof uses the compiled CLI; final identity follow-through uses actual source tool/service operations and real synthetic files/proposals with a scripted guidance consumer. The Gateway instruction proof captures the existing handler dispatch, rather than claiming a live socket or model turn. UI autocomplete relevance in #123533 is a separate behavior.

Compatibility and final review

The latest ClawSweeper review confirms the prior retry-selector finding is fixed and reports no remaining correctness finding. Its sole remaining item flags frontmatter.ts for data-model compatibility. Seventeen complete record/schema/store/parser owners are byte-identical, as are the existing frontmatter renderer, reader and stripping functions. The change chooses between existing name/key values; it adds no field or migration.

Actual readers from original 65e5b2e19c9db6460494682bacc4bee10db755fd and final b09e55f6f1a8bd7e48869dd7eb3217fd6b7f79a4 each accepted the same 27 copied Markdown artifacts and seven stored proposal records with identical results. They read the exact newly generated, revised and applied skill bytes. Both retained two older pending drafts with identical content, stored JSON, pending status, draft hash and revision hash. Explicit revision regenerates the corrected name; reads and apply do not silently rewrite approved drafts. This is real source-reader compatibility proof, not a separately installed stable-release downgrade test or a whole-SQLite-file byte-identity claim.

The required CI gate passes on that final head, with no pending or failed checks in the final snapshot. The compatibility item is addressed and no Rank-up move remains.

@clawsweeper

clawsweeper Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 2, 2026
@clawsweeper

clawsweeper Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 2, 2026, 6:22 PM ET / 22:22 UTC.

ClawSweeper review

What this changes

The PR prioritizes exact skill names over metadata aliases and preserves the resolved name through CLI discovery, Workshop reads, proposals, revisions, and documentation.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open. The final commit addresses the prior retry-selector finding and preserves canonical names through discovery, Workshop proposals, and revisions; current main and the latest stable release still contain the first-match behavior this PR repairs.

Priority: P2
Reviewed head: b09e55f6f1a8bd7e48869dd7eb3217fd6b7f79a4

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative production repair with meaningful boundary regression coverage and no remaining supported correctness finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a MEMBER-authored PR, so the external-contributor proof gate does not apply; its body nevertheless supplies source-tool and filesystem/proposal before-and-after evidence for the changed owner paths.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a MEMBER-authored PR, so the external-contributor proof gate does not apply; its body nevertheless supplies source-tool and filesystem/proposal before-and-after evidence for the changed owner paths.
Evidence reviewed 7 items Current main still has the reported behavior: Current main returns the first entry whose name or metadata key exactly matches, so an earlier metadata alias can still win over a later exact skill name.
Released behavior matches current main: The v2026.8.2 source has the same combined exact name-or-key first-match branch, so the issue is present in the latest stable release.
Shared resolver repair: The introduced resolver evaluates exact names before exact metadata keys, then case-insensitive and normalized tiers, rejecting ties instead of depending on discovery order. The CLI calls this resolver when formatting skill info.
Findings None None.
Security None None.

How this fits together

Skill discovery resolves workspace skill identifiers for both the CLI and Skill Workshop. Workshop uses that result to read a skill, create or revise a proposal, and eventually apply changes to its backing file.

flowchart LR
  A[Workspace skill files] --> B[Skill discovery]
  B --> C[Ranked identifier lookup]
  C --> D[Skills CLI]
  C --> E[Skill Workshop]
  E --> F[Proposal and revision]
  F --> G[Updated skill file]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source -33, Tests +279, Docs +10. Total +256 across 19 files.

View PR surface stats
Area Files Added Removed Net
Source 12 82 115 -33
Tests 5 343 64 +279
Docs 2 10 0 +10
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 19 435 179 +256

Review metrics

Metric Value Why it matters
Production versus test delta production −33, tests +279, docs +10 The bug fix reduces production code while adding boundary regressions for CLI lookup and Workshop proposal identity.

Stored data model

Persistent data-model change detected: serialized state: src/skills/workshop/frontmatter.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #136493
Summary: This PR is the explicit open fix candidate for the canonical skill lookup issue; the web autocomplete PR is a distinct presentation behavior.

Members:

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

Technical review

Best possible solution:

Merge the shared ranked resolver and canonical-name propagation after the exact-head required checks complete, leaving metadata keys as supported aliases rather than mutation selectors.

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

Yes. Current main and v2026.8.2 source show the combined exact name-or-key first-match branch, and the introduced tests construct the conflicting-name workspace scenario across CLI and Workshop flows.

Is this the best way to solve the issue?

Yes. Centralizing ranked resolution at the shared discovery owner and carrying its canonical result into Workshop proposal generation avoids discovery-order selection and frontmatter-name replacement without adding configuration.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This repairs a bounded but user-visible skill-selection and mutation-targeting bug without evidence of an urgent availability or security impact.
  • 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: This is a MEMBER-authored PR, so the external-contributor proof gate does not apply; its body nevertheless supplies source-tool and filesystem/proposal before-and-after evidence for the changed owner paths.

Evidence

What I checked:

  • Current main still has the reported behavior: Current main returns the first entry whose name or metadata key exactly matches, so an earlier metadata alias can still win over a later exact skill name. (src/skills/discovery/status.ts:105, 9aa85210ab75)
  • Released behavior matches current main: The v2026.8.2 source has the same combined exact name-or-key first-match branch, so the issue is present in the latest stable release. (src/skills/discovery/status.ts:105, 0965053fe6b9)
  • Shared resolver repair: The introduced resolver evaluates exact names before exact metadata keys, then case-insensitive and normalized tiers, rejecting ties instead of depending on discovery order. The CLI calls this resolver when formatting skill info. (src/skills/discovery/status.ts:100, b09e55f6f1a8)
  • Workshop writer boundary: Workshop resolves writable skills through the shared resolver, returns the selected canonical name, and uses the live frontmatter name when preparing an update draft. (src/skills/workshop/workspace-skill-read.ts:86, b09e55f6f1a8)
  • Prior finding follow-through: The final branch commit replaces retry guidance based on metadata keys with the resolved skill name, consolidates patch/update proposal construction, and is directly parented by the earlier reviewed head. (src/agents/tools/skill-workshop-tool.ts:518, b09e55f6f1a8)
  • Regression coverage: The new identity regression exercises read-guided update and patch flows where one skill’s metadata key equals another skill’s exact name, then verifies the stored proposal and frontmatter retain the intended skill name. (src/agents/tools/skill-workshop-tool.skill-identity.test.ts:10, b09e55f6f1a8)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Shakker: 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 (4 earlier review cycles)
  • reviewed 2026-09-02T18:25:30.835Z sha cdfc25f :: needs maintainer review before merge. :: none
  • reviewed 2026-09-02T18:51:36.031Z sha 0fae5d3 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-02T19:33:11.059Z sha 4d3030f :: needs changes before merge. :: [P1] Use the resolved name in Workshop retry guidance
  • reviewed 2026-09-02T20:48:10.266Z sha e93cffc :: found issues before merge. :: [P1] Use the resolved name in Workshop retry guidance

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes size: S maintainer Maintainer-authored PR labels Sep 2, 2026
@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 2, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed 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 2, 2026
@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Sep 2, 2026
@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 2, 2026
@steipete steipete changed the title fix(skills): prioritize exact names over metadata aliases fix(skills): preserve canonical names through discovery and workshop Sep 2, 2026
@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 Sep 2, 2026
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. label Sep 2, 2026
@steipete
steipete merged commit cb61be8 into main Sep 2, 2026
243 of 245 checks passed
@steipete
steipete deleted the codex/qa30b-skill-name-resolution branch September 2, 2026 22:54
@steipete

steipete commented Sep 2, 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 3, 2026
…penclaw#136495)

* fix(skills): prioritize exact names over metadata aliases

Fixes openclaw#136493

* test(gateway): assert canonical pending recovery depth

* test(gateway): adopt canonical recovery queue admission

* ci: refresh checks against current main

* fix(skills): preserve canonical names through workshop revisions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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.

Skill lookup can select an earlier alias instead of the exact requested name

1 participant