Reuse walk inventory for environment skill metadata - #30145
Merged
Conversation
anp-oai
approved these changes
Jun 26, 2026
Contributor
Author
|
@codex review |
Contributor
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Environment skill discovery already asks the executor to run one
fs/walk. That response contains every regular file path found under the selected root, including anyagents/openai.yamlfiles.Today Core keeps the discovered
SKILL.mdpaths but discards the rest of that file inventory. It then sends onefs/getMetadatarequest per skill just to ask whetheragents/openai.yamlexists. A root with 66 skills and no metadata therefore pays for 66 unnecessary network round trips.What changes
fs/walkfile and directory inventory for the duration of the scan.SKILL.mdwith metadata that is known present, known absent, or still requires a fallback probe.agents/openai.yamldirectly instead of statting it first.agentsdirectory.SKILL.mdandagents/openai.yamlconcurrently.core-skills.The inventory is scan-local. This does not add another cache or change cache lifetime.
Network impact
For a complete scan of 66 valid skills with no
agents/openai.yaml, and one root.codex-plugin/plugin.json:fs/walkSKILL.mdagents/openai.yamlagents/openai.yamlThis removes exactly 66 request/response exchanges from the common cold scan. Warm scans remain at zero discovery RPCs because the thread-level executor catalog cache is unchanged.
When metadata exists, each file still requires one read. This PR removes only the preceding existence check; it does not batch file contents into a new RPC.
Correctness fallbacks
Absence is trusted only when the walk is complete and the metadata directory was not present. Core keeps the existing
getMetadatafallback when:agentsdirectory was observed butopenai.yamlwas not, which preserves support for file symlinks and traversal boundaries.Deliberate scope
This PR changes only the environment skill loader and its existing filesystem-call regression coverage. It does not:
fs/walkor any exec-server protocol;readFilesor a skills-list endpoint;The plugin-manifest stat is intentionally left in place, which is why this PR reaches 69 calls rather than the broader 68-call estimate. That lookup has separate alternate-path, ancestor, and symlink semantics and should not be mixed into this change.