Skip to content

Conversation

@xl-openai
Copy link
Collaborator

@xl-openai xl-openai commented Jan 7, 2026

Skills discovery now follows symlink entries for SkillScope::User ($CODEX_HOME/skills), SkillScope::Admin (e.g. /etc/codex/skills), and SKillScope::Repo

Added cycle protection: directories are canonicalized and tracked in a visited set to prevent infinite traversal from circular links.

Added per-root traversal limits to avoid accidentally scanning huge trees:

  • max depth: 6
  • max directories: 2000 (logs a warning if truncated)

For now, symlink stat failures and traversal truncation are logged rather than surfaced as UI “invalid SKILL.md” warnings.

@etraut-openai
Copy link
Collaborator

Please make sure that this also works with the IDE extension. We should try to keep the behavior the same across surfaces.

@bolinfest
Copy link
Collaborator

max directories: 2000 (logs a warning if truncated)

Allegedly MAXSYMLINKS defaults to 40 on Linux, so this seems quite high...

@bolinfest
Copy link
Collaborator

Oh, I may have misunderstood what that constant is...

const MAX_NAME_LEN: usize = 64;
const MAX_DESCRIPTION_LEN: usize = 1024;
const MAX_SHORT_DESCRIPTION_LEN: usize = MAX_DESCRIPTION_LEN;
const MAX_SCAN_DEPTH: usize = 6;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a docstring here because I think "depth" means two things: directory depth and number of symlink traversals?

};

if metadata.is_dir() {
let Ok(resolved_dir) = normalize_path(&path) else {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Path normalization and canonicalization are different. I see we do:

use dunce::canonicalize as normalize_path;

why not import it as canonicalize_path instead?

@xl-openai
Copy link
Collaborator Author

@codex review again

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. 🚀

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@xl-openai xl-openai merged commit 61e81af into main Jan 7, 2026
26 checks passed
@xl-openai xl-openai deleted the xl/skills branch January 7, 2026 21:34
@github-actions github-actions bot locked and limited conversation to collaborators Jan 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants