Skip to content

feat(skills): resolve explicit $skill references on every channel - #123387

Merged
steipete merged 2 commits into
mainfrom
steipete/issue-123367-explicit-skill-refs
Aug 14, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/issue-123367-explicit-skill-refs

Conversation

@steipete

@steipete steipete commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Part of #123367 (Phase 1+3)

What Problem This Solves

Explicit $skill-name references only worked on WebChat/Control UI turns; every other channel kept the token literal, so the same message behaved differently per channel. Manual-only skills (disable-model-invocation: true) additionally could not be invoked via $ references at all — the explicit resolver skipped them.

Why This Change Was Made

Maintainer product decision on #123367: if the user explicitly names a skill, it is invoked — everywhere. Resolution stays in the reply pipeline (one harness-independent owner before harness dispatch), so behavior is identical across embedded, Claude, and Codex harnesses and across channels. disable-model-invocation now governs exactly what its name says: model-initiated selection. Explicitly referenced hidden skills carry their SKILL.md path in the injected instruction because the model cannot discover them from the available-skills prompt; model-visible skill lines stay byte-identical for prompt-cache stability.

Existing guards are unchanged: authorized senders only, \$name escaping, all-uppercase shell variables ($PATH, $HOME) stay literal, resolution only against real eligible skill names, 8-reference cap.

