Skip to content

refactor(skills): set skill availability through propagation only - #2082

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

hassiebp merged 1 commit into
mainfrom
hassiebbot/skills-propagation-only-0456

Conversation

@hassiebp

@hassiebp hassiebp commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

Removes the available_skills parameter from the observation APIs (start_observation, start_as_current_observation, create_event, update, update_current_span, update_current_generation and the observation constructors). From now on, skills are set only through propagation:

  • propagate_attributes(skills_available=[...]) writes the list onto the active observation and every observation created inside the context.
  • propagate_attributes(attach_skills=True) attaches the catalog configured with Langfuse(skills={"available": ...}).

The per-observation parameter did the same job as propagation but had to be repeated on every typed overload, which made up most of #2062's API surface. It also used a different name (available_skills) from the propagation key and the span attribute (skills_available). The feature hasn't been released yet, so removing it now doesn't break anyone.

What stays:

  • the langfuse.observation.skills_available attribute and its reserved slot in the metadata budget, since propagation still writes it onto observations that have already started;
  • the span processor rule that skills already on a span beat propagated skills, which still applies to spans from other OpenTelemetry instrumentation;
  • discover_skills, SkillReference and SkillsConfig.

The matching JS change is in langfuse/langfuse-js on the branch of the same name.

Type of change

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

Verification

uv run --frozen ruff format .                       # 578 files left unchanged
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   # 1001 passed, 2 skipped

Removed tests that only covered the per-observation parameter. Two tests that pin useful behavior now use propagation instead: propagation replaces skills on the active observation (including with []), and the metadata budget still leaves room for skills added after the span starts.

E2E and live-provider suites were not run; nothing they cover changed.

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

Removes available_skills from observation creation, constructors, and updates. Skills now come only from propagate_attributes.

  • Callers set observation skills through propagation, not individual observation calls.

Acknowledged by hassiebp: removing the per-observation parameter is intentional because the feature has not been released.

Reviews (1) · Last reviewed commit: "refactor(skills): set skill availability..." · Reviewed by Greptile

Remove available_skills from observation creation, update and event APIs.
Skills are set with propagate_attributes(skills_available=...), which already
updates the active observation and its children, or attached from the client
catalog with attach_skills=True.

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:06:42.263636Z 5eff29b 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.

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

LGTM. This removes the per-observation available_skills parameter as a straight deletion, and nothing references it anymore.

What was reviewed:

  • The diff for client.py, span.py and attributes.py. Every removed line is either an available_skills param, docstring or kwarg, or one of the unused SkillReference/serialize_available_skills imports. None of the remaining logic changed.
  • A repo-wide search for leftover available_skills or create_available_skills_attributes callers. The only hits left are the span processor's own _available_skills field and its test fixtures, plus serialize_available_skills in propagation.py, span_processor.py and skills.py.
  • The rewritten tests. propagate_attributes is already imported in test_metadata_attribute_limit.py. _propagate_attributes writes skills_available onto the current span, so the new assertions on the parent span still hold.
Extended reasoning...

The change removes the available_skills parameter from the Langfuse and observation-wrapper APIs and the attribute helpers, and drops or rewrites the tests that used it. It adds 19 lines and deletes 239. It touches no security-sensitive surface such as auth, crypto or data exposure. CODEOWNERS covers only .github/, and the conversation has no outstanding reviewer objections. I approved because the change is purely subtractive, the search found no leftover callers, and skills can still be set through the existing propagate_attributes(skills_available=...) path, which the updated tests cover.

@hassiebp
hassiebp merged commit 92666c2 into main Oct 30, 2026
24 of 25 checks passed
@hassiebp
hassiebp deleted the hassiebbot/skills-propagation-only-0456 branch October 30, 2026 15:28
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