Skip to content

fix(skills): complete plugin-cache scans without false attention - #10865

Merged
brennanb2025 merged 16 commits into
stablyai:mainfrom
5Hyeons:agent/fix-plugin-scan-coverage
Jul 28, 2026
Merged

brennanb2025 merged 16 commits into
stablyai:mainfrom
5Hyeons:agent/fix-plugin-scan-coverage

Conversation

@5Hyeons

@5Hyeons 5Hyeons commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes incomplete plugin-cache scans and false Needs attention states.

  • Requires readable SKILL.md evidence before creating a skill candidate.
  • Stops scanning inside verified skill payloads and reports bounded scan failures without inventing placements.
  • Prevents same-name skills in externally managed plugin caches from causing false Needs attention warnings in Orca.
  • Real read and path-containment failures still trigger Needs attention; update eligibility is unchanged.

Testing

  • pnpm typecheck
  • pnpm build
  • pnpm lint (blocked by six pre-existing Ghostty search-keyword localization-coverage findings; changed-file oxlint and oxfmt --check pass)
  • Plugin-cache scan tests: 27 tests
  • Main skills suites: 95 tests across 11 files
  • Localization catalog and locale parity checks
  • Dev Electron with a real Codex plugin cache: Orchestration and Computer Use both remain Up to date

AI 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

5Hyeons added 2 commits July 27, 2026 15:09
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]>
@5Hyeons 5Hyeons changed the title fix(skills): separate plugin scan coverage from installations fix(skills): complete plugin-cache scans without fake placements Jul 27, 2026
5Hyeons and others added 3 commits July 27, 2026 18:33
…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]>
@5Hyeons 5Hyeons changed the title fix(skills): complete plugin-cache scans without fake placements fix(skills): complete cache scans and classify foreign skills Jul 27, 2026
@5Hyeons 5Hyeons changed the title fix(skills): complete cache scans and classify foreign skills fix(skills): complete plugin-cache scans without false attention Jul 27, 2026
@5Hyeons
5Hyeons marked this pull request as ready for review July 27, 2026 12:46
@coderabbitai

coderabbitai Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Plugin-cache skill discovery now validates SKILL.md, supports manifest-declared roots, enforces traversal and read limits, and records structured scan issues for filesystem and boundary failures. Freshness inventories propagate these issues alongside installations and eligibility data. Renderer status logic, update dialogs, issue lists, localized strings, preload fallbacks, and test fixtures now handle incomplete scans and plugin-cache placements.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.45% 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
Title check ✅ Passed The title clearly summarizes the main fix: completing plugin-cache scans and avoiding false attention states.
Description check ✅ Passed The description covers summary, testing, AI review, security, and notes; only the Screenshots section is omitted.
Linked Issues check ✅ Passed The changes address #10633 by making plugin-cache scan failures visible and preventing false Needs attention from foreign same-name skills.
Out of Scope Changes check ✅ Passed All code changes stay within skills freshness scanning, UI, i18n, and tests; no unrelated features stand out.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (5)
src/main/skills/skill-plugin-cache-scan.ts (1)

170-199: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

Return early after the entry-limit break.

