LCORE-2076: Fix missing skills argument in streaming agent build#1945
Conversation
Walkthrough
ChangesSkills argument in streaming agent build
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify 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. Comment |
There was a problem hiding this comment.
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 winConsider verifying that
build_agentreceives the skills argument.The test mocks
build_agentbut doesn't verify that it's called with the correct arguments, specificallyconfiguration.skills. Since the PR fixes a bug where the skills argument was missing (LCORE-2311), it would be valuable to explicitly assert thatbuild_agentis 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
📒 Files selected for processing (2)
src/utils/agents/streaming.pytests/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: Usefrom llama_stack_client import AsyncLlamaStackClient
Checkconstants.pyfor shared constants before defining new ones
All modules must start with descriptive docstrings explaining purpose
Uselogger = get_logger(__name__)fromlog.pyfor 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
Useasync deffor 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@abstractmethoddecorators
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
Usepytest.mark.asynciomarker 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!
Description
Fixes missing skills argument in streaming agent build.
Type of change
Tools used to create PR
Identify any AI code assistants used in this PR (for transparency and review context)
Related Tickets & Documents
Checklist before requesting a review
Testing
Summary by CodeRabbit
Refactor
Tests