Repository navigation
fix: recognize newly installed skill and Gmail dependencies - #131617
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 4:29 AM ET / 08:29 UTC. ClawSweeper reviewWhat this changesThe branch caches only successful executable lookups so binaries installed into an unchanged PATH become visible to skill eligibility, hook eligibility, and Gmail dependency setup. Regression provenancePossible regression — probable (reviewed change; known regression link). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review The shared executable probe on current main caches misses, and this PR removes that stale state at the correct owner with focused caller-boundary coverage. No introduced correctness or security defect was found; it should remain open for normal maintainer review and exact-head CI completion. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherSkill and hook eligibility consult the shared executable probe before exposing capabilities, while Gmail setup rechecks the probe after Homebrew exits successfully. Its result controls whether a newly installed dependency is recognized or reported as unavailable. flowchart LR
A[Skill or Gmail install] --> B[Executable placed in PATH directory]
B --> C[Shared executable probe]
C --> D{Binary now executable?}
D -->|yes| E[Skill, hook, or Gmail setup accepts it]
D -->|no| F[Report unavailable]
C --> G[Session skill snapshot]
G --> H[Next-session refresh behavior]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -2, Tests +246, Docs +4. Total +248 across 7 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Land the shared positive-only cache repair after pending exact-head checks are green, retaining the documented session-snapshot semantics for skill refreshes. Do we have a high-confidence way to reproduce the issue? Yes, from current-main source: a miss is cached at src/shared/config-eval.ts:203 and remains cached when an executable is created without changing PATH or PATHEXT. The checkout is read-only, so the supplied focused test run was inspected rather than rerun. Is this the best way to solve the issue? Yes. The shared probe owns the stale result and serves skills, hooks, and Gmail setup, so positive-only caching repairs the invariant without installer-specific invalidation paths. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ae499904b01f. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
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]>
8694258 to
baa7394
Compare
|
Maintainer verification for head
Focused rebase command: OPENCLAW_TEST_PROJECTS_PARALLEL=1 OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/shared/config-eval.test.ts src/hooks/gmail-setup-utils.test.ts src/hooks/config.test.ts src/skills/lifecycle/install-cache-freshness.test.ts src/skills/loading/config-binary.test.ts src/gateway/server-reload-channel-restart.test.tsChanged-code gate: node scripts/check-changed.mjs -- src/shared/config-eval.ts src/shared/config-eval.test.ts src/hooks/gmail-setup-utils.test.ts src/hooks/config.test.ts src/skills/lifecycle/install-cache-freshness.test.ts src/skills/loading/config-binary.test.ts docs/tools/skills.mdBest-fix judgment: keep one shared success-only probe cache. Installer-specific invalidation would miss sibling/external installs and partial success; TTLs would delay correctness. Successful-hit reuse and PATH/PATHEXT invalidation remain intact. Production is net -2 lines; tests net +246; docs +4. Gmail diagnostics formatting and existing session snapshots are unchanged, and Ratul Rahman's co-author credit is preserved. Proof limits remain explicit: no native Windows run, actual package installation, authenticated Gmail/cloud flow, or running dashboard/Gateway was exercised under the operator's restrictions. The fixture and isolated-process proof is not authenticated Gmail or live dashboard proof. Proceeding through native |
|
Merged via squash.
|
…#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]>
Related: #21094 — successful skill installs remain marked as missing.
Follow-up to #21116 — the earlier positive-only cache fix was closed unmerged for inactivity and does not allow maintainer edits.
Additional instructions
Maintainer edits are enabled through the same-repository branch.
What Problem This Solves
Fixes an issue where users setting up Gmail would get “still not available after brew install” even though installation succeeded and the executable was present. The same stale result kept newly installed skill dependencies ineligible and caused repeated Go/uv prerequisite bootstraps within one process when PATH did not change.
Why This Change Was Made
The shared
hasBinary()owner cached both hits and misses until PATH/PATHEXT changed. Installing a file into an existing PATH directory changes neither value, so the next check reused the stale miss. Cache only successful probes, using aSetinstead of a booleanMap; retain successful-lookup reuse, PATH/PATHEXT invalidation, and existing platform search semantics.This fixes all callers at the probe owner rather than adding invalidation calls to individual installers. Installer-only invalidation would miss external installs and prerequisite success followed by recipe failure; a TTL would merely delay visibility. Existing session skill snapshots and the separate executable-path idle-TTL resolver are intentionally unchanged. Gmail diagnostics formatting is not part of this change.
The cache was introduced in 76e4e9d and is reachable from stable
v2026.2.14. The affected production owners remain unchanged on currentmaincompared with the reproduced baseline.User Impact
Fresh dependency checks recognize binaries installed into directories already on PATH without requiring a process restart or a PATH edit. Gmail dependency setup no longer reports a false installation failure, and later skill installs reuse successfully installed Go/uv prerequisites even if an earlier final recipe failed.
Missing probes now intentionally perform filesystem work again; successful probes remain cached. No new configuration, dependency, refresh API, or migration is introduced. Production LOC: +4/-6 (net -2). Tests: +261/-15 (net +246). Documentation: +4.
Thanks to @heyrtl for the earlier positive-only cache proposal and @DannyDesert for the original skill-install report. AI-assisted implementation and verification; no agent transcripts attached.
Evidence
Ten regression cases failed on pre-fix code for the intended stale-cache reason and pass with the repair. Coverage uses the real probe and temporary executable files, with only installation commands faked:
ensureDependency()succeeds when the fake installer creates the binary, does not reinstall on its next call, and still rejects exit zero without an executable.A separate real subprocess reproduction used only a temporary fake
brew, a fake dependency executable, and isolated HOME/state/config. Before: the installer exited zero and the executable existed, butensureDependency()threwfixture-gmail-tool still not available after brew install. After: setup succeeded with unchanged PATH, and two calls invoked the fake installer exactly once. No real package-manager operation ran.Focused and sibling verification: 138 distinct tests passed across ten files, with two existing native-Windows skips. The final shared-worker regression run passed 68 tests:
Additional sibling suites passed:
All 28 selected changed-code stages completed successfully, including production/test typechecks, changed-file lint, dead exports, architecture guards, formatting, and whitespace validation:
The initial baseline Gmail test encountered a cold-import timeout; an unchanged retry passed. Temporary-home resolution and typed fake-process termination metadata were corrected in the new fixtures, then reverified without raising timeouts or weakening assertions. Independent Codex autoreview passed; fresh pre-commit review and exact-head CI are checked again before landing.
CI history: the original run failed on an unchanged main-branch gateway test importing a private helper. PR #131627 repaired that test in 871b18df. This branch was rebased onto repaired main; the entire seven-file patch, all seven file blobs, and contributor credit are unchanged. CI for the refreshed head replaces the old failed merge snapshot; the old run was not rerun.
Rebase sanity passed all 41 tests across the five changed test files and the repaired gateway rollback test (six files, four serial shards), with no retries. This remains fixture-only proof, with no real Gateway or installation. The full changed-code gate and clean independent autoreview were reused for the byte-identical patch; fresh exact-head CI remains required before landing.
Proof limits: native Windows, a running dashboard/Gateway, real installs, and authenticated Gmail/cloud flows were intentionally not exercised because the operator explicitly prohibited those operations. Safe fake-executable and isolated real-subprocess proof covers the changed owner boundary; it is not authenticated Gmail or dashboard proof. Existing session snapshots are not automatically refreshed by fresh binary probes. See https://docs.openclaw.ai/tools/skills#gating.