Skip to content

fix(skills): keep sag available with alternate credentials - #147685

Merged
obviyus merged 3 commits into
mainfrom
bugloop/sag-skill-alternate-credentials
Sep 14, 2026
Merged

obviyus merged 3 commits into
mainfrom
bugloop/sag-skill-alternate-credentials

Conversation

@obviyus

@obviyus obviyus commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator

AI-assisted.

Supersedes #147381 by @LiuwqGit.
Closes #147346.

What Problem This Solves

A working sag skill appears unavailable, and doctor --fix disables it, when its installed CLI obtains credentials outside the Gateway environment.

User Impact

Installed sag stays available with alternate credentials. The executable checks credentials when it runs. Optional configured-key injection remains available.

Doctor does not automatically re-enable entries disabled by an earlier run. The saved flag does not distinguish Doctor repair from an intentional user choice. If the earlier disablement was incorrect, run openclaw config set skills.entries.sag.enabled true. Refresh the Skills list; the next agent turn uses the refreshed skill settings.

Why This Change Was Made

The bundled skill declaration keeps its executable requirement and removes the incorrect environment prerequisite. The original metadata fix and authorship are preserved. The regression now runs registered skills info sag --json and stopped-Gateway doctor --fix, including the saved enable flag, instead of calling the status helper directly.

Evidence

Check Main This change
Real CLI and Gateway skills.status Needs setup; not visible Ready; visible
Control UI Skills list Under Needs Setup Under Ready
Skill details Missing-variable warning Warning gone; key editor retained
Stopped-Gateway Doctor Saves enabled=false Preserves absent or explicitly true enablement
Registered CLI regression Four expected failures Four passes

Correlated request/response frames confirm that both the browser and CLI received skills.status from the Gateway. The installed executable's alternate key-file check uses a local test endpoint; live-account validity and audio production are not claimed.

Fresh merge 489365ccffab2e043d676ed3b01cb2e0b5a203d4 has candidate parent 40632360f3ff8162fa27503e08c636223c8cc852 and main parent 4750ff8d2b389280bdeaeec44d78b88cb7fb81d1. It passes 4 registered CLI regressions, 44 skill tests, 10 Doctor tests, and 153 test-registration checks. Changed-file lint, formatting, and whitespace checks pass. Main's regression run used d0cf628ff20d234657813074774739bcf321447d with the same test and unchanged main metadata.

The process test uses the existing isolated CLI project. Fixed test owners and CI job counts remain unchanged; generated compact group placement can change as the test inventory grows. Readiness does not establish live-account validity or successful audio output.

Skills list

Before After
sag under Needs Setup sag under Ready

Missing requirement and key editor

Before After
Missing requirement with key editor Eligible with key editor retained

Consumers

  • Discovery, Gateway and CLI status, both Doctor skill checks, onboarding, summaries, and recommendations read the same prerequisite declaration.
  • The Control UI list and agent controls consume the corrected status; the optional key editor remains available.
  • Runtime selection reads the same metadata. New snapshots preserve optional key injection; existing snapshot refresh rules remain unchanged.
  • Native clients consume the existing response. The macOS binary-trust reader uses the unchanged binary requirement.
  • Explicit disablement, allowlists, agent filters, configured-secret isolation, and automatic-update Doctor protection remain unchanged.

Compatibility

No new configuration key, schema, protocol, dependency, or runtime credential reader. Existing disabled entries are not automatically re-enabled. The skill prose assigns credential checking to the executable; readiness does not promise valid account credentials or successful speech generation.

LiuwqGit and others added 2 commits September 14, 2026 06:57
The bundled sag metadata declared ELEVENLABS_API_KEY as a mandatory env
requirement, so the skill was reported unavailable — and doctor --fix
offered to disable it — whenever the key came from another source sag
itself supports (SAG_API_KEY, key files, --api-key-file). Readiness now
gates on the sag binary only and delegates credential validation to the
CLI, matching the bundled himalaya pattern.

