LCORE-2917 Adding image attachment capabilities to /query and /streaming_query#2108
LCORE-2917 Adding image attachment capabilities to /query and /streaming_query#2108JslYoon wants to merge 4 commits into
Conversation
Add 'image' attachment type with 'image/jpeg' and 'image/png' content types. Validate base64 encoding and enforce size limits for image attachments.
- prepare_input() skips image attachments (text-only for moderation) - build_multimodal_input() converts text + images into pydantic-ai UserContent parts with ImageUrl data URLs - ResponsesApiParams carries image_attachments (excluded from API body) - prepare_responses_params() extracts image attachments from request - Agent runners build multimodal prompts when images are present - Text-only requests are completely unchanged
|
Warning Review limit reached
Next review available in: 38 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (13)
WalkthroughImage attachments now support JPEG and PNG base64 content, validation, OpenAPI examples, request extraction, multimodal prompt construction, and synchronous or streaming agent execution. ChangesMultimodal attachment flow
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant QueryRequest
participant ResponsesApiParams
participant AgentRunner
participant build_multimodal_input
participant Agent
QueryRequest->>ResponsesApiParams: Extract image_attachments
ResponsesApiParams->>AgentRunner: Pass input and image attachments
AgentRunner->>build_multimodal_input: Build multimodal prompt
build_multimodal_input->>Agent: Text plus ImageUrl content
Agent-->>AgentRunner: Response or streamed events
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 7✅ Passed checks (7 passed)
✨ 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.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/utils/query.py (1)
173-220: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick winUse "Parameters:" instead of "Args:" in docstrings.
Both
prepare_input(line 179) andbuild_multimodal_input(line 209) use the"Args:"section header. The project's coding guidelines require"Parameters:"as the section header name for function arguments, and this is confirmed by the repository's established convention.As per coding guidelines: "Follow Google Python docstring conventions with required sections: Parameters, Returns, Raises, and Attributes for classes." Based on learnings: "In the lightspeed-stack repository, docstrings must use the section header name 'Parameters:' (not 'Args:') for function arguments."
♻️ Proposed fix for both docstrings
"""Prepare text input for moderation and Responses API. Takes the query text, appends any inline RAG context for the LLM call, then appends any text attachment content with type labels. Image attachments are skipped — they are handled separately as structured multimodal input. - Args: + Parameters: query_request: The query request containing the query and optional attachments inline_rag_context: Optional RAG context to inject into the query before sending to the LLM. Passed separately to keep QueryRequest a pure public API model."""Build a pydantic-ai multimodal prompt from text and image attachments. Constructs a list of UserContent items containing the text prompt followed by ImageUrl entries for each image attachment, using base64 data URLs. - Args: + Parameters: text: The text portion of the input (query + RAG context + text attachments). image_attachments: Image attachments with base64-encoded content. Returns: List of UserContent items: the text string followed by ImageUrl objects. """🤖 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 `@src/utils/query.py` around lines 173 - 220, Update the docstrings for prepare_input and build_multimodal_input by renaming the “Args:” section header to “Parameters:”; leave the parameter descriptions and all implementation logic unchanged.Sources: Coding guidelines, Learnings
🤖 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.
Inline comments:
In `@src/models/common/query.py`:
- Around line 43-81: Add a Google-style “Returns:” section to the
validate_image_attachment docstring, documenting that it returns the validated
Attachment instance. Keep the existing “Raises:” section and follow the
project’s “Parameters:”/Google docstring conventions.
- Around line 67-78: In the image branch of the content validation method, add a
pre-decode size guard using the base64 payload length (for example,
len(self.content) * 3 // 4) and raise the same size-limit ValueError before
calling base64.b64decode; retain the existing decoded-size check afterward to
handle padding and malformed inputs accurately.
In `@src/utils/agents/query.py`:
- Around line 322-329: Extract the duplicated prompt-selection logic into a
shared build_prompt_from_params helper in src/utils/query.py, preserving the
existing multimodal-input and text fallback behavior. Update
retrieve_agent_response and agent_response_generator to call this helper, and
add the necessary imports while removing their local if/else blocks.
In `@tests/unit/models/requests/test_attachment.py`:
- Around line 97-105: Reduce memory usage in
test_image_attachment_exceeds_size_limit by patching
DEFAULT_MAX_FILE_UPLOAD_SIZE to a small test value and constructing a tiny
payload just above that limit, while preserving the expected ValidationError and
message assertion.
In `@tests/unit/utils/test_responses.py`:
- Around line 2231-2278: Strengthen test_image_attachments_extracted by
asserting that result.input contains the text attachment content ("log output")
and does not contain the image base64 payload (image_data), while retaining the
existing string type and image_attachments assertions.
---
Outside diff comments:
In `@src/utils/query.py`:
- Around line 173-220: Update the docstrings for prepare_input and
build_multimodal_input by renaming the “Args:” section header to “Parameters:”;
leave the parameter descriptions and all implementation logic unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 0536ea0a-f0bc-48d0-b6ea-5b759273df58
📒 Files selected for processing (13)
docs/openapi.jsonsrc/constants.pysrc/models/common/query.pysrc/models/common/responses/responses_api_params.pysrc/utils/agents/query.pysrc/utils/agents/streaming.pysrc/utils/query.pysrc/utils/responses.pytests/unit/models/requests/test_attachment.pytests/unit/utils/agents/test_query.pytests/unit/utils/agents/test_streaming.pytests/unit/utils/test_query.pytests/unit/utils/test_responses.py
📜 Review details
⏰ Context from checks skipped due to timeout. (10)
- GitHub Check: integration_tests (3.13)
- GitHub Check: integration_tests (3.12)
- GitHub Check: build-pr
- GitHub Check: E2E Tests for Lightspeed Evaluation job
- GitHub Check: E2E: server mode / ci / group 2
- GitHub Check: E2E: server mode / ci / group 3
- GitHub Check: E2E: library mode / ci / group 3
- GitHub Check: E2E: server mode / ci / group 1
- GitHub Check: E2E: library mode / ci / group 2
- GitHub Check: E2E: library mode / ci / group 1
🧰 Additional context used
📓 Path-based instructions (5)
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/query.pysrc/models/common/responses/responses_api_params.pysrc/utils/agents/streaming.pysrc/utils/responses.pysrc/constants.pysrc/models/common/query.pysrc/utils/query.py
**/*
📄 CodeRabbit inference engine (Custom checks)
**/*: Flag meaningful O(n^2)+ algorithms on non-trivial inputs, including handlers and Kubernetes list operations.
Flag N+1 patterns that list items and then query once per item, including Kubernetes API and database access.
Flag expensive work inside loops, including API calls, JSON parsing, and regex compilation.
Flag unbounded growth in caches, watchers, or buffers when eviction or limits are missing.
Flag missing pagination or limits on list operations and API endpoints.
Flag secrets or tokens logged in plaintext or hardcoded in source.
Flag API endpoints missing authentication or authorization.
Flag injection vulnerabilities, including SQL injection, command injection, and path traversal.
Flag sensitive data leaked in API responses, WebSocket messages, or logs.
Flag Kubernetes Secrets and Red Hat secrets missing OwnerReferences.
Files:
src/utils/agents/query.pysrc/models/common/responses/responses_api_params.pytests/unit/utils/test_responses.pytests/unit/utils/agents/test_query.pydocs/openapi.jsontests/unit/models/requests/test_attachment.pysrc/utils/agents/streaming.pytests/unit/utils/agents/test_streaming.pytests/unit/utils/test_query.pysrc/utils/responses.pysrc/constants.pysrc/models/common/query.pysrc/utils/query.py
src/models/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
Pydantic models must use
@model_validatorand@field_validatorfor validation and complete type annotations for all attributes, avoidingAnytype
Files:
src/models/common/responses/responses_api_params.pysrc/models/common/query.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/test_responses.pytests/unit/utils/agents/test_query.pytests/unit/models/requests/test_attachment.pytests/unit/utils/agents/test_streaming.pytests/unit/utils/test_query.py
src/constants.py
📄 CodeRabbit inference engine (AGENTS.md)
Use
constants.pyfor shared constants with descriptive comments and type hints usingFinal[type]
Files:
src/constants.py
🧠 Learnings (5)
📚 Learning: 2026-06-24T13:45:37.249Z
Learnt from: Jdubrick
Repo: lightspeed-core/lightspeed-stack PR: 1971
File: src/utils/markdown_repair.py:31-36
Timestamp: 2026-06-24T13:45:37.249Z
Learning: In the lightspeed-stack repository, docstrings must use the section header name "Parameters:" (not "Args:") for function arguments, even if the project references Google Python docstring conventions. Ensure docstrings follow the project’s established "Parameters:" header format for any documented function parameters.
Applied to files:
src/utils/agents/query.pysrc/models/common/responses/responses_api_params.pytests/unit/utils/test_responses.pytests/unit/utils/agents/test_query.pytests/unit/models/requests/test_attachment.pysrc/utils/agents/streaming.pytests/unit/utils/agents/test_streaming.pytests/unit/utils/test_query.pysrc/utils/responses.pysrc/constants.pysrc/models/common/query.pysrc/utils/query.py
📚 Learning: 2026-07-06T15:26:18.398Z
Learnt from: Jdubrick
Repo: lightspeed-core/lightspeed-stack PR: 2071
File: src/models/config.py:2416-2422
Timestamp: 2026-07-06T15:26:18.398Z
Learning: In this repo’s Python code under src/**, don’t treat differences in string concatenation style as a style inconsistency when Black has effectively forced (or made clearer) use of explicit `+` string concatenation in multi-line logger/string expressions. If adjacent-literal implicit concatenation is avoided/changed specifically to accommodate Black’s formatting in these call sites, accept the `+` usage and don’t recommend converting it solely for consistency with nearby blocks that use implicit concatenation.
Applied to files:
src/utils/agents/query.pysrc/models/common/responses/responses_api_params.pysrc/utils/agents/streaming.pysrc/utils/responses.pysrc/constants.pysrc/models/common/query.pysrc/utils/query.py
📚 Learning: 2026-01-12T10:58:40.230Z
Learnt from: blublinsky
Repo: lightspeed-core/lightspeed-stack PR: 972
File: src/models/config.py:459-513
Timestamp: 2026-01-12T10:58:40.230Z
Learning: In lightspeed-core/lightspeed-stack, for Python files under src/models, when a user claims a fix is done but the issue persists, verify the current code state before accepting the fix. Steps: review the diff, fetch the latest changes, run relevant tests, reproduce the issue, search the codebase for lingering references to the original problem, confirm the fix is applied and not undone by subsequent commits, and validate with local checks to ensure the issue is resolved.
Applied to files:
src/models/common/responses/responses_api_params.pysrc/models/common/query.py
📚 Learning: 2026-02-25T07:46:33.545Z
Learnt from: asimurka
Repo: lightspeed-core/lightspeed-stack PR: 1211
File: src/models/responses.py:8-16
Timestamp: 2026-02-25T07:46:33.545Z
Learning: In the Python codebase, requests.py should use OpenAIResponseInputTool as Tool while responses.py uses OpenAIResponseTool as Tool. This difference is intentional due to differing schemas for input vs output tools in llama-stack-api. Apply this distinction consistently to other models under src/models (e.g., ensure request-related tools use the InputTool variant and response-related tools use the ResponseTool variant). If adding new tools, choose the corresponding InputTool or Tool class based on whether the tool represents input or output, and document the rationale in code comments.
Applied to files:
src/models/common/responses/responses_api_params.pysrc/models/common/query.py
📚 Learning: 2026-02-23T14:56:59.186Z
Learnt from: asimurka
Repo: lightspeed-core/lightspeed-stack PR: 1198
File: src/utils/responses.py:184-192
Timestamp: 2026-02-23T14:56:59.186Z
Learning: In the lightspeed-stack codebase (lightspeed-core/lightspeed-stack), do not enforce de-duplication of duplicate client.models.list() calls in model selection flows (e.g., in src/utils/responses.py prepare_responses_params). These calls are considered relatively cheap and removing duplicates could add unnecessary complexity to the flow. Apply this guideline specifically to this file/context unless similar performance characteristics and design decisions are documented elsewhere.
Applied to files:
src/utils/responses.py
🔇 Additional comments (13)
src/constants.py (1)
34-61: LGTM!src/utils/responses.py (1)
96-96: LGTM!Also applies to: 387-401, 446-446
tests/unit/utils/test_query.py (1)
5-13: LGTM!Also applies to: 32-32, 261-350, 444-463
src/utils/agents/streaming.py (1)
61-65: LGTM!Also applies to: 323-329
tests/unit/utils/agents/test_query.py (1)
3-3: LGTM!Also applies to: 15-15, 30-30, 437-479
src/models/common/query.py (3)
3-13: LGTM!
25-42: LGTM!
102-106: LGTM!docs/openapi.json (1)
11490-11543: LGTM!tests/unit/models/requests/test_attachment.py (1)
3-7: LGTM!Also applies to: 45-65, 67-86, 88-95, 107-115
src/models/common/responses/responses_api_params.py (1)
23-23: LGTM!Also applies to: 134-139
tests/unit/utils/test_responses.py (1)
5-5: LGTM!Also applies to: 59-59
tests/unit/utils/agents/test_streaming.py (1)
6-6: LGTM!Also applies to: 23-23, 55-55, 895-956
Regenerate docs/openapi.json to reflect Attachment model changes (image type, content_type examples, description updates). Add tests for image attachment validation, prepare_responses_params image extraction, and multimodal prompt construction in both blocking and streaming agent runners. Signed-off-by: Lucas <lyoon@redhat.com>
2977e84 to
824ed3f
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@docs/openapi.json`:
- Around line 11539-11543: Update the invalid-value example in the
unprocessable-entity response definition to use the current attachment
validator/schema MIME list, replacing the stale hardcoded list. Ensure the
generated 422 examples for /v1/query, /v1/streaming_query, and /v1/responses all
show the updated Invalid attachment type message.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 25b01ea8-9fe7-43ab-9a6c-e70c9717d301
📒 Files selected for processing (6)
docs/openapi.jsonsrc/models/common/query.pytests/unit/utils/agents/test_query.pytests/unit/utils/agents/test_streaming.pytests/unit/utils/test_query.pytests/unit/utils/test_responses.py
📜 Review details
⏰ Context from checks skipped due to timeout. (7)
- GitHub Check: E2E Tests for Lightspeed Evaluation job
- GitHub Check: E2E: server mode / ci / group 2
- GitHub Check: E2E: library mode / ci / group 1
- GitHub Check: E2E: library mode / ci / group 2
- GitHub Check: E2E: server mode / ci / group 3
- GitHub Check: E2E: library mode / ci / group 3
- GitHub Check: E2E: server mode / ci / group 1
🧰 Additional context used
📓 Path-based instructions (4)
**/*
📄 CodeRabbit inference engine (Custom checks)
**/*: Flag meaningful O(n^2)+ algorithms on non-trivial inputs, including handlers and Kubernetes list operations.
Flag N+1 patterns that list items and then query once per item, including Kubernetes API and database access.
Flag expensive work inside loops, including API calls, JSON parsing, and regex compilation.
Flag unbounded growth in caches, watchers, or buffers when eviction or limits are missing.
Flag missing pagination or limits on list operations and API endpoints.
Flag secrets or tokens logged in plaintext or hardcoded in source.
Flag API endpoints missing authentication or authorization.
Flag injection vulnerabilities, including SQL injection, command injection, and path traversal.
Flag sensitive data leaked in API responses, WebSocket messages, or logs.
Flag Kubernetes Secrets and Red Hat secrets missing OwnerReferences.
Files:
docs/openapi.jsontests/unit/utils/test_responses.pytests/unit/utils/test_query.pytests/unit/utils/agents/test_streaming.pysrc/models/common/query.pytests/unit/utils/agents/test_query.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/test_responses.pytests/unit/utils/test_query.pytests/unit/utils/agents/test_streaming.pytests/unit/utils/agents/test_query.py
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/models/common/query.py
src/models/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
Pydantic models must use
@model_validatorand@field_validatorfor validation and complete type annotations for all attributes, avoidingAnytype
Files:
src/models/common/query.py
🧠 Learnings (4)
📚 Learning: 2026-06-24T13:45:37.249Z
Learnt from: Jdubrick
Repo: lightspeed-core/lightspeed-stack PR: 1971
File: src/utils/markdown_repair.py:31-36
Timestamp: 2026-06-24T13:45:37.249Z
Learning: In the lightspeed-stack repository, docstrings must use the section header name "Parameters:" (not "Args:") for function arguments, even if the project references Google Python docstring conventions. Ensure docstrings follow the project’s established "Parameters:" header format for any documented function parameters.
Applied to files:
tests/unit/utils/test_responses.pytests/unit/utils/test_query.pytests/unit/utils/agents/test_streaming.pysrc/models/common/query.pytests/unit/utils/agents/test_query.py
📚 Learning: 2026-01-12T10:58:40.230Z
Learnt from: blublinsky
Repo: lightspeed-core/lightspeed-stack PR: 972
File: src/models/config.py:459-513
Timestamp: 2026-01-12T10:58:40.230Z
Learning: In lightspeed-core/lightspeed-stack, for Python files under src/models, when a user claims a fix is done but the issue persists, verify the current code state before accepting the fix. Steps: review the diff, fetch the latest changes, run relevant tests, reproduce the issue, search the codebase for lingering references to the original problem, confirm the fix is applied and not undone by subsequent commits, and validate with local checks to ensure the issue is resolved.
Applied to files:
src/models/common/query.py
📚 Learning: 2026-02-25T07:46:33.545Z
Learnt from: asimurka
Repo: lightspeed-core/lightspeed-stack PR: 1211
File: src/models/responses.py:8-16
Timestamp: 2026-02-25T07:46:33.545Z
Learning: In the Python codebase, requests.py should use OpenAIResponseInputTool as Tool while responses.py uses OpenAIResponseTool as Tool. This difference is intentional due to differing schemas for input vs output tools in llama-stack-api. Apply this distinction consistently to other models under src/models (e.g., ensure request-related tools use the InputTool variant and response-related tools use the ResponseTool variant). If adding new tools, choose the corresponding InputTool or Tool class based on whether the tool represents input or output, and document the rationale in code comments.
Applied to files:
src/models/common/query.py
📚 Learning: 2026-07-06T15:26:18.398Z
Learnt from: Jdubrick
Repo: lightspeed-core/lightspeed-stack PR: 2071
File: src/models/config.py:2416-2422
Timestamp: 2026-07-06T15:26:18.398Z
Learning: In this repo’s Python code under src/**, don’t treat differences in string concatenation style as a style inconsistency when Black has effectively forced (or made clearer) use of explicit `+` string concatenation in multi-line logger/string expressions. If adjacent-literal implicit concatenation is avoided/changed specifically to accommodate Black’s formatting in these call sites, accept the `+` usage and don’t recommend converting it solely for consistency with nearby blocks that use implicit concatenation.
Applied to files:
src/models/common/query.py
🔇 Additional comments (8)
src/models/common/query.py (1)
47-48: LGTM!docs/openapi.json (2)
11490-11509: Attachment schema updates for image support look correct.The added
"image"attachment type andimage/jpeg/image/pngcontent-type examples are consistent with the PR's multimodal attachment feature.
11523-11523: LGTM!tests/unit/utils/test_responses.py (2)
2231-2278: Strengthen assertions onresult.inputcontent.The test verifies
isinstance(result.input, str)but doesn't confirm the image base64 data is absent from the input or that the text attachment content is present. Sinceprepare_inputis not mocked, adding these assertions would verify the real separation of text and image attachments.♻️ Suggested additional assertions
assert isinstance(result.input, str) + assert image_data not in result.input + assert "log output" in result.input assert result.image_attachments is not None
5-5: LGTM!Also applies to: 59-59
tests/unit/utils/test_query.py (1)
444-463: LGTM!tests/unit/utils/agents/test_query.py (1)
3-3: LGTM!Also applies to: 15-15, 30-30, 437-479
tests/unit/utils/agents/test_streaming.py (1)
6-6: LGTM!Also applies to: 23-23, 55-55, 895-956
Signed-off-by: Lucas <lyoon@redhat.com>
865afd3 to
6f9d644
Compare
Description
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