Phase 2 (Codex-side dedup: pass OpenClaw-resolved selections as structured UserInput::Skill and neutralize consumed tokens, salvaging the #123311 design) follows as its own PR.

User Impact

$skill-name in a Telegram/Discord/Slack/etc. message from an authorized sender now invokes the skill exactly like on WebChat, including manual-only skills. Docs updated (docs/tools/skills.md).

Evidence

  • Focused suites green: node scripts/run-vitest.mjs src/auto-reply/reply/get-reply-inline-actions.skip-when-config-empty.test.ts src/skills/discovery/chat-commands.test.ts (24 + 31 passed). The prior contract-pinning test ("keeps $ skill references literal on message channels") is flipped to assert resolution and hidden-skill path rendering.
  • node scripts/check-changed.mjs green.
  • Codex autoreview clean (gpt-5.6-sol, high): "patch is correct (0.98)".
  • Production LOC +9/−6 (net +3); docs +10/−11; tests +18/−9.

Red-main heal (bundled per landing policy)

Current main fails the full-suite ownership audit (test/vitest-projects-config.test.ts): extensions/codex/src/app-server/run-attempt-state.test.ts (added by #123345 without a lane owner) was registered in two vitest lanes by independent repairs — attempt-light via #123235 and attempt-extra via #123363. The second commit here removes the attempt-light entry so attempt-extra keeps ownership (matching #123363's rationale); audit passes locally (21 tests green).

@clawsweeper

clawsweeper Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 14, 2026 00:24
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: XS maintainer Maintainer-authored PR labels Aug 14, 2026
@clawsweeper clawsweeper Bot added mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. 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. labels Aug 14, 2026
@clawsweeper

clawsweeper Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 13, 2026, 8:28 PM ET / August 14, 2026, 00:28 UTC.

ClawSweeper review

What this changes

The PR resolves authorized explicit $skill references on all chat channels and permits explicitly named skills that are hidden from model-initiated selection.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open for maintainer review. The supplied PR material describes the parent issue’s approved direction, but this review environment could not execute read-only repository commands, so current-main, exact-head, history, scoped policy, and the claimed Codex-harness parity could not be verified.

Priority: P2
Reviewed head: b6f5dc46bdb01eb6e2a4258e2eddc6cf2d24f6f0
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The proposed patch is focused and has supplied test evidence, but reviewer-side source and contract inspection could not establish merge-ready confidence.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a member-authored PR, so the external-contributor proof gate does not apply; the supplied focused test results remain supplemental evidence.
Patch quality 🦐 gold shrimp (3/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; the supplied focused test results remain supplemental evidence.
Evidence reviewed 4 items Submitted implementation: The supplied PR patch removes the message-channel surface gate around explicit skill-reference detection and changes the resolver to retain model-hidden skills when explicitly named.
Submitted compatibility documentation: The supplied documentation patch changes the stated contract from WebChat-only references to authorized references on every channel, including explicit invocation of model-hidden skills.
Related product direction: The linked parent issue records the intended semantics: authorized current-message references should work across channels while disable-model-invocation only limits model-initiated selection.
Findings None None.
Security None None.

How this fits together

Inbound channel text enters the auto-reply pipeline before the selected agent harness runs. This change resolves eligible explicit skill references there and injects instructions for the harness to use before producing a channel reply.

flowchart LR
A[Authorized inbound message] --> B[Auto-reply pipeline]
B --> C{Explicit skill reference?}
C -->|Yes| D[Resolve eligible skills]
D --> E[Inject skill instruction]
E --> F[Agent harness]
F --> G[Channel reply]
C -->|No| F
Loading

Decision needed

Question Recommendation
Can a maintainer confirm the exact-head current-message and harness-boundary behavior before approving this intentional external-channel semantic change? Validate and merge: Review the exact head after confirming authorized external-channel references, literal escapes and shell variables, and harness handoff behavior.

Why: The parent issue supplies product direction, but this review could not inspect the current implementation, relevant history, or the Codex-facing contract required by the PR’s parity claim.

Before merge

  • Resolve merge risk (P1) - Authorized external-channel messages that previously treated a valid $skill token literally will begin invoking that skill; the parent issue calls this intentional, but exact-head compatibility verification is still needed.
  • Resolve merge risk (P1) - The PR claims parity across embedded, Claude, and Codex harnesses, but the required local source and dependency-contract inspection could not run in this environment.
  • Complete next step (P2) - A member-authored, maintainer-labeled PR needs exact-head human review; the repository-inspection failure prevents a reliable automated merge verdict.
Agent review details

Security

None.

PR surface

Source +3, Tests +9, Docs -1. Total +11 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 2 9 6 +3
Tests 2 18 9 +9
Docs 1 9 10 -1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 36 25 +11

Review metrics

Metric Value Why it matters
Production versus test LOC production +9/−6 (net +3); tests +18/−9 The supplied PR body reports small feature growth with focused regression coverage; exact diff classification could not be independently verified.

Mantis proof suggestion

A redacted Telegram transcript would materially confirm the intended channel-visible invocation behavior and literal guard behavior. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis telegram live proof: verify that an authorized `$skill-name` reference invokes its skill while `$PATH` and `\$skill-name` remain literal.

Merge-risk options

Maintainer options:

  1. Prove the changed channel contract before merge (recommended)
    Confirm an authorized external-channel $skill reference invokes only the current message’s eligible skill while escaped and shell-variable forms remain literal.
  2. Accept the behavior change explicitly
    Merge only if maintainers accept that existing authorized message text with valid skill tokens intentionally changes from literal text to invocation.

Technical review

Best possible solution:

Preserve one reply-pipeline resolver for authorized current-message references, then validate exact-head behavior across a messaging channel and each affected harness before merging.

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

No. The submitted tests describe a focused path, but the read-only checkout could not execute any inspection or reproduction command in this environment.

Is this the best way to solve the issue?

Unclear. Centralizing resolution before harness dispatch matches the stated parent direction, but current-source and Codex-contract inspection are required to establish that it is the best owner boundary.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against 245c14f30fa9.

Labels

Label changes:

  • add P2: This is a bounded, intentional behavior change for authorized channel messages, with no evidence of an emergency failure.
  • add merge-risk: 🚨 compatibility: The PR changes existing external-channel handling of valid $skill text from literal content to an explicit skill invocation.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add 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; the supplied focused test results remain supplemental evidence.
  • add mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The generic channel-parity behavior includes a visible Telegram message flow that can be demonstrated in a short real-chat proof.

Label justifications:

  • P2: This is a bounded, intentional behavior change for authorized channel messages, with no evidence of an emergency failure.
  • merge-risk: 🚨 compatibility: The PR changes existing external-channel handling of valid $skill text from literal content to an explicit skill invocation.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • 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; the supplied focused test results remain supplemental evidence.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The generic channel-parity behavior includes a visible Telegram message flow that can be demonstrated in a short real-chat proof.

Evidence

What I checked:

  • Submitted implementation: The supplied PR patch removes the message-channel surface gate around explicit skill-reference detection and changes the resolver to retain model-hidden skills when explicitly named. (src/auto-reply/reply/get-reply-inline-actions.ts:357, b6f5dc46bdb0)
  • Submitted compatibility documentation: The supplied documentation patch changes the stated contract from WebChat-only references to authorized references on every channel, including explicit invocation of model-hidden skills. Public docs: docs/tools/skills.md. (docs/tools/skills.md:155, b6f5dc46bdb0)
  • Related product direction: The linked parent issue records the intended semantics: authorized current-message references should work across channels while disable-model-invocation only limits model-initiated selection.
  • Inspection infrastructure failure: The attempted read-only repository inspection did not run because the sandbox reported bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted; therefore no current-tree, history, release, scoped-policy, or sibling Codex source claim is made.

Likely related people:

  • steipete: The linked parent issue records the channel-parity decision and this PR implements its first and third phases. (role: product-direction author and proposed implementation author; confidence: medium; commits: b6f5dc46bdb0; files: src/auto-reply/reply/get-reply-inline-actions.ts, docs/tools/skills.md)
  • hannesrudolph: The PR and parent issue explicitly describe the closed prior skill-reference design as input to the remaining Codex follow-up. (role: related prior design contributor; confidence: low; commits: c8600e9840f5; files: src/skills/discovery/chat-command-invocation.ts)

Rank-up moves

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

  • Perform an exact-head source review of the reply pipeline, skill resolver, and affected harness boundaries.
  • Capture a redacted messaging-channel proof that an authorized explicit reference invokes the intended skill while $PATH and escaped references remain literal.

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.

Explicit $skill-name references from authorized senders now resolve on all
channels, not only WebChat/Control UI, and explicitly referenced skills are
always invoked: disable-model-invocation keeps a skill out of model-initiated
selection but no longer blocks user-initiated explicit references. Hidden
skills carry their SKILL.md path in the injected instruction since the model
cannot discover them from the available-skills prompt.

Part of #123367
Main is red on the full-suite ownership audit from the #123235 x #123363 double-registration race. Keep run-attempt-state.test.ts beside its run-attempt siblings in the extra lane and heal the audit here per the land-onto-red-main policy.
@steipete
steipete force-pushed the steipete/issue-123367-explicit-skill-refs branch from b6f5dc4 to ccdd706 Compare August 14, 2026 00:41
@steipete
steipete merged commit 18163ba into main Aug 14, 2026
244 of 246 checks passed
@steipete
steipete deleted the steipete/issue-123367-explicit-skill-refs branch August 14, 2026 01:02
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 14, 2026
…enclaw#123387)

* feat(skills): resolve explicit $skill references on every channel

Explicit $skill-name references from authorized senders now resolve on all
channels, not only WebChat/Control UI, and explicitly referenced skills are
always invoked: disable-model-invocation keeps a skill out of model-initiated
selection but no longer blocks user-initiated explicit references. Hidden
skills carry their SKILL.md path in the injected instruction since the model
cannot discover them from the available-skills prompt.

Part of openclaw#123367

* fix(ci): dedupe run-attempt-state vitest lane ownership

Main is red on the full-suite ownership audit from the openclaw#123235 x openclaw#123363 double-registration race. Keep run-attempt-state.test.ts beside its run-attempt siblings in the extra lane and heal the audit here per the land-onto-red-main policy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS 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