Repository navigation
Conversation
tobi12345
force-pushed
the
lfe-18161-add-skill-discovery-and-availability-tracing-to-python-sdk
branch
from
October 28, 2026 15:04
bbe629a to
ab849fc
Compare
Contributor
Author
|
@claude review |
There was a problem hiding this comment.
Nothing blocking. The comments below are optional suggestions. There is no need to push a fix for them before merging.
Beyond the inline finding, I also looked at whether propagate_attributes(attach_skills=True) should attach the configured catalog to the observation that is already open. It doesn't, but that matches the docstring ("spans created in this context"), and explicit skills_available still updates the current span, so I didn't count it as a bug.
Extended reasoning...
The ruled-out item is in langfuse/_client/propagation.py. There, attach_skills is stored only as a context value that the span processor reads in on_start, while skills_available is also written to the current span.
tobi12345
deleted the
lfe-18161-add-skill-discovery-and-availability-tracing-to-python-sdk
branch
October 28, 2026 15:39
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.
What does this PR do?
Add local skill discovery and skill availability tracing to the Python SDK. Configure
Langfuse(skills={"available": discover_skills(dir=".agents/skills")}), then usepropagate_attributes(attach_skills=True)to attach the configured list orskills_available=[...]to supply it directly.Discovery follows symlinks and reads names and versions from CLI lockfiles. Malformed or unreadable locks warn and fall back to directory names; unreadable skill entries warn and are skipped. Lockfiles with other integer versions are accepted when their structure is compatible.
Skills follow the JavaScript lifecycle: at span start, existing attributes take precedence over propagated skills, then configured defaults. Observation initialization and subsequent updates or propagation can overwrite that value, including with an empty list. Skills are not written to outgoing baggage; incoming baggage uses the normal handler.
The stable skills API is already on main via #2063; this PR has no generated API changes.
Verification
uv run --frozen pytest -n 4 --dist worksteal tests/unit -qwith CI test credentials: 1024 passed, 2 skipped.uv run --frozen ruff check .: All checks passed!uv run --frozen ruff format --check .: 578 files already formatted.uv run --frozen mypy langfuse --no-error-summary: exit 0.git diff --check: exit 0.Server E2E and live-provider tests were skipped; in-memory unit tests cover the affected discovery, propagation and span lifecycle behavior.
Scope notes
Configured catalogs are attached to the live span. The existing project-scope guard remains for Langfuse-owned spans, but multiple processors sharing external spans do not receive isolated catalogs. Direct skill attributes are accepted on all Python observation types.
Fix explicit-skill overwrites, shared-provider catalog mix-ups, and the required import layout before merging.
Summary
Adds local skill discovery, configured skill catalogs, and skill attributes on observations.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Local skill folders and lockfile] --> B[discover_skills] B --> C[Configured project catalog] D[Direct observation skills] --> E[Span attributes] F[propagate_attributes] --> G[Current observation and child context] G --> H[Span processor] C --> H H --> E E --> I[Project export]Reviews (1) · Last reviewed commit: "feat(skills): add discovery and availabi..." · Reviewed by Greptile