Once limitReached is set at Line 172, entries is a truncated view of the directory, yet the code still runs hasSkillFile and declaredPluginSkillRoots (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. The limitReached check 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 value

Size the read buffer from the stat result.

manifestStat.size is 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 +1 guard byte so the post-read overflow check at Line 94 still catches a file that grew after stat.

♻️ 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 win

1s timeout also covers the mkfifo process spawn.

The budget is meant to prove the scan does not block on the FIFO, but mkdtemp, mkdir, and an execFileAsync spawn 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 value

Budget literals are duplicated from the scanner.

16_385 here and 256 * 1024 + 1 at Line 390 silently mirror MAXIMUM_PLUGIN_SCAN_ENTRIES and MAXIMUM_PLUGIN_MANIFEST_BYTES. Tuning either constant turns these into passing-but-meaningless tests rather than failures. Exporting the constants (as MAXIMUM_PLUGIN_SKILL_CANDIDATES already is) and deriving the fixture sizes keeps them honest.


401-517: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Gate these symlink() tests behind a Windows helper check.

Running symlink() on Windows can require Developer Mode or elevation; if it fails with EPERM, these tests stop before exercising the plugin scan. Wrap them with a skip/fatal similar to other platform-specific tests and avoid asserting errorCode: '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

📥 Commits

Reviewing files that changed from the base of the PR and between a1a78da and 4935338.

📒 Files selected for processing (25)
  • src/main/ipc/skills.test.ts
  • src/main/skills/skill-freshness-inventory.test.ts
  • src/main/skills/skill-freshness-inventory.ts
  • src/main/skills/skill-plugin-cache-scan.test.ts
  • src/main/skills/skill-plugin-cache-scan.ts
  • src/main/skills/skill-plugin-manifest-roots.ts
  • src/renderer/src/components/skills/SkillFreshnessNudge.test.tsx
  • src/renderer/src/components/skills/SkillFreshnessStatusPill.test.tsx
  • src/renderer/src/components/skills/SkillFreshnessUpdateDialog.test.tsx
  • src/renderer/src/components/skills/SkillFreshnessUpdateDialog.tsx
  • src/renderer/src/components/skills/skill-freshness-grouping.test.ts
  • src/renderer/src/components/skills/skill-freshness-grouping.ts
  • src/renderer/src/components/skills/skill-freshness-scan-issues.tsx
  • src/renderer/src/components/skills/skill-freshness-skipped-reason.ts
  • src/renderer/src/hooks/useSkillFreshness.test.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
  • src/renderer/src/lib/agent-skill-nav-install-status.test.ts
  • src/renderer/src/lib/skill-freshness-display-status.test.ts
  • src/renderer/src/lib/skill-freshness-display-status.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/renderer/src/components/skills/SkillFreshnessUpdateDialog.tsx (1)

57-65: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Shorten 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

📥 Commits

Reviewing files that changed from the base of the PR and between 4935338 and 693781f.

📒 Files selected for processing (7)
  • src/main/skills/skill-plugin-cache-scan.test.ts
  • src/main/skills/skill-plugin-cache-scan.ts
  • src/main/skills/skill-plugin-manifest-roots.ts
  • src/renderer/src/components/skills/SkillFreshnessUpdateDialog.test.tsx
  • src/renderer/src/components/skills/SkillFreshnessUpdateDialog.tsx
  • src/renderer/src/lib/skill-freshness-display-status.test.ts
  • src/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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 693781f and f534144.

📒 Files selected for processing (12)
  • src/main/skills/skill-plugin-cache-scan.test.ts
  • src/main/skills/skill-plugin-cache-scan.ts
  • src/main/skills/skill-plugin-manifest-roots.ts
  • src/renderer/src/components/skills/SkillFreshnessUpdateDialog.test.tsx
  • src/renderer/src/components/skills/SkillFreshnessUpdateDialog.tsx
  • src/renderer/src/components/skills/skill-freshness-scan-issues.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
  • src/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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between f534144 and e93fc3a.

📒 Files selected for processing (4)
  • src/main/skills/skill-plugin-cache-scan.test.ts
  • src/main/skills/skill-plugin-cache-scan.ts
  • src/renderer/src/components/skills/SkillFreshnessUpdateDialog.test.tsx
  • src/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.
@brennanb2025
brennanb2025 merged commit 2cf91b8 into stablyai:main Jul 28, 2026
36 checks passed
@brennanb2025

Copy link
Copy Markdown
Contributor

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 inventorySkillFreshness manufacturing an installation record for a path it had never stat'ed. Deleting that fabrication is what actually closes #10633 and its siblings; everything downstream followed from it. Requiring SKILL.md evidence before promoting a directory to a candidate is what finally stops Codex's own computer-use from flagging.

We pushed a few commits on top, so you're not surprised by them:

  • Merged latest main. feat(skills): run skill updates in the background without a terminal #10843 landed in the meantime and rewrote SkillFreshnessUpdateDialog to run updates in the background — no terminal, summarizeInventory/SummaryHeadline extracted into their own module, collapsible details panel removed. Your scan-issue reporting is ported into that structure, with scan-incomplete ordered ahead of empty so a scan that never finished can't report "none found".
  • CodeRabbit's two items. Symlink tests gated on Windows, and the budget-exhaustion test now asserts its own premise.
  • Demoted outside-root to Details-only. A plugin that links its skills outside the cache is a packaging choice by the vendor, not something the user can clear — deleting the link just makes their package manager recreate it. On a real install this turned every skill amber, so it stays listed but no longer raises a pill. io-error remains the one attention reason.
  • Tightened two tests that asserted the headline but passed with the folder list removed entirely.

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.

brennanb2025 added a commit that referenced this pull request Jul 30, 2026
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
brennanb2025 added a commit that referenced this pull request Jul 30, 2026
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
@AmethystLiang

Copy link
Copy Markdown
Contributor

looking into it

enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…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.
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: "Needs attention" skill pill has no explanation — its Details dialog reports "All installed Orca skills are up to date"

3 participants