perf(skills): cache standard user sources with live invalidation - #1981
Merged
Conversation
limityan
force-pushed
the
yanzhn/skill-source-hot-reload
branch
from
August 2, 2026 16:59
becbe9b to
c420b50
Compare
limityan
marked this pull request as ready for review
August 2, 2026 17:11
limityan
force-pushed
the
yanzhn/skill-source-hot-reload
branch
from
August 2, 2026 17:58
c420b50 to
0276eae
Compare
limityan
force-pushed
the
yanzhn/skill-source-hot-reload
branch
from
August 2, 2026 18:00
0276eae to
d6c7741
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Skill discovery currently reparses process-level user sources on every query even though project and remote sources already need request-scoped freshness. This adds repeated filesystem and frontmatter work without improving correctness.
The design follows established competitor behavior: OpenCode exposes Skill metadata and loads content on demand, Claude Code discovers edits without restart, and Codex watches Skill roots and invalidates its cache. BitFun keeps the current turn stable and refreshes the next query.
References:
What changed
skills.pathsrequest-scoped so workspace precedence and configured-path semantics remain correct.User-visible behavior
Non-goals
Validation
cargo test --locked -p bitfun-services-integrations --no-default-features --features file-watch --lib(7 passed)cargo test --locked -p bitfun-services-integrations --features file-watch --test file_watch_contracts(9 passed)cargo test --locked -p bitfun-core --features product-full source_cache::tests(7 passed)cargo test --locked -p bitfun-core --features product-full local_skill_scan_tests(5 passed)cargo test -p bitfun-core --lib configured_skill_tests(9 passed)cargo test --locked -p bitfun-cli --test exec_cli_contracts(15 passed)cargo check --locked -p bitfun-core --no-default-featurescargo check --locked -p bitfun-core --features product-fullpnpm run check:repo-hygienepnpm run check:core-boundariesgit diff --check gcwing/main...HEADReview notes
CI exposed that activating process-lifetime Skill watching made short-lived CLI processes wait on a never-ending Tokio blocking task after terminal events had already been emitted. The watcher receiver now belongs to a named OS thread; ordered frontend emission belongs to a bounded queue on the active runtime.
Independent adversarial review also found and closed watcher rebuild/registration races plus linked-source freshness gaps. Standard symlink/reparse-backed Skill directories and semantic files remain readable but make the snapshot uncacheable, avoiding stale metadata or invocation policy without adding a canonical-target watch graph. Final review reported no remaining PR-added P0/P1/P2 findings.
macOS CI then exposed that FSEvents reports canonical /private/var/... paths for /var/... registrations. The shared service now retains the native backend identity only for matching and projects events back into the caller's registered namespace. Rebuilds refresh that identity, and canonical-equivalent roots use deterministic precedence.
A second independent adversarial review verified the rebuild and overlapping-root fixes and reported no remaining PR-added P0/P1/P2 findings.