Skip to content

LCORE-2310: Refactor source resolution utility#1850

Merged
tisnik merged 1 commit into
lightspeed-core:mainfrom
asimurka:refator_source_resolution
Jun 4, 2026
Merged

LCORE-2310: Refactor source resolution utility#1850
tisnik merged 1 commit into
lightspeed-core:mainfrom
asimurka:refator_source_resolution

Conversation

@asimurka

@asimurka asimurka commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Description

Refactors source resolution utility function to use only result attributes so that it is reusable for pydantic-based handler.

Type of change

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

Tools used to create PR

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

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

Related Tickets & Documents

Checklist before requesting a review

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

Testing

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

@asimurka asimurka requested a review from tisnik June 4, 2026 14:06
@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@asimurka, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 12 minutes and 7 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5d06d178-dec7-4749-85b5-dcce75b77193

📥 Commits

Reviewing files that changed from the base of the PR and between 4920d68 and 3a04812.

📒 Files selected for processing (2)
  • src/utils/responses.py
  • tests/unit/utils/test_responses.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

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

❤️ Share

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

@asimurka asimurka requested a review from jrobertboos June 4, 2026 14:06
Comment thread src/utils/responses.py
for result in results:
resolved_source = _resolve_source_for_result(result, vs_ids, id_mapping)

# Handle both object and dict access

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

result is always an object

Comment thread src/utils/responses.py
Parameters:
----------
result: A file search result object with optional attributes.
attributes: A dictionary of attributes from a file search result.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Pass only attributes dict for more general usage. Pydantic uses native openai models while llama stack uses its own (mirrored) types.

@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 71cd53c into lightspeed-core:main Jun 4, 2026
30 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