Repository navigation
fix(skills): complete plugin-cache scans without false attention - #10865
Conversation
Do not materialize unscanned plugin paths as inaccessible copies. Preserve bounded scan failures as typed diagnostics and surface them without inventing installations.
…l evidence Two problems remained after the scan-coverage split, both reproducible against a real ~/.codex/plugins/cache. The scan did not finish. A skill package's own payload — templates, sample apps, vendored fixtures — was walked as if it were a skill tree, so ordinary bundled plugins pushed past the depth and entry bounds. The resulting depth-limit and entry-limit diagnostics then set every skill to Needs attention, which is the same user-facing symptom the split was meant to remove, and the entry bound aborted the remaining walk outright. Traversal is now topology-aware: a directory carrying SKILL.md is a skill package, and Orca descends a bounded two levels below it to find a skill grouped inside, then stops. Pruning payload is a topology decision, not a coverage failure, so it is silent. The entry bound is kept and resized against a measured real cache rather than removed. Orca's own bounds no longer drive the attention pill; a real read failure or an escaping path still does, and the Details dialog still lists every skipped path, so bounded safety is preserved. Candidates now need evidence. A directory was promoted on a bare name match outside a declared skill root, so cached plugins that merely share a skill name were reported as installations Orca never verified, and the match short-circuited traversal so the genuine skill underneath was never found. A candidate now requires a real SKILL.md. Inside a declared skill root an uninspectable link stays fail-closed, because there the plugin itself claims the name. On this machine the scan goes from 3 candidates (2 fabricated, 1 masking a real skill) and 2 coverage issues, to 3 verified candidates at their true paths and zero issues. Refs stablyai#10659 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…odified copy `unrecognized` conflated two unrelated things: an official copy the user edited, and a different tool's skill that happens to share the name. Only the first is theirs to fix, but both lit the amber "Needs attention" pill — and the second offers no exit, since the copy belongs to another tool and must not be deleted. Codex ships its own bundled `computer-use` plugin, so any user with both Orca skills and Codex installed hits this permanently (reported in stablyai#10633). A placement is now `foreign` only on positive evidence along both axes: - Location: a plugin cache, which Orca never installs into and which `eligibleSkillUpdateNames` already provably leaves alone. Everywhere Orca owns stays `unrecognized`, so a tampered official copy can never be waved through. - Content: files were read and none shows byte-level descent from a known release. Empty or unreadable is unknown, not foreign. Foreign placements get their own chip and stop driving the pill; nothing else about eligibility or the update command changes. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
📝 WalkthroughWalkthroughPlugin-cache skill discovery now validates 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
There was a problem hiding this comment.
🧹 Nitpick comments (5)
src/main/skills/skill-plugin-cache-scan.ts (1)
170-199: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low valueReturn early after the entry-limit break.
Once
limitReachedis set at Line 172,entriesis a truncated view of the directory, yet the code still runshasSkillFileanddeclaredPluginSkillRoots(a manifest open + bounded read + parse) on it. Both can now observe an incomplete listing and do avoidable I/O after the budget is spent. ThelimitReachedcheck only happens at Line 200, after the manifest read.♻️ Proposed early return
} finally { await handle.close().catch(() => undefined) } + if (limitReached) { + return + } const isSkillPackage = await hasSkillFile(directory, entries, resolved)src/main/skills/skill-plugin-manifest-roots.ts (1)
80-93: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low valueSize the read buffer from the stat result.
manifestStat.sizeis already validated against the cap at Line 76, so allocating a fixed 256 KiB + 1 buffer for every manifest in the cache is wasted zeroing on typical few-KiB manifests. Keep the+1guard byte so the post-read overflow check at Line 94 still catches a file that grew afterstat.♻️ Proposed buffer sizing
- const content = Buffer.alloc(MAXIMUM_PLUGIN_MANIFEST_BYTES + 1) + const content = Buffer.alloc(Math.min(manifestStat.size, MAXIMUM_PLUGIN_MANIFEST_BYTES) + 1)src/main/skills/skill-plugin-cache-scan.test.ts (3)
519-533: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win1s timeout also covers the
mkfifoprocess spawn.The budget is meant to prove the scan does not block on the FIFO, but
mkdtemp,mkdir, and anexecFileAsyncspawn all run inside it — spawn alone can exceed a second on a loaded CI runner. Consider creating the FIFO before starting the timed assertion, or raising the limit to a few seconds; it still fails fast if the open blocks indefinitely.
295-311: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueBudget literals are duplicated from the scanner.
16_385here and256 * 1024 + 1at Line 390 silently mirrorMAXIMUM_PLUGIN_SCAN_ENTRIESandMAXIMUM_PLUGIN_MANIFEST_BYTES. Tuning either constant turns these into passing-but-meaningless tests rather than failures. Exporting the constants (asMAXIMUM_PLUGIN_SKILL_CANDIDATESalready is) and deriving the fixture sizes keeps them honest.
401-517: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winGate these
symlink()tests behind a Windows helper check.Running
symlink()on Windows can require Developer Mode or elevation; if it fails withEPERM, these tests stop before exercising the plugin scan. Wrap them with a skip/fatal similar to other platform-specific tests and avoid assertingerrorCode: 'ELOOP'unless the link was actually created and later inspected.Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 016e1435-026a-4f0c-a787-3fafada9d7b1
📒 Files selected for processing (25)
src/main/ipc/skills.test.tssrc/main/skills/skill-freshness-inventory.test.tssrc/main/skills/skill-freshness-inventory.tssrc/main/skills/skill-plugin-cache-scan.test.tssrc/main/skills/skill-plugin-cache-scan.tssrc/main/skills/skill-plugin-manifest-roots.tssrc/renderer/src/components/skills/SkillFreshnessNudge.test.tsxsrc/renderer/src/components/skills/SkillFreshnessStatusPill.test.tsxsrc/renderer/src/components/skills/SkillFreshnessUpdateDialog.test.tsxsrc/renderer/src/components/skills/SkillFreshnessUpdateDialog.tsxsrc/renderer/src/components/skills/skill-freshness-grouping.test.tssrc/renderer/src/components/skills/skill-freshness-grouping.tssrc/renderer/src/components/skills/skill-freshness-scan-issues.tsxsrc/renderer/src/components/skills/skill-freshness-skipped-reason.tssrc/renderer/src/hooks/useSkillFreshness.test.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/lib/agent-skill-nav-install-status.test.tssrc/renderer/src/lib/skill-freshness-display-status.test.tssrc/renderer/src/lib/skill-freshness-display-status.tssrc/renderer/src/web/web-preload-api.tssrc/shared/skill-freshness.ts
💤 Files with no reviewable changes (1)
- src/renderer/src/components/skills/skill-freshness-skipped-reason.ts
A manifest's declared skill roots were resolved one by one outside the entry budget, so one plugin could decide how long the whole scan ran; fall back to the bounded walk past a sane root count. Keep the badge and the dialog on the same predicate: Orca's own traversal bounds are listed but never headline or force details open, a fail-closed candidate always names its path, and a skill with no placement is not blamed for a fault elsewhere in the cache.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/renderer/src/components/skills/SkillFreshnessUpdateDialog.tsx (1)
57-65: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winShorten the new rationale comments.
These comments read like PR notes and can be reduced to concise, code-local invariants. As per coding guidelines, comments in TypeScript/TSX should be concise and preferably one line.
Also applies to: 194-195
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 8fe3a926-6dd2-4e17-9b05-9cf1c99d1d11
📒 Files selected for processing (7)
src/main/skills/skill-plugin-cache-scan.test.tssrc/main/skills/skill-plugin-cache-scan.tssrc/main/skills/skill-plugin-manifest-roots.tssrc/renderer/src/components/skills/SkillFreshnessUpdateDialog.test.tsxsrc/renderer/src/components/skills/SkillFreshnessUpdateDialog.tsxsrc/renderer/src/lib/skill-freshness-display-status.test.tssrc/renderer/src/lib/skill-freshness-display-status.ts
🚧 Files skipped from review as they are similar to previous changes (5)
- src/main/skills/skill-plugin-manifest-roots.ts
- src/renderer/src/lib/skill-freshness-display-status.ts
- src/renderer/src/lib/skill-freshness-display-status.test.ts
- src/renderer/src/components/skills/SkillFreshnessUpdateDialog.test.tsx
- src/main/skills/skill-plugin-cache-scan.ts
A fail-closed candidate reads as inaccessible and turns the badge amber, so losing its scan issue to the 16-issue budget left the dialog reporting all-clear against a path nothing named — the split this change removes. Charge those issues past the bound; the candidate cap still bounds them. Also reword the manifest limit copy, which now covers a declared-root count as well as an oversized read.
The issue budget ended the whole walk, so a cache that filled it lost every copy beyond that point — and since Orca's own bounds no longer raise attention, the dialog reported all-clear over a scan that never finished. Stop recording there, keep walking. A bound that does end the walk early now blocks the up-to-date headline instead, and .cursor-plugin is dropped: treating an unverified manifest as a declaration prunes the plugin, so a wrong guess hides real skills.
entry-limit and candidate-limit were recorded through the same display budget as everything else, so a cache that spent that budget on skipped folders lost the one issue proving the scan stopped early — and the dialog went back to reporting all-clear over a truncated scan. Route both through the shared reason predicate so the scanner and the dialog cannot disagree about what counts as ending the walk.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 5226e75d-0d57-48fe-8584-19dac226571f
📒 Files selected for processing (12)
src/main/skills/skill-plugin-cache-scan.test.tssrc/main/skills/skill-plugin-cache-scan.tssrc/main/skills/skill-plugin-manifest-roots.tssrc/renderer/src/components/skills/SkillFreshnessUpdateDialog.test.tsxsrc/renderer/src/components/skills/SkillFreshnessUpdateDialog.tsxsrc/renderer/src/components/skills/skill-freshness-scan-issues.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/shared/skill-freshness.ts
🚧 Files skipped from review as they are similar to previous changes (9)
- src/renderer/src/components/skills/skill-freshness-scan-issues.tsx
- src/shared/skill-freshness.ts
- src/renderer/src/i18n/locales/es.json
- src/renderer/src/i18n/locales/zh.json
- src/renderer/src/i18n/locales/en.json
- src/renderer/src/components/skills/SkillFreshnessUpdateDialog.tsx
- src/renderer/src/i18n/locales/ko.json
- src/main/skills/skill-plugin-manifest-roots.ts
- src/main/skills/skill-plugin-cache-scan.ts
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 48a2eeb3-1537-4d13-a37e-2d90e06d9f25
📒 Files selected for processing (4)
src/main/skills/skill-plugin-cache-scan.test.tssrc/main/skills/skill-plugin-cache-scan.tssrc/renderer/src/components/skills/SkillFreshnessUpdateDialog.test.tsxsrc/shared/skill-freshness.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- src/renderer/src/components/skills/SkillFreshnessUpdateDialog.test.tsx
- src/shared/skill-freshness.ts
- src/main/skills/skill-plugin-cache-scan.ts
…-coverage # Conflicts: # src/renderer/src/components/skills/SkillFreshnessUpdateDialog.test.tsx # src/renderer/src/components/skills/SkillFreshnessUpdateDialog.tsx # src/renderer/src/i18n/locales/en.json # src/renderer/src/i18n/locales/es.json # src/renderer/src/i18n/locales/ja.json # src/renderer/src/i18n/locales/ko.json # src/renderer/src/i18n/locales/zh.json
A plugin that links its skills outside the cache root is a packaging choice by the vendor — a content-addressed store, a dev-linked package — not a fault the user can clear. Deleting the link only makes their package manager recreate it. Treating it as attention regressed installs that are clean on main: one such link turned every installed skill amber, reintroducing the unclearable pill this change exists to remove, for a different population. It stays listed in Details alongside the other bounds, so the coverage gap is still visible. Leaves io-error as the only attention reason: the one that is a fact about the user's own disk rather than a bound Orca chose.
The entry-limit/candidate-limit cases asserted only the summary headline, so they passed with the scan-issue list removed entirely — the user would be told the scan stopped early and never told where. Proven by negative control: removing <SkillFreshnessScanIssues> failed 2 of 4 before, 4 of 4 now.
|
Merged as 2cf91b8 — thank you, this was a genuinely good catch and the right fix. The part that mattered most was diagnosing that the bug wasn't the pill or the dialog, but We pushed a few commits on top, so you're not surprised by them:
Verified with an A/B on a real Codex cache before and after: main fabricates 8 nonexistent placements and pins the cards amber with no way to clear them; your branch is clean on the identical fixture. 36/36 CI green. Really appreciate the depth of the write-up on the original issues — the reproduction detail made this straightforward to confirm. |
The payload prune had only its miss side covered, so the bound could be raised or lowered by a refactor without anything failing. Both directions are now pinned: a skill is found through 2 intermediate directories below a package and missed at 3. Raising the bound spends the entry budget on vendor payload — the cost that made ordinary caches collapse and pin every skill amber (#10865). Missing a deeper copy costs only a Details row, since a plugin-cache placement is not convergeable by any update command. Recording the tradeoff on the constant so the next person to touch it knows which direction is the safe one. No behavior change. Closes #11454
The payload prune had only its miss side covered, so the bound could be raised or lowered by a refactor without anything failing. Both directions are now pinned: a skill is found through 2 intermediate directories below a package and missed at 3. Raising the bound spends the entry budget on vendor payload — the cost that made ordinary caches collapse and pin every skill amber (#10865). Missing a deeper copy costs only a Details row, since a plugin-cache placement is not convergeable by any update command. Recording the tradeoff on the constant so the next person to touch it knows which direction is the safe one. No behavior change. Closes #11454
|
looking into it |
…blyai#10865) Fixes the P0 where skill cards showed an unclearable amber "Needs attention" while the Details dialog reported everything up to date. Root cause: when the plugin-cache scan tripped one of its own bounds it recorded an incomplete path, and inventorySkillFreshness expanded that into one fabricated placement per manifest skill at a path it never stat'ed. Those synthetic "inaccessible" copies lit the pill, were filtered out of the dialog, and could never be cleared because plugin-cache is not an updatable topology. - Removes the fabrication; reports typed scan issues instead. - Requires readable SKILL.md evidence before promoting a directory to a candidate, so a same-named foreign plugin (Codex's own computer-use) no longer flags. - Prunes skill payloads and node_modules so ordinary vendor caches stop tripping the depth and entry bounds. - Partitions scan reasons: only a real read failure raises a pill; bounds that ended the walk block an all-clear claim; the rest are Details-only. Fixes stablyai#10633. Refs stablyai#10659, stablyai#10904, stablyai#10918, stablyai#10775, stablyai#10791, stablyai#10813.
…lyai#11462) The payload prune had only its miss side covered, so the bound could be raised or lowered by a refactor without anything failing. Both directions are now pinned: a skill is found through 2 intermediate directories below a package and missed at 3. Raising the bound spends the entry budget on vendor payload — the cost that made ordinary caches collapse and pin every skill amber (stablyai#10865). Missing a deeper copy costs only a Details row, since a plugin-cache placement is not convergeable by any update command. Recording the tradeoff on the constant so the next person to touch it knows which direction is the safe one. No behavior change. Closes stablyai#11454
Summary
Fixes incomplete plugin-cache scans and false
Needs attentionstates.SKILL.mdevidence before creating a skill candidate.Needs attentionwarnings in Orca.Needs attention; update eligibility is unchanged.Testing
pnpm typecheckpnpm buildpnpm lint(blocked by six pre-existing Ghostty search-keyword localization-coverage findings; changed-fileoxlintandoxfmt --checkpass)Up to dateAI Review Report
Claude reviewed scan traversal, manifest handling, issue retention, candidate evidence, plugin-cache attention behavior, and UI/type consistency. Follow-up findings around invalid manifest declarations and issue-limit reporting were fixed with regression tests; the final exact-SHA review passed with no blocking findings.
Security Audit
Reviewed path traversal, symlink escapes, bounded scans, unreadable files, command execution, IPC, secrets, auth, and dependencies. The change adds no command, IPC, auth, secret, dependency, or write surface; real path and read failures remain fail-closed.
Notes
#10877 has been superseded and folded into this PR.
Refs #10659
Fixes #10633