perf(skills): reuse walk inventory for host loading (#31566)

## Why

CCA thread startup loads repository skills through the primary remote
environment. This still used the older host skill loader, which
recursively issued directory and metadata requests over the exec-server
connection. On a high-latency connection, one skill scan could turn into
hundreds of round trips.

Executor-selected skill roots already avoid this pattern: they use one
bounded filesystem walk, reuse the returned inventory, and overlap
independent reads.

## What changed

- Extract the URI-native walk inventory into a shared private discovery
module.
- Use that discovery path for both environment-owned and host/repository
skill roots.
- Reuse the walk inventory to avoid per-skill metadata existence checks
when the inventory is complete.
- Canonicalize host skill identities and parse skill files with bounded
concurrency.
- Prune hidden host directories during traversal, preserving visible
aliases and walk limits.
- Cache namespace probes by ancestor and keep all remote namespace reads
under the same concurrency bound.
- Keep safe metadata probes for incomplete walks, file symlinks, and
case aliases.

## Dependency

#31570 is now merged. It provides the optional `pruneHiddenDirectories`
walk flag used here. That flag defaults to false and is omitted when
disabled.

No other exec-server API changes are introduced.
This commit is contained in:
jif
2026-07-09 09:54:24 +01:00
committed by GitHub
parent 89aeae6c21
commit e8eb60092a
7 changed files with 596 additions and 474 deletions
@@ -137,6 +137,16 @@ async fn serve_exec_with_pushed_events(
)
.await;
}
Some("fs/walk") => {
send_exec_server_json(
&mut websocket,
json!({
"id": request["id"],
"result": { "entries": [], "errors": [], "truncated": false }
}),
)
.await;
}
method => panic!("unexpected exec-server request before process/start: {method:?}"),
}
};