Fixes #147346

(cherry picked from commit 870577c)
@clawsweeper

clawsweeper Bot commented Sep 14, 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 cli CLI command changes size: S maintainer Maintainer-authored PR labels Sep 14, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 10:14 PM ET / September 14, 2026, 02:14 UTC (Revision 2).

ClawSweeper review

What this changes

The PR keeps installed sag skills available with alternate credentials, documents recovery from earlier disablement, and adds registered CLI readiness and Doctor regression coverage.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused fix: current main and v2026.9.4 retain the incorrect prerequisite. No blocking defect was found, the supplied proof supports the changed behavior, and the previous draft blocker is resolved.

Priority: P2
Reviewed head: 54c7e0d8e385da36c31bc8bf9d490130bbe073f5

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level correction with convincing before/after evidence and meaningful registered-command regression coverage.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after screenshots show the metadata correction reaching Control UI readiness while retaining the key editor; the captured real CLI/Gateway and stopped-Gateway Doctor results cover status and saved enablement. Subsequent edits only relocate explanatory prose, so the proof remains applicable; live speech synthesis is outside this change.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected before/after screenshots show the metadata correction reaching Control UI readiness while retaining the key editor; the captured real CLI/Gateway and stopped-Gateway Doctor results cover status and saved enablement. Subsequent edits only relocate explanatory prose, so the proof remains applicable; live speech synthesis is outside this change.
Evidence reviewed 9 items Current main still needs the fix: The fetched main revision retains mandatory ELEVENLABS_API_KEY despite documenting SAG_API_KEY as supported.
Latest release remains affected: Inspection of v2026.9.4 also shows the mandatory environment prerequisite; this is not an already-shipped correction.
One existing readiness owner: Status and runtime selection evaluate declared requirements. Explicit disablement and allowlists remain enforced; retaining primaryEnv preserves optional configured-key injection. The inspected readiness and Doctor modules have identical blob identities on the checkout and fetched main.
Findings None None.
Security None None.

How this fits together

OpenClaw reads bundled skill prerequisites to decide which skills appear available to agents, CLI users, and the Control UI. Doctor consumes that same status when deciding whether to disable unavailable skills; sag itself resolves credentials when invoked.

flowchart TD
  A[Bundled sag metadata] --> B[Shared skill readiness]
  C[Installed executable and settings] --> B
  B --> D[CLI and Control UI status]
  B --> E[Doctor repair decision]
  B --> F[Agent skill availability]
  F --> G[sag resolves credentials]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +134, Docs +2. Total +136 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 134 0 +134
Docs 2 3 1 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 137 1 +136

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #147346
Summary: This PR targets the confirmed sag metadata mismatch and carries forward the earlier proposed fix.

Members:

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

Technical review

Best possible solution:

Keep credential validation with sag, preserve binary gating and optional key injection, and retain explicit recovery without overriding intentional disablement.

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

Yes, from source: install sag, supply only its supported alternate credentials, and omit ELEVENLABS_API_KEY and the OpenClaw apiKey override; current main marks it unavailable and ordinary Doctor repair can disable it. This review did not execute the reproduction.

Is this the best way to solve the issue?

Yes. Correcting the existing skill declaration fixes the shared consumers without introducing a competing credential reader or changing global Doctor policy.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This fixes misleading readiness and unwanted disablement of a working optional skill, with limited blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected before/after screenshots show the metadata correction reaching Control UI readiness while retaining the key editor; the captured real CLI/Gateway and stopped-Gateway Doctor results cover status and saved enablement. Subsequent edits only relocate explanatory prose, so the proof remains applicable; live speech synthesis is outside this change.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after screenshots show the metadata correction reaching Control UI readiness while retaining the key editor; the captured real CLI/Gateway and stopped-Gateway Doctor results cover status and saved enablement. Subsequent edits only relocate explanatory prose, so the proof remains applicable; live speech synthesis is outside this change.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after screenshots show the metadata correction reaching Control UI readiness while retaining the key editor; the captured real CLI/Gateway and stopped-Gateway Doctor results cover status and saved enablement. Subsequent edits only relocate explanatory prose, so the proof remains applicable; live speech synthesis is outside this change.

Evidence

What I checked:

  • Current main still needs the fix: The fetched main revision retains mandatory ELEVENLABS_API_KEY despite documenting SAG_API_KEY as supported. (skills/sag/SKILL.md:10, d9c45426e163)
  • Latest release remains affected: Inspection of v2026.9.4 also shows the mandatory environment prerequisite; this is not an already-shipped correction. (skills/sag/SKILL.md:10, 3a9d69db306c)
  • One existing readiness owner: Status and runtime selection evaluate declared requirements. Explicit disablement and allowlists remain enforced; retaining primaryEnv preserves optional configured-key injection. The inspected readiness and Doctor modules have identical blob identities on the checkout and fetched main. (src/skills/loading/config.ts:79, 54c7e0d8e385)
  • Verified credential contract: The target skill explicitly requires the sag executable and documents its credential flags, establishing the dependency signal. The verified steipete/sag repository resolves --api-key, explicit key files, ELEVENLABS_API_KEY, and SAG_API_KEY; file variables include ELEVENLABS_API_KEY_FILE and SAG_API_KEY_FILE. (cmd/api_key.go:12, d86d2c607329)
  • Regression coverage follows registered commands: Four cases exercise skills info with and without the executable and stopped-Gateway Doctor with absent or true saved enablement. The process suite registers the new file and reuses existing isolated runtime helpers. Tests were inspected, not executed during this read-only review. (src/cli/skills-cli.sag.process.test.ts:96, 54c7e0d8e385)
  • Inspected visual and runtime evidence: All four prepared images were inspected: sag moves from Needs Setup to Ready, the missing-variable warning disappears, and the API-key editor remains. The captured PR body reports real CLI/Gateway status and stopped-Gateway Doctor before/after outcomes, with explicit limits excluding live-account validity and audio synthesis. Its captured sourceRevision is 5248e94caf0ca07dc7ae6a217cf5517f5826ef1239bd28bbc36a4e633880fcf2. (40632360f3ff)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; 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 (1 earlier review cycle)
  • reviewed 2026-09-14T01:48:35.794Z sha 4063236 :: needs changes before merge. :: none

@obviyus
obviyus marked this pull request as ready for review September 14, 2026 02:03
@obviyus

obviyus commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator Author

landpr-approve-admin-merge
pr: 147685
head: 54c7e0d
scope: owner-review

@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Sep 14, 2026
@obviyus
obviyus merged commit f9c7173 into main Sep 14, 2026
217 checks passed
@obviyus
obviyus deleted the bugloop/sag-skill-alternate-credentials branch September 14, 2026 02:57
@obviyus

obviyus commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks @LiuwqGit!

Proof: The Skills list and CLI show installed sag as ready with alternate credentials, and Doctor preserves its saved enablement.

  • Bug: A working skill appeared unavailable and Doctor disabled it.
  • Fix: Readiness keeps the executable requirement and lets sag check credentials when it runs.
Before After
Needs setup; Doctor saves disabled Ready; Doctor preserves enablement

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
…147685)

AI-assisted.

Supersedes openclaw#147381 by @LiuwqGit.
Closes openclaw#147346.

## What Problem This Solves

A working `sag` skill appears unavailable, and `doctor --fix` disables it, when its installed CLI obtains credentials outside the Gateway environment.

## User Impact

Installed `sag` stays available with alternate credentials. The executable checks credentials when it runs. Optional configured-key injection remains available.

Doctor does not automatically re-enable entries disabled by an earlier run. The saved flag does not distinguish Doctor repair from an intentional user choice. If the earlier disablement was incorrect, run `openclaw config set skills.entries.sag.enabled true`. Refresh the Skills list; the next agent turn uses the refreshed skill settings.

