Skip to content

LCORE-2076: Fix missing skills argument in streaming agent build#1945

Merged
tisnik merged 1 commit into
lightspeed-core:mainfrom
asimurka:wire_agents_skills
Jun 18, 2026
Merged

LCORE-2076: Fix missing skills argument in streaming agent build#1945
tisnik merged 1 commit into
lightspeed-core:mainfrom
asimurka:wire_agents_skills

Conversation

@asimurka

@asimurka asimurka commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes missing skills argument in streaming agent build.

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up service version
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change
  • Unit tests improvement
  • Integration tests improvement
  • End to end tests improvement
  • Benchmarks improvement

Tools used to create PR

Identify any AI code assistants used in this PR (for transparency and review context)

  • Assisted-by: (e.g., Claude, CodeRabbit, Ollama, etc., N/A if not used)
  • Generated by: (e.g., tool name and version; N/A if not used)

Related Tickets & Documents

Checklist before requesting a review

  • I have performed a self-review of my code.
  • PR has passed all pre-merge test jobs.
  • If it is a core feature, I have added thorough tests.

Testing

  • Please provide detailed steps to perform tests related to this code change.
  • How were the fix/results from this change verified? Please provide relevant screenshots or results.

Summary by CodeRabbit

  • Refactor

    • Enhanced agent configuration handling to pass skills parameters for improved agent capability management.
  • Tests

    • Added test fixtures for agent configuration isolation and mocking during unit testing.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

retrieve_agent_response_generator in streaming.py now passes configuration.skills to build_agent. A new pytest fixture patch_streaming_configuration is added to mock utils.agents.streaming.configuration with skills=None, and TestRetrieveAgentResponseGenerator is annotated to use it.

Changes

Skills argument in streaming agent build

Layer / File(s) Summary
Pass skills to build_agent
src/utils/agents/streaming.py
retrieve_agent_response_generator now passes configuration.skills to build_agent, altering the agent's runtime capabilities.
Test fixture for streaming configuration isolation
tests/unit/utils/agents/test_streaming.py
Adds patch_streaming_configuration fixture that mocks utils.agents.streaming.configuration with skills=None, and applies it to all tests in TestRetrieveAgentResponseGenerator.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • lightspeed-core/lightspeed-stack#1919: Modifies src/utils/agents/streaming.py around retrieve_agent_response_generator and streaming behavior, directly touching the code path this PR adjusts.

Suggested reviewers

  • jrobertboos
  • tisnik
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main bug fix: adding a missing skills argument to the streaming agent build process.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@asimurka asimurka changed the title LCORE-2311: Fix missing skills argument in streaming agent build LCORE-2076: Fix missing skills argument in streaming agent build Jun 18, 2026

@tisnik tisnik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/unit/utils/agents/test_streaming.py (1)

568-571: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Consider verifying that build_agent receives the skills argument.

The test mocks build_agent but doesn't verify that it's called with the correct arguments, specifically configuration.skills. Since the PR fixes a bug where the skills argument was missing (LCORE-2311), it would be valuable to explicitly assert that build_agent is now called with the skills parameter.

🧪 Suggested enhancement to verify bug fix
 mock_agent = mocker.Mock()
-mocker.patch(
+mock_build_agent = mocker.patch(
     "utils.agents.streaming.build_agent",
     return_value=mock_agent,
 )

Then after line 592, add:

mock_build_agent.assert_called_once_with(
    context.client,
    responses_params,
    None,  # configuration.skills from patch_streaming_configuration fixture
)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/utils/agents/test_streaming.py` around lines 568 - 571, The test
patches build_agent but doesn't verify that it receives the correct arguments,
including the skills parameter that was fixed in the bug. Store the patched
build_agent mock in a variable by assigning the result of mocker.patch to a
variable named mock_build_agent, then add an assertion after line 592 that uses
assert_called_once_with to verify build_agent was called with context.client,
responses_params, and the skills value from the patch_streaming_configuration
fixture (None in this case).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@tests/unit/utils/agents/test_streaming.py`:
- Around line 568-571: The test patches build_agent but doesn't verify that it
receives the correct arguments, including the skills parameter that was fixed in
the bug. Store the patched build_agent mock in a variable by assigning the
result of mocker.patch to a variable named mock_build_agent, then add an
assertion after line 592 that uses assert_called_once_with to verify build_agent
was called with context.client, responses_params, and the skills value from the
patch_streaming_configuration fixture (None in this case).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 47e80b56-1328-4117-a446-b722775ddf16

📥 Commits

Reviewing files that changed from the base of the PR and between 570a66e and 281d09b.

📒 Files selected for processing (2)
  • src/utils/agents/streaming.py
  • tests/unit/utils/agents/test_streaming.py
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (15)
  • GitHub Check: integration_tests (3.12)
  • GitHub Check: unit_tests (3.13)
  • GitHub Check: unit_tests (3.12)
  • GitHub Check: Pylinter
  • GitHub Check: mypy
  • GitHub Check: Pyright
  • GitHub Check: Konflux kflux-prd-rh02 / lightspeed-stack-0-6-on-pull-request
  • GitHub Check: Konflux kflux-prd-rh02 / lightspeed-stack-on-pull-request
  • GitHub Check: E2E: library mode / ci / group 2
  • GitHub Check: E2E: server mode / ci / group 3
  • GitHub Check: E2E Tests for Lightspeed Evaluation job
  • GitHub Check: E2E: library mode / ci / group 3
  • GitHub Check: E2E: server mode / ci / group 2
  • GitHub Check: E2E: library mode / ci / group 1
  • GitHub Check: E2E: server mode / ci / group 1
🧰 Additional context used
📓 Path-based instructions (2)
src/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.py: Use absolute imports for internal modules: from authentication import get_auth_dependency
Llama Stack imports: Use from llama_stack_client import AsyncLlamaStackClient
Check constants.py for shared constants before defining new ones
All modules must start with descriptive docstrings explaining purpose
Use logger = get_logger(__name__) from log.py for module logging
All functions must have complete type annotations for parameters and return types, use modern syntax (str | int), and include descriptive docstrings
Use snake_case with descriptive, action-oriented names for functions (get_, validate_, check_)
Avoid in-place parameter modification anti-patterns; return new data structures instead of modifying function parameters
Use async def for I/O operations and external API calls
Use standard log levels with clear purposes: debug() for diagnostic info, info() for program execution, warning() for unexpected events, error() for serious problems
All classes must have descriptive docstrings explaining purpose and use PascalCase with standard suffixes: Configuration, Error/Exception, Resolver, Interface
Abstract classes must use ABC with @abstractmethod decorators
Follow Google Python docstring conventions with required sections: Parameters, Returns, Raises, and Attributes for classes

Files:

  • src/utils/agents/streaming.py
tests/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

tests/**/*.py: Use pytest for all unit and integration tests; do not use unittest
Use pytest.mark.asyncio marker for async tests

Files:

  • tests/unit/utils/agents/test_streaming.py
🔇 Additional comments (3)
src/utils/agents/streaming.py (1)

120-120: LGTM!

tests/unit/utils/agents/test_streaming.py (2)

206-212: LGTM!


490-490: LGTM!

@tisnik tisnik merged commit 76ced44 into lightspeed-core:main Jun 18, 2026
40 of 41 checks passed
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