RHIDP-14130: OKP experience improvements - citation URLs, search mode, ogx provider migration - #2357
Conversation
- Build correct citation URLs for OKP documents in both offline (localhost) and online (docs.redhat.com) modes for rag.inline and rag.tool paths - Add search_mode field to OkpConfiguration for operator-level default (keyword/hybrid/semantic) - Fix lexical→keyword mode translation so BM25 search works without an embedding model (air-gapped support) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update providers submodule to upstream main (faf6a89) which includes merged PR lightspeed-core#160: Solr vector_io provider migrated to ogx imports - Add SOLR_EMBEDDING_MODEL_ID constant to prevent double-prefixing - Use constant in llama_stack_configuration.py for model/vector store registration
Update LIGHTSPEED_PROVIDERS_COMMIT from 8cd1b3d (PR lightspeed-core#118) to faf6a89 (PR lightspeed-core#160 merge) so default builds include the Solr ogx provider migration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Regenerate openapi.json to include search_mode field on OkpConfiguration. Fix test_dump_configuration expectations for search_mode: None. Fix test_enrich_solr_adds_embedding_model for sentence-transformers/ prefix. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
WalkthroughThe change updates Solr provider and embedding registration, adds OKP search-mode configuration and dispatch normalization, and constructs URLs for OKP referenced documents. OpenAPI schemas and unit tests reflect the new behavior. ChangesOKP and Solr integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Request as SolrVectorSearchRequest
participant VectorSearch as vector_search
participant Configuration as OkpConfiguration
participant LlamaStack as Llama Stack
Request->>VectorSearch: provide optional search mode
VectorSearch->>Configuration: read okp.search_mode when absent
VectorSearch->>LlamaStack: send normalized search mode
Configuration->>LlamaStack: register default_search_mode
sequenceDiagram
participant RAGResult
participant ResponseParser as parse_referenced_documents
participant URLBuilder as _build_okp_doc_url
participant ToolProcessor as build_referenced_document
participant ReferencedDocument
RAGResult->>ResponseParser: provide chunk metadata
ResponseParser->>URLBuilder: build OKP document URL
RAGResult->>ToolProcessor: provide result
ToolProcessor->>URLBuilder: build OKP URL when needed
ToolProcessor->>ReferencedDocument: set resolved source and URL
Suggested reviewers: 🚥 Pre-merge checks | ✅ 7✅ Passed checks (7 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
deploy/lightspeed-stack/Containerfile (1)
39-48: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winAlign the Konflux artifact lock with
LIGHTSPEED_PROVIDERS_COMMIT.
.konflux/artifacts.lock.yamlpinslightspeed-providers.zipto8cd1b3d3bdd841ea99d31b334ae00a275581661c, while theContainerfilefallback usesfaf6a89a3ad7856e2e7a934324f31d146108acdb. When cachi2 supplies the prefetched zip, extraction will not use the new commit, defeating the pin. Update the Konflux artifacts lock to the same commit before relying on this path.🤖 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 `@deploy/lightspeed-stack/Containerfile` around lines 39 - 48, Update the Konflux artifacts lock entry for lightspeed-providers.zip to pin commit faf6a89a3ad7856e2e7a934324f31d146108acdb, matching the LIGHTSPEED_PROVIDERS_COMMIT value used by the Containerfile fallback.
🤖 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 147-154: Update the mode field description to document that
_build_query_params first uses configuration.okp.search_mode when mode is unset,
falling back to SOLR_VECTOR_SEARCH_DEFAULT_MODE only when that configuration is
also unset. Also update the deprecated-payload warning near the mode validation
logic to include "keyword" alongside the existing deprecated modes.
In `@src/utils/agents/tool_processor.py`:
- Around line 297-299: Update the OKP branch in the document URL processing flow
around _build_okp_doc_url so its result replaces the existing doc_url only when
a non-None URL is returned; otherwise preserve the standard URL already resolved
earlier. Add a regression test for an OKP result containing doc_url but no
source_path, reference_url, or doc_id, and assert the original URL remains.
In `@src/utils/responses.py`:
- Around line 861-865: In the `_build_okp_doc_url` docstring, replace the
`Args:` parameter header with the project-standard `Parameters:` header while
preserving the existing parameter description and return documentation.
---
Outside diff comments:
In `@deploy/lightspeed-stack/Containerfile`:
- Around line 39-48: Update the Konflux artifacts lock entry for
lightspeed-providers.zip to pin commit faf6a89a3ad7856e2e7a934324f31d146108acdb,
matching the LIGHTSPEED_PROVIDERS_COMMIT value used by the Containerfile
fallback.
🪄 Autofix
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 Plus
Run ID: f370ac49-89c7-4d7a-b82e-40326b825161
📒 Files selected for processing (15)
deploy/lightspeed-stack/Containerfiledocs/devel_doc/openapi.jsonproviderssrc/constants.pysrc/llama_stack_configuration.pysrc/models/common/query.pysrc/models/config.pysrc/utils/agents/tool_processor.pysrc/utils/responses.pysrc/utils/vector_search.pytests/unit/models/config/test_dump_configuration.pytests/unit/test_llama_stack_configuration.pytests/unit/utils/agents/test_tool_processor.pytests/unit/utils/test_responses.pytests/unit/utils/test_vector_search.py
📜 Review details
⏰ Context from checks skipped due to timeout. (14)
- GitHub Check: Pylinter
- GitHub Check: build-pr
- GitHub Check: integration_tests (3.13)
- GitHub Check: integration_tests (3.12)
- GitHub Check: unit_tests (3.13)
- GitHub Check: unit_tests (3.12)
- GitHub Check: E2E: library mode / ci / group 2
- GitHub Check: E2E Tests for Lightspeed Evaluation job
- GitHub Check: E2E: server mode / ci / group 3
- GitHub Check: E2E: library mode / ci / group 1
- GitHub Check: E2E: server mode / ci / group 2
- GitHub Check: E2E: library mode / ci / group 3
- GitHub Check: E2E: server mode / ci / group 1
- GitHub Check: Konflux kflux-prd-rh02 / lightspeed-stack-0-7-on-pull-request
⚠️ CI failures not shown inline (1)
GitHub Check: Konflux kflux-prd-rh02 / lightspeed-stack-0-8-on-pull-request: Failed
Conclusion: failure
Konflux kflux-prd-rh02/lightspeed-stack-0-8-on-pull-request has <b>failed</b>.
<ul>
<li><b>Namespace</b>: <a href="https://konflux-ui.apps.kflux-prd-rh02.0fk9.p1.openshiftapps.com/ns/lightspeed-core-tenant">lightspeed-core-tenant</a></li>
<li><b>PipelineRun:</b> <a href="https://konflux-ui.apps.kflux-prd-rh02.0fk9.p1.openshiftapps.com/ns/lightspeed-core-tenant/pipelinerun/lightspeed-stack-0-8-on-pull-request-vrwql">lightspeed-stack-0-8-on-pull-request-vrwql</a></li>
</ul>
<hr>
<h4>Task Statuses:</h4>
<table>
<tr><th>Status</th><th>Duration</th><th>Name</th></tr>
<tr>
<td>🟢 Succeeded</td>
<td>4 seconds</td><td>
[init](https://konflux-ui.apps.kflux-prd-rh02.0fk9.p1.openshiftapps.com/ns/lightspeed-core-tenant/pipelinerun/lightspeed-stack-0-8-on-pull-request-vrwql/logs/init)
</td></tr>
<tr>
<td>🟢 Succeeded</td>
<td>14 seconds</td><td>
[clone-repository](https://konflux-ui.apps.kflux-prd-rh02.0fk9.p1.openshiftapps.com/ns/lightspeed-core-tenant/pipelinerun/lightspeed-stack-0-8-on-pull-request-vrwql/logs/clone-repository)
</td></tr>
<tr>
<td>🟢 Succeeded</td>
<td>11 seconds</td><td>
[prefetch-dependencies](https://konflux-ui.apps.kflux-prd-rh02.0fk9.p1.openshiftapps.com/ns/lightspeed-core-tenant/pipelinerun/lightspeed-stack-0-8-on-pull-request-vrwql/logs/prefetch-dependencies)
</td></tr>
<tr>
<td>🔴 Failed</td>
<td>10 seconds</td><td>
[build-images](https://konflux-ui.apps.kflux-prd-rh02.0fk9.p1.openshiftapps.com/ns/lightspeed-core-tenant/pipelinerun/lightspeed-stack-0-8-on-pull-request-vrwql/logs/build-images)
</td></tr>
</table>
🧰 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.
**/*: Useuv runfor project commands; useuv sync --group dev --group llslibdevto install development dependencies.
Before completion, runuv run make format,uv run make verify, create unit tests for new code, and ensure tests pass.
Never commit secrets or keys; use environment variables for sensitive data.
Files:
providersdeploy/lightspeed-stack/Containerfiletests/unit/test_llama_stack_configuration.pysrc/utils/responses.pysrc/utils/vector_search.pysrc/llama_stack_configuration.pysrc/models/config.pysrc/utils/agents/tool_processor.pytests/unit/utils/agents/test_tool_processor.pysrc/models/common/query.pytests/unit/models/config/test_dump_configuration.pydocs/devel_doc/openapi.jsonsrc/constants.pytests/unit/utils/test_vector_search.pytests/unit/utils/test_responses.py
tests/unit/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
tests/unit/**/*.py: Use pytest for all unit tests; do not use unittest.
Useconftest.pyfor shared pytest fixtures andpytest-mockforAsyncMockobjects.
Mark asynchronous pytest tests withpytest.mark.asyncio.
Files:
tests/unit/test_llama_stack_configuration.pytests/unit/utils/agents/test_tool_processor.pytests/unit/models/config/test_dump_configuration.pytests/unit/utils/test_vector_search.pytests/unit/utils/test_responses.py
**/*.{py,pyi}
📄 CodeRabbit inference engine (AGENTS.md)
Run and satisfy the configured Black, Pylint, Pyright, Ruff, pydocstyle, and type-checking standards.
Files:
tests/unit/test_llama_stack_configuration.pysrc/utils/responses.pysrc/utils/vector_search.pysrc/llama_stack_configuration.pysrc/models/config.pysrc/utils/agents/tool_processor.pytests/unit/utils/agents/test_tool_processor.pysrc/models/common/query.pytests/unit/models/config/test_dump_configuration.pysrc/constants.pytests/unit/utils/test_vector_search.pytests/unit/utils/test_responses.py
src/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
src/**/*.py: Use absolute imports for internal Python modules.
All modules must start with descriptive docstrings; uselogger = get_logger(__name__)fromlog.pyfor module logging.
Define shared constants in the centralconstants.pymodule, check it before adding constants, and annotate constants withFinal[type].
Define type aliases at module level for clarity.
Use complete type annotations for function parameters and return types; prefer modern union syntax (str | int) andOptional[Type]for optional values.
Usetyping_extensions.Selffor model validators.
Use descriptive, action-oriented snake_case function names, such asget_,validate_, andcheck_.
Functions must not modify mutable parameters in place; return a new data structure instead.
Useasync deffor I/O operations and external API calls.
HandleAPIConnectionErrorfrom Llama Stack.
Usefrom log import get_loggerand initialize module logging withlogger = get_logger(__name__).
Use standard log levels appropriately:debugfor diagnostics,infofor general execution,warningfor unexpected or potential problems, anderrorfor serious failures.
All classes must have descriptive docstrings, use PascalCase names, and use standard suffixes such asConfiguration,Error/Exception,Resolver, andInterfacewhere applicable.
Pydantic configuration models must extendConfigurationBase; data models must extendBaseModel.
Abstract interfaces must useABCwith@abstractmethoddecorators.
Use@model_validatorand@field_validatorfor Pydantic model validation.
Class attributes must have complete, specific type annotations; avoidAny.
Follow Google Python docstring conventions; provide required docstrings for modules, classes, and functions, including relevantParameters,Returns,Raises, andAttributessections.
Files:
src/utils/responses.pysrc/utils/vector_search.pysrc/llama_stack_configuration.pysrc/models/config.pysrc/utils/agents/tool_processor.pysrc/models/common/query.pysrc/constants.py
🧠 Learnings (6)
📚 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/test_llama_stack_configuration.pysrc/utils/responses.pysrc/utils/vector_search.pysrc/llama_stack_configuration.pysrc/models/config.pysrc/utils/agents/tool_processor.pytests/unit/utils/agents/test_tool_processor.pysrc/models/common/query.pytests/unit/models/config/test_dump_configuration.pysrc/constants.pytests/unit/utils/test_vector_search.pytests/unit/utils/test_responses.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
📚 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/responses.pysrc/utils/vector_search.pysrc/llama_stack_configuration.pysrc/models/config.pysrc/utils/agents/tool_processor.pysrc/models/common/query.pysrc/constants.py
📚 Learning: 2026-07-17T19:25:05.325Z
Learnt from: Jdubrick
Repo: lightspeed-core/lightspeed-stack PR: 2166
File: src/utils/saved_prompts.py:129-157
Timestamp: 2026-07-17T19:25:05.325Z
Learning: For any endpoint that handles saved prompts and calls `src/utils/saved_prompts.py::create_saved_prompt`, treat the endpoint as the validation boundary. Before calling `create_saved_prompt`, validate the incoming saved-prompt name and content, specifically using `validate_saved_prompt_name` and then persist (store) the normalized value it returns. Do not call `create_saved_prompt` with unvalidated/raw name/content.
Applied to files:
src/utils/responses.pysrc/utils/vector_search.pysrc/llama_stack_configuration.pysrc/models/config.pysrc/utils/agents/tool_processor.pysrc/models/common/query.pysrc/constants.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/config.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/config.pysrc/models/common/query.py
🔇 Additional comments (13)
providers (1)
1-1: 🗄️ Data Integrity & IntegrationNo change needed.
The
providerssubmodule pointer resolves to the expected commit, and the commit is available from the configured remote.src/constants.py (1)
238-239: LGTM!Also applies to: 257-257
src/llama_stack_configuration.py (1)
885-885: LGTM!Also applies to: 911-911
tests/unit/test_llama_stack_configuration.py (1)
811-811: LGTM!docs/devel_doc/openapi.json (1)
15953-15969: LGTM!Also applies to: 21297-21310
src/models/config.py (1)
2558-2566: LGTM!src/utils/vector_search.py (1)
124-128: LGTM!tests/unit/utils/test_vector_search.py (1)
165-174: LGTM!Also applies to: 198-250
tests/unit/models/config/test_dump_configuration.py (1)
251-251: LGTM!Also applies to: 481-481, 862-862, 1127-1127, 1425-1425, 1650-1650, 2035-2035, 2266-2266, 2497-2497, 2735-2735
src/utils/responses.py (1)
8-8: LGTM!Also applies to: 867-878, 930-935
src/utils/agents/tool_processor.py (1)
20-20: LGTM!Also applies to: 32-32, 290-295, 310-310
tests/unit/utils/test_responses.py (1)
72-72: LGTM!Also applies to: 3150-3378
tests/unit/utils/agents/test_tool_processor.py (1)
346-404: LGTM!
- Fix doc_url fallback in tool_processor: preserve existing URL when _build_okp_doc_url returns None (edge case with no OKP reference fields) - Update mode field description to document OKP config fallback chain - Add 'keyword' to deprecated-payload warning message - Fix docstring header: Args -> Parameters per project convention - Regenerate OpenAPI schema for updated field description Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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 `@src/models/common/query.py`:
- Around line 147-153: Update the class docstring for the query mode near the
mode field to state that an omitted mode first uses
configuration.okp.search_mode, then falls back to
SOLR_VECTOR_SEARCH_DEFAULT_MODE. Keep the existing descriptions of explicit
modes and search behavior unchanged, and ensure the class-level documentation
matches the field description.
🪄 Autofix
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 Plus
Run ID: 3ce675ff-ac87-4402-b5c6-d0cd1f54b420
📒 Files selected for processing (4)
docs/devel_doc/openapi.jsonsrc/models/common/query.pysrc/utils/agents/tool_processor.pysrc/utils/responses.py
📜 Review details
⏰ Context from checks skipped due to timeout. (10)
- GitHub Check: Pylinter
- GitHub Check: E2E: library mode / ci / group 1
- GitHub Check: E2E: server mode / ci / group 3
- GitHub Check: E2E Tests for Lightspeed Evaluation job
- GitHub Check: unit_tests (3.12)
- GitHub Check: E2E: server mode / ci / group 1
- GitHub Check: E2E: server mode / ci / group 2
- GitHub Check: unit_tests (3.13)
- GitHub Check: check
- GitHub Check: Konflux kflux-prd-rh02 / lightspeed-stack-0-7-on-pull-request
⚠️ CI failures not shown inline (1)
GitHub Check: Konflux kflux-prd-rh02 / lightspeed-stack-0-8-on-pull-request: Failed
Conclusion: failure
Konflux kflux-prd-rh02/lightspeed-stack-0-8-on-pull-request has <b>failed</b>.
<ul>
<li><b>Namespace</b>: <a href="https://konflux-ui.apps.kflux-prd-rh02.0fk9.p1.openshiftapps.com/ns/lightspeed-core-tenant">lightspeed-core-tenant</a></li>
<li><b>PipelineRun:</b> <a href="https://konflux-ui.apps.kflux-prd-rh02.0fk9.p1.openshiftapps.com/ns/lightspeed-core-tenant/pipelinerun/lightspeed-stack-0-8-on-pull-request-4rjp9">lightspeed-stack-0-8-on-pull-request-4rjp9</a></li>
</ul>
<hr>
<h4>Task Statuses:</h4>
<table>
<tr><th>Status</th><th>Duration</th><th>Name</th></tr>
<tr>
<td>🟢 Succeeded</td>
<td>5 seconds</td><td>
[init](https://konflux-ui.apps.kflux-prd-rh02.0fk9.p1.openshiftapps.com/ns/lightspeed-core-tenant/pipelinerun/lightspeed-stack-0-8-on-pull-request-4rjp9/logs/init)
</td></tr>
<tr>
<td>🟢 Succeeded</td>
<td>14 seconds</td><td>
[clone-repository](https://konflux-ui.apps.kflux-prd-rh02.0fk9.p1.openshiftapps.com/ns/lightspeed-core-tenant/pipelinerun/lightspeed-stack-0-8-on-pull-request-4rjp9/logs/clone-repository)
</td></tr>
<tr>
<td>🟢 Succeeded</td>
<td>9 seconds</td><td>
[prefetch-dependencies](https://konflux-ui.apps.kflux-prd-rh02.0fk9.p1.openshiftapps.com/ns/lightspeed-core-tenant/pipelinerun/lightspeed-stack-0-8-on-pull-request-4rjp9/logs/prefetch-dependencies)
</td></tr>
<tr>
<td>🔴 Failed</td>
<td>11 seconds</td><td>
[build-images](https://konflux-ui.apps.kflux-prd-rh02.0fk9.p1.openshiftapps.com/ns/lightspeed-core-tenant/pipelinerun/lightspeed-stack-0-8-on-pull-request-4rjp9/logs/build-images)
</td></tr>
</table>
🧰 Additional context used
📓 Path-based instructions (5)
**/*
📄 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.
**/*: Useuvfor dependency management and prefix project commands withuv run; synchronize development dependencies withuv sync --group dev --group llslibdevwhen required.
Before completing code changes, runuv run make format,uv run make verify, and the applicable tests; regenerate the OpenAPI schema when models change, and report completion only after checks pass.
Follow existing code patterns in the module being modified and write unit tests covering new functionality.
Files:
src/utils/agents/tool_processor.pysrc/utils/responses.pysrc/models/common/query.pydocs/devel_doc/openapi.json
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
**/*.py: Use absolute imports for internal Python modules.
All modules must begin with descriptive docstrings; package__init__.pyfiles must contain brief package descriptions.
Uselogger = get_logger(__name__)fromlog.pyfor module logging.
UseFinal[type]type hints for constants and define shared constants in the centralconstants.pymodule.
Files:
src/utils/agents/tool_processor.pysrc/utils/responses.pysrc/models/common/query.py
src/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
src/**/*.py: Functions must have descriptive docstrings, complete parameter and return type annotations, and descriptive snake_case action-oriented names.
Usetyping_extensions.Selffor model validators, modern union syntax such asstr | int, andOptional[Type]for optional types.
Avoid modifying mutable parameters in place; return a new data structure instead.
Useasync deffor I/O operations and external API calls.
Classes require descriptive docstrings, PascalCase descriptive names, complete attribute type annotations, and specific types instead ofAny. UseABCand@abstractmethodfor interfaces.
Follow Google Python docstring conventions and include relevantParameters,Returns,Raises, andAttributessections.
Files:
src/utils/agents/tool_processor.pysrc/utils/responses.pysrc/models/common/query.py
**/*.{py,yaml,yml,json,toml}
📄 CodeRabbit inference engine (AGENTS.md)
Never commit secrets or keys; use environment variables for sensitive data.
Files:
src/utils/agents/tool_processor.pysrc/utils/responses.pysrc/models/common/query.pydocs/devel_doc/openapi.json
src/models/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
Pydantic configuration models must extend
ConfigurationBase; data models must extendBaseModel; usemodel_validatorandfield_validatorfor validation.
Files:
src/models/common/query.py
🧠 Learnings (6)
📚 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/tool_processor.pysrc/utils/responses.pysrc/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/utils/agents/tool_processor.pysrc/utils/responses.pysrc/models/common/query.py
📚 Learning: 2026-07-17T19:25:05.325Z
Learnt from: Jdubrick
Repo: lightspeed-core/lightspeed-stack PR: 2166
File: src/utils/saved_prompts.py:129-157
Timestamp: 2026-07-17T19:25:05.325Z
Learning: For any endpoint that handles saved prompts and calls `src/utils/saved_prompts.py::create_saved_prompt`, treat the endpoint as the validation boundary. Before calling `create_saved_prompt`, validate the incoming saved-prompt name and content, specifically using `validate_saved_prompt_name` and then persist (store) the normalized value it returns. Do not call `create_saved_prompt` with unvalidated/raw name/content.
Applied to files:
src/utils/agents/tool_processor.pysrc/utils/responses.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
📚 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
🔇 Additional comments (4)
docs/devel_doc/openapi.json (1)
21306-21306: LGTM!src/models/common/query.py (1)
210-210: LGTM!src/utils/responses.py (1)
8-8: LGTM!Also applies to: 854-878, 930-935
src/utils/agents/tool_processor.py (1)
20-20: LGTM!Also applies to: 32-32, 290-300, 310-310
| mode: Optional[Literal["semantic", "hybrid", "lexical", "keyword"]] = Field( | ||
| None, | ||
| description=( | ||
| "Solr vector_io search mode. When omitted, the server default " | ||
| f"({SOLR_VECTOR_SEARCH_DEFAULT_MODE!r}) is used." | ||
| "Solr vector_io search mode. When omitted, the configured OKP default " | ||
| f"is used; otherwise {SOLR_VECTOR_SEARCH_DEFAULT_MODE!r} applies. " | ||
| "'keyword' and 'lexical' both use BM25 text search." | ||
| ), |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Synchronize the class-level mode documentation.
The field description now documents the configured OKP fallback, but the class docstring at Lines 138 and 142 still says that an omitted mode uses the server default. src/utils/vector_search.py uses configuration.okp.search_mode before SOLR_VECTOR_SEARCH_DEFAULT_MODE. Update the class docstring to describe the same precedence.
🤖 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/models/common/query.py` around lines 147 - 153, Update the class
docstring for the query mode near the mode field to state that an omitted mode
first uses configuration.okp.search_mode, then falls back to
SOLR_VECTOR_SEARCH_DEFAULT_MODE. Keep the existing descriptions of explicit
modes and search behavior unchanged, and ensure the class-level documentation
matches the field description.
Wire OKP search_mode from lightspeed-stack.yaml into the OGX top-level vector_stores.chunk_retrieval_params.default_search_mode config. This enables rag.tool (file_search) to use keyword/hybrid search instead of defaulting to vector similarity, which is critical for air-gap environments without an embedding model. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/llama_stack_configuration.py`:
- Line 770: Update the docstring for enrich_solr to rename its parameter section
header from “Args:” to “Parameters:”, leaving the documented parameter content
unchanged.
- Around line 932-937: Update the configuration-building logic around ls_config
to avoid mutating the caller-owned object: create a copied configuration with
copied vector_stores and chunk_retrieval_params, set default_search_mode on the
copy, and return it. Update the enclosing function’s callers and tests to
consume the returned configuration rather than relying on in-place changes.
🪄 Autofix
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 Plus
Run ID: 03d5279a-51ed-4df0-9f44-1d78414614a9
📒 Files selected for processing (2)
src/llama_stack_configuration.pytests/unit/test_llama_stack_configuration.py
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
- GitHub Check: Konflux kflux-prd-rh02 / lightspeed-stack-0-7-on-pull-request
⚠️ CI failures not shown inline (1)
GitHub Check: Konflux kflux-prd-rh02 / lightspeed-stack-0-8-on-pull-request: Failed
Conclusion: failure
Konflux kflux-prd-rh02/lightspeed-stack-0-8-on-pull-request has <b>failed</b>.
<ul>
<li><b>Namespace</b>: <a href="https://konflux-ui.apps.kflux-prd-rh02.0fk9.p1.openshiftapps.com/ns/lightspeed-core-tenant">lightspeed-core-tenant</a></li>
<li><b>PipelineRun:</b> <a href="https://konflux-ui.apps.kflux-prd-rh02.0fk9.p1.openshiftapps.com/ns/lightspeed-core-tenant/pipelinerun/lightspeed-stack-0-8-on-pull-request-t6sj7">lightspeed-stack-0-8-on-pull-request-t6sj7</a></li>
</ul>
<hr>
<h4>Task Statuses:</h4>
<table>
<tr><th>Status</th><th>Duration</th><th>Name</th></tr>
<tr>
<td>🟢 Succeeded</td>
<td>5 seconds</td><td>
[init](https://konflux-ui.apps.kflux-prd-rh02.0fk9.p1.openshiftapps.com/ns/lightspeed-core-tenant/pipelinerun/lightspeed-stack-0-8-on-pull-request-t6sj7/logs/init)
</td></tr>
<tr>
<td>🟢 Succeeded</td>
<td>16 seconds</td><td>
[clone-repository](https://konflux-ui.apps.kflux-prd-rh02.0fk9.p1.openshiftapps.com/ns/lightspeed-core-tenant/pipelinerun/lightspeed-stack-0-8-on-pull-request-t6sj7/logs/clone-repository)
</td></tr>
<tr>
<td>🟢 Succeeded</td>
<td>10 seconds</td><td>
[prefetch-dependencies](https://konflux-ui.apps.kflux-prd-rh02.0fk9.p1.openshiftapps.com/ns/lightspeed-core-tenant/pipelinerun/lightspeed-stack-0-8-on-pull-request-t6sj7/logs/prefetch-dependencies)
</td></tr>
<tr>
<td>🔴 Failed</td>
<td>12 seconds</td><td>
[build-images](https://konflux-ui.apps.kflux-prd-rh02.0fk9.p1.openshiftapps.com/ns/lightspeed-core-tenant/pipelinerun/lightspeed-stack-0-8-on-pull-request-t6sj7/logs/build-images)
</td></tr>
</table>
🧰 Additional context used
📓 Path-based instructions (5)
**/*
📄 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.
**/*: Useuvfor dependency management and prefix project commands withuv run; synchronize development dependencies withuv sync --group dev --group llslibdevwhen required.
Before completing code changes, runuv run make format,uv run make verify, and the applicable tests; regenerate the OpenAPI schema when models change, and report completion only after checks pass.
Follow existing code patterns in the module being modified and write unit tests covering new functionality.
Files:
tests/unit/test_llama_stack_configuration.pysrc/llama_stack_configuration.py
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
**/*.py: Use absolute imports for internal Python modules.
All modules must begin with descriptive docstrings; package__init__.pyfiles must contain brief package descriptions.
Uselogger = get_logger(__name__)fromlog.pyfor module logging.
UseFinal[type]type hints for constants and define shared constants in the centralconstants.pymodule.
Files:
tests/unit/test_llama_stack_configuration.pysrc/llama_stack_configuration.py
tests/unit/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
Use pytest for unit tests; do not use unittest. Put shared fixtures in
conftest.py, usepytest-mockfor mocks, mark asynchronous tests withpytest.mark.asyncio, and maintain at least 60% unit-test coverage.
Files:
tests/unit/test_llama_stack_configuration.py
**/*.{py,yaml,yml,json,toml}
📄 CodeRabbit inference engine (AGENTS.md)
Never commit secrets or keys; use environment variables for sensitive data.
Files:
tests/unit/test_llama_stack_configuration.pysrc/llama_stack_configuration.py
src/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
src/**/*.py: Functions must have descriptive docstrings, complete parameter and return type annotations, and descriptive snake_case action-oriented names.
Usetyping_extensions.Selffor model validators, modern union syntax such asstr | int, andOptional[Type]for optional types.
Avoid modifying mutable parameters in place; return a new data structure instead.
Useasync deffor I/O operations and external API calls.
Classes require descriptive docstrings, PascalCase descriptive names, complete attribute type annotations, and specific types instead ofAny. UseABCand@abstractmethodfor interfaces.
Follow Google Python docstring conventions and include relevantParameters,Returns,Raises, andAttributessections.
Files:
src/llama_stack_configuration.py
🧠 Learnings (3)
📚 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/test_llama_stack_configuration.pysrc/llama_stack_configuration.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/llama_stack_configuration.py
📚 Learning: 2026-07-17T19:25:05.325Z
Learnt from: Jdubrick
Repo: lightspeed-core/lightspeed-stack PR: 2166
File: src/utils/saved_prompts.py:129-157
Timestamp: 2026-07-17T19:25:05.325Z
Learning: For any endpoint that handles saved prompts and calls `src/utils/saved_prompts.py::create_saved_prompt`, treat the endpoint as the validation boundary. Before calling `create_saved_prompt`, validate the incoming saved-prompt name and content, specifically using `validate_saved_prompt_name` and then persist (store) the normalized value it returns. Do not call `create_saved_prompt` with unvalidated/raw name/content.
Applied to files:
src/llama_stack_configuration.py
🔇 Additional comments (3)
src/llama_stack_configuration.py (2)
881-885: LGTM!Also applies to: 911-911
922-931: LGTM!tests/unit/test_llama_stack_configuration.py (1)
887-950: LGTM!
- Use Parameters: instead of Args: in enrich_solr docstring - Update SolrSearchOptions class docstring to match field description Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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)
src/llama_stack_configuration.py (1)
881-885: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy liftNormalize existing Solr registrations before returning
enrich_solr.
enrich_solrappends the Solr vector store only whenportal-ragis missing, so existing records can keep legacyembedding_modelvalues. Its model duplicate check compares the stripped baseline model, so an existing model can block registration ofsentence-transformers/solr_embedding. Add migration/upsert logic and cover it with an upgrade test.🤖 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/llama_stack_configuration.py` around lines 881 - 885, Update enrich_solr to normalize existing Solr vector-store registrations before returning: migrate matching records to constants.SOLR_EMBEDDING_MODEL_ID and upsert the required Solr registration instead of only appending when portal-rag is absent. Preserve the duplicate-model check using the normalized model, and add an upgrade test covering legacy embedding_model values and the resulting registration.
♻️ Duplicate comments (1)
src/llama_stack_configuration.py (1)
932-937: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy liftStop mutating the caller-owned configuration.
setdefaultand the direct assignment modifyls_configin place. This branch adds persistent state to the caller's dictionary and violates the repository rule for mutable parameters. Build an independent configuration, return it, and update callers and tests to consume the returned value.🤖 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/llama_stack_configuration.py` around lines 932 - 937, Update the configuration handling around chunk_retrieval_params so it does not mutate the caller-owned ls_config: create an independent configuration before applying vector_stores and default_search_mode changes, return that configuration, and update all callers and tests to consume the returned value.Source: Coding guidelines
🤖 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 `@src/llama_stack_configuration.py`:
- Around line 881-885: Update enrich_solr to normalize existing Solr
vector-store registrations before returning: migrate matching records to
constants.SOLR_EMBEDDING_MODEL_ID and upsert the required Solr registration
instead of only appending when portal-rag is absent. Preserve the
duplicate-model check using the normalized model, and add an upgrade test
covering legacy embedding_model values and the resulting registration.
---
Duplicate comments:
In `@src/llama_stack_configuration.py`:
- Around line 932-937: Update the configuration handling around
chunk_retrieval_params so it does not mutate the caller-owned ls_config: create
an independent configuration before applying vector_stores and
default_search_mode changes, return that configuration, and update all callers
and tests to consume the returned value.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 17ca58fd-4177-4747-b7d5-ac6c037cb5fb
📒 Files selected for processing (2)
src/llama_stack_configuration.pysrc/models/common/query.py
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
- GitHub Check: Konflux kflux-prd-rh02 / lightspeed-stack-0-7-on-pull-request
⚠️ CI failures not shown inline (1)
GitHub Check: Konflux kflux-prd-rh02 / lightspeed-stack-0-8-on-pull-request: Failed
Conclusion: failure
Konflux kflux-prd-rh02/lightspeed-stack-0-8-on-pull-request has <b>failed</b>.
<ul>
<li><b>Namespace</b>: <a href="https://konflux-ui.apps.kflux-prd-rh02.0fk9.p1.openshiftapps.com/ns/lightspeed-core-tenant">lightspeed-core-tenant</a></li>
<li><b>PipelineRun:</b> <a href="https://konflux-ui.apps.kflux-prd-rh02.0fk9.p1.openshiftapps.com/ns/lightspeed-core-tenant/pipelinerun/lightspeed-stack-0-8-on-pull-request-z9zv4">lightspeed-stack-0-8-on-pull-request-z9zv4</a></li>
</ul>
<hr>
<h4>Task Statuses:</h4>
<table>
<tr><th>Status</th><th>Duration</th><th>Name</th></tr>
<tr>
<td>🟢 Succeeded</td>
<td>5 seconds</td><td>
[init](https://konflux-ui.apps.kflux-prd-rh02.0fk9.p1.openshiftapps.com/ns/lightspeed-core-tenant/pipelinerun/lightspeed-stack-0-8-on-pull-request-z9zv4/logs/init)
</td></tr>
<tr>
<td>🟢 Succeeded</td>
<td>14 seconds</td><td>
[clone-repository](https://konflux-ui.apps.kflux-prd-rh02.0fk9.p1.openshiftapps.com/ns/lightspeed-core-tenant/pipelinerun/lightspeed-stack-0-8-on-pull-request-z9zv4/logs/clone-repository)
</td></tr>
<tr>
<td>🟢 Succeeded</td>
<td>10 seconds</td><td>
[prefetch-dependencies](https://konflux-ui.apps.kflux-prd-rh02.0fk9.p1.openshiftapps.com/ns/lightspeed-core-tenant/pipelinerun/lightspeed-stack-0-8-on-pull-request-z9zv4/logs/prefetch-dependencies)
</td></tr>
<tr>
<td>🔴 Failed</td>
<td>10 seconds</td><td>
[build-images](https://konflux-ui.apps.kflux-prd-rh02.0fk9.p1.openshiftapps.com/ns/lightspeed-core-tenant/pipelinerun/lightspeed-stack-0-8-on-pull-request-z9zv4/logs/build-images)
</td></tr>
</table>
🧰 Additional context used
📓 Path-based instructions (3)
**/*
📄 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.Never commit secrets or keys; use environment variables for sensitive data.
Files:
src/models/common/query.pysrc/llama_stack_configuration.py
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
**/*.py: Use absolute imports for internal Python modules.
Every module must begin with a descriptive docstring explaining its purpose.
Uselogger = get_logger(__name__)fromlog.pyfor module logging.
Define shared constants in the centralconstants.pymodule and annotate constants withFinal[type].
All functions must have complete parameter and return type annotations and descriptive docstrings.
Use snake_case, descriptive, action-oriented names for functions, such asget_,validate_, andcheck_.
Avoid modifying mutable parameters in place; return a new data structure instead.
Useasync deffor I/O operations and external API calls.
HandleAPIConnectionErrorfrom Llama Stack integrations.
Use standard logger levels appropriately:debugfor diagnostics,infofor general execution,warningfor unexpected or potentially problematic conditions, anderrorfor serious failures.
All classes must have descriptive docstrings, use PascalCase names, and provide complete, specific type annotations for class attributes.
Use Google Python docstring conventions, includingParameters,Returns,Raises, andAttributessections when applicable.
Files:
src/models/common/query.pysrc/llama_stack_configuration.py
src/models/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
src/models/**/*.py: Pydantic configuration models must extendConfigurationBase; data models must extendBaseModel.
Use@field_validatorand@model_validatorfor Pydantic model validation; model validators should usetyping_extensions.Selfwhere applicable.
Files:
src/models/common/query.py
🧠 Learnings (5)
📚 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-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/models/common/query.pysrc/llama_stack_configuration.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.pysrc/llama_stack_configuration.py
📚 Learning: 2026-07-17T19:25:05.325Z
Learnt from: Jdubrick
Repo: lightspeed-core/lightspeed-stack PR: 2166
File: src/utils/saved_prompts.py:129-157
Timestamp: 2026-07-17T19:25:05.325Z
Learning: For any endpoint that handles saved prompts and calls `src/utils/saved_prompts.py::create_saved_prompt`, treat the endpoint as the validation boundary. Before calling `create_saved_prompt`, validate the incoming saved-prompt name and content, specifically using `validate_saved_prompt_name` and then persist (store) the normalized value it returns. Do not call `create_saved_prompt` with unvalidated/raw name/content.
Applied to files:
src/models/common/query.pysrc/llama_stack_configuration.py
🔇 Additional comments (4)
src/llama_stack_configuration.py (1)
770-777: LGTM!src/models/common/query.py (3)
138-142: Align the legacy-client fallback documentation.Line 142 still says that a legacy filter-only object uses the server default.
src/utils/vector_search.pyresolvesmode=Nonefromconfiguration.okp.search_mode, thenSOLR_VECTOR_SEARCH_DEFAULT_MODE. Update Line 142 to describe that precedence. This remains the documentation mismatch reported in the previous review.
147-154: LGTM!
210-210: LGTM!
|
/retest |
Description
Fixes and enhances OKP (Offline Knowledge Portal) integration across both
rag.toolandrag.inlinepaths, and adds air-gap support via BM25 keyword search.What changed
1. Fix OKP citation URLs for
rag.toolpathPreviously, OKP citation URLs only worked in the
rag.inlinepath. Therag.toolpath (Responses API /file_search) was broken because:doc_urlin result attributes, but Solr provider returnsreference_urlandsource_pathinsteadreference_urlis origin-relative, not a full URLFix: Added OKP URL building to both
rag.tool(src/utils/responses.py,src/utils/agents/tool_processor.py) andrag.inlinepaths, supporting both offline (localhost) and online (docs.redhat.com) modes.2. Fix
lexical→keywordsearch mode translationThe Solr provider internally used the term
lexicalfor BM25 search, but LCORE config exposed it askeyword(more user-friendly). This mismatch meant BM25 mode was silently broken — requests withsearch_mode: keywordwould not translate correctly to the Solr provider.Fix: Added mode translation in
src/utils/vector_search.pysokeywordmaps correctly to the Solr provider'slexicalmode.3. Add configurable
search_modefor air-gap deploymentsIn air-gapped environments, users cannot download embedding models from HuggingFace. Previously there was no way to configure the search mode — it always defaulted to vector/hybrid search which requires an embedding model.
Fix: Added
search_modefield toOkpConfigurationwith three options:vector(default) — semantic search, requires embedding modelkeyword— BM25 text search, no embedding model needed (air-gap friendly)hybrid— combines bothAlso added per-request
search_modeoverride in query request models.4. Fix Solr embedding model registration prefix
The Solr embedding model was registered as
solr_embedding, but thesentence-transformersinference provider expects thesentence-transformers/prefix.Fix: Added
SOLR_EMBEDDING_MODEL_IDconstant (sentence-transformers/solr_embedding) insrc/constants.pyand used it consistently insrc/llama_stack_configuration.pyfor model and vector store registration.5. Update providers submodule + Containerfile pin
Updated to include merged lightspeed-providers PR #160 which migrates the Solr vector_io provider from
llama_stacktoogximports (faf6a89).6. Regenerated OpenAPI schema + updated tests
docs/devel_doc/openapi.jsonto include newsearch_modefield7. Propagate
search_modeto OGX forrag.toolkeyword searchPreviously,
search_mode: keywordonly affected therag.inlinepath. Therag.toolpath (file_search via Responses API) always defaulted to vector similarity search because OGX'sdefault_search_modeconfig was never set by LCORE.Fix:
enrich_solr()now readssearch_modefrom the OKP config and setsvector_stores.chunk_retrieval_params.default_search_modein the OGX top-level config. OGX auto-injects this into both the file_search tool runtime and responses provider, so both rag paths now respectsearch_mode: keyword. This is critical for air-gap environments where no embedding model is available.Air-gap scenario
With
search_mode: keyword, OKP uses Solr BM25 text search — no embedding model is downloaded or needed. This works for bothrag.toolandrag.inlinepaths:Tradeoff: Keyword search returns less precise document references than hybrid/semantic (matches on term frequency, not meaning), but the LLM answer quality is still good. For air-gapped deployments, this is the acceptable tradeoff to avoid the HuggingFace dependency.
Type of change
pyproject.toml+uv.lock]requirements.*.txtfor Konflux]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
How to test
1. Automated tests
2. Verify OpenAPI schema is up to date
3. Test
search_modeconfig parsing (manual)Add
search_modeto any config that has anokp:section:Start the service — it should boot without errors. Invalid values (e.g.
search_mode: foo) should be rejected by Pydantic validation.4. Test with a local OKP instance (optional, requires OKP/Solr)
If you have a running OKP instance, you can test all RAG + search_mode combinations:
rag.tool (default vector search via Responses API):
Ask a question via the Responses API — the
file_searchtool should return OKP chunks withreference_urllinks. The embedding model will be downloaded.rag.tool + keyword (air-gap simulation via Responses API):
Ask a question via the Responses API —
file_searchshould return OKP chunks using BM25 keyword search. No embedding model should be downloaded (check~/.cache/huggingface/hub/is empty).rag.inline + keyword (air-gap simulation via streaming_query):
Ask a question via
streaming_query— OKP results should come back using BM25 keyword search. No embedding model should be downloaded.5. What was tested locally and on OpenShift
Local testing (all 4 scenarios):
rag.tool: [okp]rag.tool: [okp]+search_mode: keywordrag.inline: [okp]+search_mode: keywordrag.inline: [okp]OpenShift testing (RHDH + OKP on OpenShift cluster with Solr, unified synthesis mode):
Air-gap verification: with
search_mode: keyword, the container's HuggingFace cache (/tmp/hf_cache/) does not exist — confirming no embedding model was downloaded. Without keyword mode, the cache contains the expected embedding model.rag.tool: [okp]rag.tool: [okp]+search_mode: keywordrag.inline: [okp]+search_mode: keywordSummary by CodeRabbit
New Features
Tests