Skip to content

fix(skills): return no skills when the skills directory cannot be read - #2083

Merged
hassiebp merged 1 commit into
mainfrom
hassiebbot/skills-discovery-errors-0456
Oct 30, 2026
Merged

hassiebp merged 1 commit into
mainfrom
hassiebbot/skills-discovery-errors-0456

Conversation

@hassiebp

@hassiebp hassiebp commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

discover_skills(dir=...) raised NotADirectoryError, PermissionError or a symlink-loop OSError when dir pointed to a file or a folder it couldn't list. It's usually called inside Langfuse(skills={"available": discover_skills(...)}), so a wrong path broke client setup. Now it logs a warning and returns [], the same way it already handles unreadable lockfiles and skill entries.

A missing directory still returns [] without a warning.

The matching JS change is in langfuse/langfuse-js on hassiebbot/skills-discovery-parity-0456.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Refactor
  • Documentation update
  • Tooling, CI, or repo maintenance

Verification

uv run --frozen pytest tests/unit/test_skills.py -k unreadable_skills_directory   # 2 failed before the fix
uv run --frozen ruff format --check .                       # 578 files already formatted
uv run --frozen ruff check .                                # All checks passed!
uv run --frozen mypy langfuse --no-error-summary            # exit 0
uv run --frozen pytest -n 4 --dist worksteal tests/unit -q  # 1003 passed, 2 skipped

The new test points dir at a file and at a symlink loop. Both fail the same way whatever the file permissions or user, so CI behaves the same as a local run.

Checklist

  • I self-reviewed the diff using code_review.md.
  • I added or updated tests for behavior changes.
  • I updated docs, examples, or .env.template if needed.
  • I did not hand-edit generated files; if generated files changed, I used the upstream regeneration path.
  • I did not commit secrets or credentials.
Open in Web Open in Cursor 

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

discover_skills now warns and returns [] when it cannot read the skills directory, instead of raising an error.

  • Skill discovery returns no skills when it cannot read the configured folder.

Reviews (1) · Last reviewed commit: "fix(skills): return no skills when the s..." · Reviewed by Greptile

discover_skills raised when dir pointed to a file or could not be listed,
which broke client setup. It now warns and returns an empty list, matching
how unreadable lockfiles and entries are handled.

Co-authored-by: Hassieb Pakzad <hassiebp@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

@claude review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T15:52:34.935567Z 417c2a7 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

No review was started: this request came from a bot account. Manual reviews can only be requested by someone with write access to this repository. Ask a maintainer to comment @claude review, or have your automation post the comment from a user account with write access.

Tip: disable this comment in your organization's Code Review settings.

@hassiebp
hassiebp enabled auto-merge (squash) October 30, 2026 15:52

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code review found no issues

No high-confidence issues detected in this change.

@hassiebp
hassiebp merged commit bf946c9 into main Oct 30, 2026
25 checks passed
@hassiebp
hassiebp deleted the hassiebbot/skills-discovery-errors-0456 branch October 30, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants