Skip to content

LCORE-3496: add file processor to default config - #2402

Merged
tisnik merged 1 commit into
lightspeed-core:mainfrom
Jdubrick:add-file-processor
Aug 11, 2026
Merged

LCORE-3496: add file processor to default config#2402
tisnik merged 1 commit into
lightspeed-core:mainfrom
Jdubrick:add-file-processor

Conversation

@Jdubrick

@Jdubrick Jdubrick commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Description

  • Adds the file_processors OGX API and the built-in pypdf processor to the default_run.yaml base for unified config

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up service version
  • Bump-up dependent library [pyproject.toml + uv.lock]
  • Bump-up dependent library [requirements.*.txt for Konflux]
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change
  • Unit tests improvement
  • Integration tests improvement
  • End to end tests improvement
  • Benchmarks improvement

Tools used to create PR

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

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

Related Tickets & Documents

Checklist before requesting a review

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

Testing

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

Summary by CodeRabbit

  • New Features

    • Added default file-processing support for vector-store attachments and Notebook indexing.
    • Enabled PDF processing with configurable 800-token chunks and 400-token overlap.
  • Tests

    • Added coverage verifying the default file-processing configuration.

Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The default baseline now enables the file_processors API, configures an inline pypdf provider with 800-token chunks and 400-token overlap, and tests the resulting configuration.

Changes

File processor baseline

Layer / File(s) Summary
Configure and validate file processor baseline
src/data/default_run.yaml, tests/unit/test_llama_stack_synthesize.py
The baseline documents and enables file_processors, adds the inline pypdf provider, and verifies the provider configuration.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: tisnik

🚥 Pre-merge checks | ✅ 7
✅ Passed checks (7 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the addition of the file processor to the default configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Performance And Algorithmic Complexity ✅ Passed PASS: The diff adds static YAML entries and a bounded unit assertion; baseline loading uses one safe_load, with no new loops, API calls, list operations, caches, or unbounded state.
Security And Secret Handling ✅ Passed The commit only adds a pypdf provider and API entry in YAML plus a unit test; values contain no plaintext secrets, executable input handling, or Kubernetes Secret changes.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

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

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 `@tests/unit/test_llama_stack_synthesize.py`:
- Around line 126-134: Update
test_load_default_baseline_includes_file_processors to locate the pypdf provider
entry and assert its default_chunk_size_tokens is 800 and
default_chunk_overlap_tokens is 400, while preserving the existing provider_id
and provider_type checks.
🪄 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: 5a22cc09-53b8-469f-b524-b033c068d06b

📥 Commits

Reviewing files that changed from the base of the PR and between d301b63 and 5fcd83a.

📒 Files selected for processing (2)
  • src/data/default_run.yaml
  • tests/unit/test_llama_stack_synthesize.py
📜 Review details
⏰ Context from checks skipped due to timeout. (13)
  • GitHub Check: unit_tests (3.12)
  • GitHub Check: build-pr
  • GitHub Check: unit_tests (3.13)
  • GitHub Check: integration_tests (3.12)
  • GitHub Check: integration_tests (3.13)
  • GitHub Check: Pylinter
  • GitHub Check: E2E: library mode / ci / group 1
  • GitHub Check: E2E: server mode / ci / group 1
  • GitHub Check: E2E: server mode / ci / group 3
  • GitHub Check: E2E: server mode / ci / group 2
  • GitHub Check: E2E: library mode / ci / group 2
  • GitHub Check: E2E: library mode / ci / group 3
  • GitHub Check: E2E Tests for Lightspeed Evaluation job
⚠️ CI failures not shown inline (2)

GitHub Check: Konflux kflux-prd-rh02 / lightspeed-stack-0-8-on-pull-request: Failed

Conclusion: failure

View job details

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-z4d8t">lightspeed-stack-0-8-on-pull-request-z4d8t</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-z4d8t/logs/init)
</td></tr>
<tr>
<td>🟢 Succeeded</td>
<td>15 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-z4d8t/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-z4d8t/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-z4d8t/logs/build-images)
</td></tr>
</table>

GitHub Check: Konflux kflux-prd-rh02 / lightspeed-stack-0-7-on-pull-request: Failed

Conclusion: failure

View job details

