fix(skills): speed up picker reopening and remote discovery - #2849
Merged
Merged
Conversation
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.
Summary
Opening the Skills picker repeatedly discarded completed results and duplicated requests that were still running, on both local and remote workspaces. Remote discovery additionally serialized every directory and skill-file operation over the workspace filesystem.
Retain the current picker catalog across close/reopen, share its pending request, and refresh on each later opening while displaying the previous result. Isolate results by device surface epoch, SSH connection, workspace, and mode; failed refreshes expose retry instead of leaving stale policy indefinitely. Remote discovery now runs at most four filesystem operations concurrently across two separate directory/file stages, preserving source precedence, directory ordering, symlink exclusion, and invocation policy. User-global discovery and remote project discovery also run together.
Type and Areas
Type: bug fix / performance
Areas: Rust core skill discovery; shared Web UI chat input
Motivation / Impact
The repeated-loading problem affects both local and remote users; remote network latency makes it more visible. In a 24-skill fixture with two roots and a 10 ms simulated delay per filesystem operation, the unchanged 82 logical IO calls took 984 ms before and 283–285 ms after this change (about 71% less elapsed time; observed peak concurrency 1 → 4). Scanning the equivalent local project fixture took 6.4 ms. These are local fixture measurements, not real SSH network benchmarks.
Verification
pnpm run check:web— passed, including TypeScript and appearance/theme governance checks.pnpm --dir src/web-ui run test:run src/flow_chat/hooks/useResolvedModeSkills.test.tsx src/flow_chat/components/ChatInputBoostSubmenu.test.tsx— 17 passed; covers pending request reuse, completion while closed, background refresh, retry, and workspace/mode/connection/surface isolation.cargo test -p openbitfun-core --no-default-features --features agent-runtime,git --lib skills:: -- --nocapture— 26 passed; includes bounded remote IO, preserved order/policy, and equivalent local/remote project catalogs.cargo test -p openbitfun-core --no-default-features --features agent-runtime,git --lib skill_tool::tests— 13 passed; includes local/remote discovery, loading, dialect, and invocation-policy cases.pnpm run fmt:rsandgit diff --check— passed.Reviewer Notes
Remote workspace behavior was exercised through the production filesystem port with simulated latency and existing remote fixtures. Peer Device Mode cache isolation was exercised by changing surface epochs in hook tests. Live SSH, mobile/IM remote control, complete Peer Device Mode transport, and detached dispatch were not exercised end to end. This change does not alter command/wire formats, persistence, or source/policy ownership. The backend continues to resolve policy for invocation; the frontend snapshot is scoped to a mounted composer and revalidated on reopening.
The minimal
agent-runtimelib-test profile alone hits an existing unrelated unguardedservice::worktreetest import; verification therefore includes itsgitowner.Checklist