fix(skills): detect installed built-in catalog entries
Summary
- match registry catalog entries against installed skills using normalized install keys, so built-in entries with catalog ids like built-in/apple-notes render as Installed when the local slug is apple-notes
- apply the same installed check in the detail dialog so duplicate installs are not offered there
- make URL-based skill installation idempotent when the target SKILL.md already exists, returning a no-op success instead of surfacing a red error toast
Closes #3585.
Tests
- cargo fmt --check
- git diff --check
Not run
- pnpm --dir app test -- SkillsExplorerTab.test.tsx (blocked locally: app/node_modules is missing; current Node is v22.22.1 while package requires >=24)
- cargo test install_workflow_from_url_is_idempotent_when_skill_already_exists (blocked locally: missing system pkg-config dependencies alsa.pc and xi.pc)
Summary by CodeRabbit
Release Notes
- Bug Fixes
- Corrected how the Skills Explorer determines whether catalog entries are already installed, improving badge and install-button behavior.
- Made workflow installation idempotent: re-installing an existing skill now succeeds when
SKILL.mdis present, without overwriting. - Updated automated checks to validate the new “already installed” UI and install outcomes.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a45648e3-1ee4-4ffb-b5d2-ae179b59b70d
📥 Commits
Reviewing files that changed from the base of the PR and between 433962edc2e9f58b7c2010abf74a3814e3330cdb and fc0cbaad34db387d4a15500db7d593dfdc5438d6.
📒 Files selected for processing (3)
app/src/components/skills/SkillsExplorerTab.tsxapp/src/components/skills/__tests__/SkillsExplorerTab.test.tsxsrc/openhuman/workflows/ops_install.rs
💤 Files with no reviewable changes (1)
- app/src/components/skills/SkillsExplorerTab.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
- app/src/components/skills/tests/SkillsExplorerTab.test.tsx
- src/openhuman/workflows/ops_install.rs
📝 Walkthrough
Walkthrough
This PR fixes installed-skill detection for built-in catalog entries in the skills explorer and changes workflow URL installs to succeed as a no-op when the target skill is already present, with matching frontend and Rust test updates.
Changes
Skills install parity
| Layer / File(s) | Summary |
|---|---|
Frontend installed-state detection app/src/components/skills/SkillsExplorerTab.tsx, app/src/components/skills/__tests__/SkillsExplorerTab.test.tsx |
The explorer now compares normalized install keys from catalog entries and installed workflows instead of raw IDs. Registry tiles and the detail dialog use isCatalogEntryInstalled(entry, installedKeys) for state and button availability. Tests verify that built-in apple-notes matches the installed workflow slug and correctly shows Installed, while unrelated skills do not trigger false matches. |
Backend already-installed outcome src/openhuman/workflows/ops_install.rs |
install_workflow_from_url now delegates through install_workflow_from_url_with_home(..., home), which uses the home path for both pre- and post-install workflow discovery. When the target directory exists, the function checks for SKILL.md; if present, it returns a successful result with no new skills; collision without SKILL.md remains an error. |
Backend idempotency test src/openhuman/workflows/ops_tests.rs |
A scoped EnvVarGuard utility manages environment state during tests. A new async test uses WireMock to serve SKILL.md and installs the same workflow URL twice, verifying the second run yields no new skills and reports already installed. |
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~25 minutes
Poem
🐇 I sniffed a skill beside the tree,
"Installed already!" it said to me.
No grumpy toast, no second thump,
just tidy keys and a softer jump.
In burrow logs, all calm and bright,
the same old skill now lands just right.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | ⚠️ Warning | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (4 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title 'fix(skills): detect installed built-in catalog entries' directly describes the core fix for detecting pre-installed built-in skills using normalized install keys, matching the primary change across all modified files. |
| Linked Issues check | ✅ Passed | The PR implements all three objectives from issue #3585: normalizes catalog entry matching via install keys (frontend fix), prevents install-already-installed errors by treating re-installs as idempotent (backend fix), and includes comprehensive test coverage for both fixes. |
| Out of Scope Changes check | ✅ Passed | All changes are directly scoped to addressing issue #3585: SkillsExplorerTab refactoring for install-key matching, test updates for the new detection logic, ops_install idempotency handling, and corresponding test coverage. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
Updated in fc0cbaad: removed display-name based installed matching, added a same-name/different-slug regression test, added dialog-level installed gating coverage, and updated install Rustdoc for idempotent already-installed behavior.\n\nValidation: cargo fmt --check passed; git diff --check passed. Local Vitest could not run because node_modules/vitest are not installed and this machine is on Node 22 while the app requires Node >=24.