Konflux kflux-prd-rh02/lightspeed-stack-0-7-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-7-on-pull-request-xsqsg">lightspeed-stack-0-7-on-pull-request-xsqsg</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-7-on-pull-request-xsqsg/logs/init)
</td></tr>
<tr>
<td>🟢 Succeeded</td>
<td>15 seconds</td><td>
[clone-repository](https://konflux-ui.apps.kflux-prd-rh02.0fk9.p1.openshiftapps.com/ns/lightspeed-core-tenant/pipelinerun/lightspeed-stack-0-7-on-pull-request-xsqsg/logs/clone-repository)
</td></tr>
<tr>
<td>🔴 Failed</td>
<td>20 seconds</td><td>
[prefetch-dependencies](https://konflux-ui.apps.kflux-prd-rh02.0fk9.p1.openshiftapps.com/ns/lightspeed-core-tenant/pipelinerun/lightspeed-stack-0-7-on-pull-request-xsqsg/logs/prefetch-dependencies)
</td></tr>
</table>
🧰 Additional context used
📓 Path-based instructions (2)
**/*

📄 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:

  • tests/unit/test_llama_stack_synthesize.py
  • src/data/default_run.yaml
tests/unit/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Use pytest for unit tests, shared fixtures in conftest.py, pytest-mock for mocks, pytest.mark.asyncio for async tests, and maintain at least 60% unit-test coverage.

Files:

  • tests/unit/test_llama_stack_synthesize.py
🧠 Learnings (2)
📚 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_synthesize.py
📚 Learning: 2026-05-20T08:09:30.641Z
Learnt from: max-svistunov
Repo: lightspeed-core/lightspeed-stack PR: 1580
File: docs/design/llama-stack-config-merge/poc-results/library-mode/synthesized-run.yaml:107-110
Timestamp: 2026-05-20T08:09:30.641Z
Learning: In Llama-stack config YAMLs, when defining a Llama Guard safety shield entry, set `provider_shield_id` to the *guard model identifier* (e.g., `meta-llama/Llama-Guard-3-8B`). Do not use a chat/generative model id (e.g., `openai/gpt-4o-mini`): a chat-model id (or `native_override`) indicates only an override landed and does **not** mean the safety shield is actually gating queries. Ensure any E2E coverage for the related implementation (JIRA/E2E tests) exercises a real Llama Guard model to verify that the shield is effective.

Applied to files:

  • src/data/default_run.yaml
🔇 Additional comments (1)
src/data/default_run.yaml (1)

11-17: LGTM!

Also applies to: 28-28, 53-59

Comment on lines +126 to +134
def test_load_default_baseline_includes_file_processors() -> None:
"""Default stack ships file_processors so vector-store file attach works."""
baseline = load_default_baseline()
assert "file_processors" in baseline["apis"]
processors = baseline["providers"]["file_processors"]
assert any(
p.get("provider_id") == "pypdf" and p.get("provider_type") == "inline::pypdf"
for p in processors
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Assert the configured chunk values.

The test passes when pypdf has the correct provider type but incorrect chunking values. Assert default_chunk_size_tokens == 800 and default_chunk_overlap_tokens == 400 to cover the configuration added on Lines 57-59 of src/data/default_run.yaml.

Proposed test update
     processors = baseline["providers"]["file_processors"]
-    assert any(
-        p.get("provider_id") == "pypdf" and p.get("provider_type") == "inline::pypdf"
-        for p in processors
+    pypdf = next(
+        (p for p in processors if p.get("provider_id") == "pypdf"),
+        None,
     )
+    assert pypdf is not None
+    assert pypdf["provider_type"] == "inline::pypdf"
+    assert pypdf["config"]["default_chunk_size_tokens"] == 800
+    assert pypdf["config"]["default_chunk_overlap_tokens"] == 400
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
def test_load_default_baseline_includes_file_processors() -> None:
"""Default stack ships file_processors so vector-store file attach works."""
baseline = load_default_baseline()
assert "file_processors" in baseline["apis"]
processors = baseline["providers"]["file_processors"]
assert any(
p.get("provider_id") == "pypdf" and p.get("provider_type") == "inline::pypdf"
for p in processors
)
def test_load_default_baseline_includes_file_processors() -> None:
"""Default stack ships file_processors so vector-store file attach works."""
baseline = load_default_baseline()
assert "file_processors" in baseline["apis"]
processors = baseline["providers"]["file_processors"]
pypdf = next(
(p for p in processors if p.get("provider_id") == "pypdf"),
None,
)
assert pypdf is not None
assert pypdf["provider_type"] == "inline::pypdf"
assert pypdf["config"]["default_chunk_size_tokens"] == 800
assert pypdf["config"]["default_chunk_overlap_tokens"] == 400
🤖 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/test_llama_stack_synthesize.py` around lines 126 - 134, Update
test_load_default_baseline_includes_file_processors to locate the pypdf provider
entry and assert its default_chunk_size_tokens is 800 and
default_chunk_overlap_tokens is 400, while preserving the existing provider_id
and provider_type checks.

@tisnik tisnik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@tisnik
tisnik merged commit 837ff74 into lightspeed-core:main Aug 11, 2026
41 of 54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants