Skip to content

fix(skills): don't cache negative binary lookups - #21116

Closed
heyrtl wants to merge 1 commit into
openclaw:mainfrom
heyrtl:fix/skill-binary-cache-stale
Closed

heyrtl wants to merge 1 commit into
openclaw:mainfrom
heyrtl:fix/skill-binary-cache-stale

Conversation

@heyrtl

@heyrtl heyrtl commented Feb 19, 2026 •

Copy link
Copy Markdown

Fixes #21094

Summary

  • Problem: hasBinary() cached negative results (binary not found), which became stale after brew install succeeded
  • Why it matters: Users saw "Install" button persist even after successful installation, requiring manual cache clear or restart
  • What changed: Removed hasBinaryCache.set(bin, false) — only positive results are cached now
  • What did NOT change: Positive result caching unchanged; function signature unchanged; no config/API changes

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

User-visible / Behavior Changes

Before: After installing a skill's binary via dashboard, refreshing the page showed "Install" button again (stale cache).

After: Dashboard immediately reflects actual binary state after installation. No restart or cache clear needed.

Impact: Skills dashboard now correctly shows "eligible" status after brew installs.

Security Impact (required)

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Repro + Verification

Environment

  • OS: macOS 26.2 (Apple Silicon - arm64)
  • Runtime/container: Homebrew at /opt/homebrew/, Node v22.14.0
  • Model/provider: N/A (skill installation bug)
  • Integration/channel: Skills dashboard
  • Relevant config: Default skill installation with brew prerequisites

Steps

  1. Open Skills dashboard
  2. Find skill requiring brew binary (e.g., wacli, gog, gifgrep)
  3. Observe "Install [skill] (brew)" button with status "blocked - Missing: bin:[name]"
  4. Click install button → observe "Installed" status
  5. Refresh page
  6. Before fix: Shows "Install" button again ❌
  7. After fix: Shows skill as "eligible" ✅

Expected

After successful brew install, dashboard refresh should show skill as eligible/installed.

Actual

Dashboard showed "Install" button again because hasBinary() returned stale cached false.

Evidence

Code change:

- hasBinaryCache.set(bin, false);
+ // Don't cache negative results - they become stale after brew install

Human Verification (required)

Verified scenarios:

  • Code compiles without errors (pnpm format passed on changed file)
  • Logic review: positive lookups cached (fast), negative lookups not cached (correct after install)
  • One-line change with clear rationale

Edge cases checked:

  • Positive results still cached (performance maintained)
  • PATH change still triggers cache clear (existing behavior preserved)
  • Windows PATHEXT handling untouched

What I did NOT verify:

  • Full end-to-end dashboard test with actual brew install (requires production setup)
  • Load testing for performance impact (negligible - see Risks section)

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No
  • Migration needed? No

No breaking changes. Existing cached positive results remain valid. Negative results simply aren't cached anymore.

Failure Recovery (if this breaks)

How to disable/revert:

git revert <this-commit>
# or restore line:
hasBinaryCache.set(bin, false);

Files to restore: src/shared/config-eval.ts (line 147)

Known bad symptoms:

  • Dashboard shows "Install" button after successful installation (same as before)
  • Users would need to restart gateway to clear cache (original issue)

Risks and Mitigations

Risk: Slight performance overhead from re-checking missing binaries on each skills.status call

  • Mitigation:
    • Negative lookups are NOT the hot path (binaries either exist or are rarely checked)
    • Cost is a few fs.accessSync calls across PATH dirs (~microseconds)
    • Positive lookups remain cached (hot path unaffected)
    • Trade-off: microseconds of overhead vs. always-correct dashboard state

Risk: None (no other risks identified)

Greptile Summary

Removed caching of negative binary lookup results in hasBinary(). Previously, when a binary wasn't found, the function cached false, which became stale after successful installation via brew install. Now only positive results (binary found) are cached, ensuring the skills dashboard immediately reflects actual binary availability after installation.

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • Single-line fix with clear rationale addressing a specific bug. The change preserves performance for the hot path (positive lookups remain cached) while fixing stale cache issues for negative lookups. Cache invalidation logic on PATH changes remains intact. No breaking changes to function signature or behavior.
  • No files require special attention

Last reviewed commit: 11642bf

(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!

Fixes openclaw#21094

Problem:
- hasBinary() cached both positive and negative results
- After installing binary via brew, cached false result was stale
- Dashboard showed Install button even after successful installation

Solution:
- Only cache positive results (binaries found)
- Don't cache negative results - they become stale after installation
- Re-checking missing binaries has negligible cost

The one-line fix ensures dashboard always reflects actual binary state
after skill installations.
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Feb 28, 2026
@openclaw-barnacle

Copy link
Copy Markdown

Closing due to inactivity.
If you believe this PR should be revived, post in #pr-thunderdome-dangerzone on Discord to talk to a maintainer.
That channel is the escape hatch for high-quality PRs that get auto-closed.

steipete added a commit that referenced this pull request Aug 28, 2026
Cache only successful binary probes so fresh skill and Gmail dependency
checks recognize executables installed into existing PATH directories.
Preserve hit reuse and PATH/PATHEXT invalidation; cover dependency setup,
Go/uv prerequisite reuse, and skill/hook eligibility.

Related: #21094. Follow-up to the positive-only proposal in #21116.
Thanks to @DannyDesert for the original skill-install report.

Co-authored-by: Ratul Rahman <[email protected]>
steipete added a commit that referenced this pull request Aug 28, 2026
Cache only successful binary probes so fresh skill and Gmail dependency
checks recognize executables installed into existing PATH directories.
Preserve hit reuse and PATH/PATHEXT invalidation; cover dependency setup,
Go/uv prerequisite reuse, and skill/hook eligibility.

Related: #21094. Follow-up to the positive-only proposal in #21116.
Thanks to @DannyDesert for the original skill-install report.

Co-authored-by: Ratul Rahman <[email protected]>
@steipete

Copy link
Copy Markdown
Contributor

The positive-only cache repair has now landed on main in PR #131617 — recognize newly installed skill and Gmail dependencies, commit 3f31f271.

The follow-up keeps this proposal's core approach, simplifies the cache to a success-only Set, and adds red/green coverage for Gmail setup, skill/hook eligibility, and consecutive Go/uv prerequisite installations, including partial failure. Exact-head CI is green. Ratul Rahman's original author name and email are preserved in the landed Co-authored-by trailer—thank you for the earlier fix proposal.

This PR remains closed and unmerged; the link above is the canonical landed repair. No release is being announced here.

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

Cache only successful binary probes so fresh skill and Gmail dependency
checks recognize executables installed into existing PATH directories.
Preserve hit reuse and PATH/PATHEXT invalidation; cover dependency setup,
Go/uv prerequisite reuse, and skill/hook eligibility.

Related: openclaw#21094. Follow-up to the positive-only proposal in openclaw#21116.
Thanks to @DannyDesert for the original skill-install report.

Co-authored-by: Ratul Rahman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: XS stale Marked as stale due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Skill install shows success but dashboard still shows "Install" after page refresh (stale hasBinaryCache)

2 participants