## Why This Change Was Made

The bundled skill declaration keeps its executable requirement and removes the incorrect environment prerequisite. The original metadata fix and authorship are preserved. The regression now runs registered `skills info sag --json` and stopped-Gateway `doctor --fix`, including the saved enable flag, instead of calling the status helper directly.

## Evidence

| Check | Main | This change |
| --- | --- | --- |
| Real CLI and Gateway `skills.status` | Needs setup; not visible | Ready; visible |
| Control UI Skills list | Under Needs Setup | Under Ready |
| Skill details | Missing-variable warning | Warning gone; key editor retained |
| Stopped-Gateway Doctor | Saves `enabled=false` | Preserves absent or explicitly true enablement |
| Registered CLI regression | Four expected failures | Four passes |

Correlated request/response frames confirm that both the browser and CLI received `skills.status` from the Gateway. The installed executable's alternate key-file check uses a local test endpoint; live-account validity and audio production are not claimed.

Fresh merge `489365ccffab2e043d676ed3b01cb2e0b5a203d4` has candidate parent `40632360f3ff8162fa27503e08c636223c8cc852` and main parent `c0c96881fafde0c7233634efb2ec656d11c9d5fe`. It passes 4 registered CLI regressions, 44 skill tests, 10 Doctor tests, and 153 test-registration checks. Changed-file lint, formatting, and whitespace checks pass. Main's regression run used `b02160ba495e16a79daefed319200ef062027a4b` with the same test and unchanged main metadata.

The process test uses the existing isolated CLI project. Fixed test owners and CI job counts remain unchanged; generated compact group placement can change as the test inventory grows. Readiness does not establish live-account validity or successful audio output.

### Skills list

| Before | After |
| --- | --- |
| ![sag under Needs Setup](https://gist.githubusercontent.com/obviyus/847a6af1eb35eb2c2d2fa4347bb6843d/raw/dcfea44f39bef00958bd6ef53f80029358f3ec32/base-skills-list.png) | ![sag under Ready](https://gist.githubusercontent.com/obviyus/847a6af1eb35eb2c2d2fa4347bb6843d/raw/dcfea44f39bef00958bd6ef53f80029358f3ec32/candidate-skills-list.png) |

### Missing requirement and key editor

| Before | After |
| --- | --- |
| ![Missing requirement with key editor](https://gist.githubusercontent.com/obviyus/847a6af1eb35eb2c2d2fa4347bb6843d/raw/dcfea44f39bef00958bd6ef53f80029358f3ec32/base-skill-detail.png) | ![Eligible with key editor retained](https://gist.githubusercontent.com/obviyus/847a6af1eb35eb2c2d2fa4347bb6843d/raw/dcfea44f39bef00958bd6ef53f80029358f3ec32/candidate-skill-detail.png) |

## Consumers

- Discovery, Gateway and CLI status, both Doctor skill checks, onboarding, summaries, and recommendations read the same prerequisite declaration.
- The Control UI list and agent controls consume the corrected status; the optional key editor remains available.
- Runtime selection reads the same metadata. New snapshots preserve optional key injection; existing snapshot refresh rules remain unchanged.
- Native clients consume the existing response. The macOS binary-trust reader uses the unchanged binary requirement.
- Explicit disablement, allowlists, agent filters, configured-secret isolation, and automatic-update Doctor protection remain unchanged.

## Compatibility

No new configuration key, schema, protocol, dependency, or runtime credential reader. Existing disabled entries are not automatically re-enabled. The skill prose assigns credential checking to the executable; readiness does not promise valid account credentials or successful speech generation.

Co-authored-by: LiuwqGit <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
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 maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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.

[Bug]: doctor --fix disables healthy skills on env-only readiness (false negative, e.g. sag with file-based key)

2 participants