Skip to content

LCORE-2572: Minor fixes#1944

Merged
tisnik merged 3 commits into
lightspeed-core:mainfrom
tisnik:lcore-2572-5
Jun 18, 2026
Merged

LCORE-2572: Minor fixes#1944
tisnik merged 3 commits into
lightspeed-core:mainfrom
tisnik:lcore-2572-5

Conversation

@tisnik

@tisnik tisnik commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Description

LCORE-2572: Minor fixes

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

  • Assisted-by: N/A
  • Generated by: N/A

Related Tickets & Documents

  • Related Issue #LCORE-2572

Summary by CodeRabbit

  • Documentation
    • Standardized API documentation across multiple endpoints with explicit HTTP status codes and error descriptions
    • Updated endpoint specifications with clearer parameter, raises, and return documentation
    • Extended API schemas with new MCP tool input definitions and PostgreSQL connection configuration for RAG systems
    • Improved overall documentation consistency and formatting for enhanced API clarity

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Documentation-only updates across four files: prompts.py and rags.py endpoint docstrings replace generic "Raises" text with explicit HTTP status codes; those changes are reflected in docs/openapi.json. docs/openapi.md additionally adds A2A endpoint documentation, new schema fields (trusted_proxy_config, PostgreSQL fields for ByokRag, deleted for ConversationDeleteResponse), removes inline example blocks from several schemas, and introduces an InputToolMCP component schema.

Changes

OpenAPI Documentation Updates

Layer / File(s) Summary
Prompt handler docstrings and openapi.json
src/app/endpoints/prompts.py, docs/openapi.json
update_prompt_handler and delete_prompt_handler docstring Raises sections replaced with itemized HTTP status codes (400/401/403/404/422/500/503); matching PUT and DELETE prompt operation descriptions updated in openapi.json.
RAG handler docstrings and openapi.json/openapi.md
src/app/endpoints/rags.py, docs/openapi.json, docs/openapi.md
List and single-RAG handler docstrings expanded with explicit Parameters, Raises (404/422/500/503), and Returns; reflected in GET /rags and GET /rags/{rag_id} descriptions in openapi.json and restructured section in openapi.md.
A2A endpoints and component schema additions
docs/openapi.md
Adds Parameters/Raises/Returns to /.well-known/agent-card.json, /.well-known/agent.json, and /a2a/health; adds trusted_proxy_config to AuthenticationConfiguration, PostgreSQL fields to ByokRag, deleted to ConversationDeleteResponse; removes example blocks from several schemas; adds new InputToolMCP component schema.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'LCORE-2572: Minor fixes' is vague and generic, using the term 'minor fixes' without conveying meaningful information about the specific changes made. Use a more descriptive title that specifies the primary change, such as 'Improve API documentation for RAG and prompt endpoints' or 'Add explicit HTTP status codes to endpoint docstrings and OpenAPI specs'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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.

@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: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/openapi.md (1)

2531-2532: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix the Returns bullet indentation.

The extra leading spaces make Markdown treat this as an indented block instead of a list item.

📝 Suggested fix
-    - RAGListResponse: List of RAG identifiers.
+- RAGListResponse: List of RAG identifiers.
🤖 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 `@docs/openapi.md` around lines 2531 - 2532, The indentation of the
RAGListResponse bullet point under the Returns section has extra leading spaces
that cause Markdown to treat it as an indented code block instead of a proper
list item. Remove the extra leading spaces before the dash in the
RAGListResponse line so it aligns as a standard list item with minimal
indentation beneath the Returns heading.

Source: Linters/SAST tools

🤖 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 2728-2732: The docs/openapi.json file is out of date and must be
regenerated from source code rather than manually edited. First, verify that the
Python docstrings in src/app/endpoints/prompts.py and src/app/endpoints/rags.py
contain the description updates matching the hunks shown (specifically for the
update_prompt_handler and any related RAG endpoints). Then run the provided
script to regenerate the OpenAPI schema, which will update docs/openapi.json to
match the current docstrings. Finally, commit the regenerated openapi.json file.

In `@docs/openapi.md`:
- Around line 5471-5481: The markdown headings (### Parameters:, ### Raises:,
### Returns:) are missing blank lines before and after them, which violates the
markdownlint MD022 rule and causes rendering inconsistencies. Add a blank line
before each of these headings and after the final line of each section to
properly space them. This should be applied at the three locations mentioned:
around lines 5471-5481 for the first set of headings, around lines 5502-5512 for
the second set, and around lines 5596-5603 for the third set.

In `@src/app/endpoints/prompts.py`:
- Around line 360-367: Add HTTPException with status 400 to the Raises section
in the docstring of the delete_prompt_handler function to document that a 400
response is returned when check_suid_prompt(prompt_id) fails, indicating an
invalid prompt ID format. This status code is already implemented in the
function logic and registered in the prompt_delete_responses dict, so the
docstring must be updated to reflect all possible HTTP responses the endpoint
can return.

In `@src/app/endpoints/rags.py`:
- Around line 150-166: The docstring for this GET handler incorrectly claims it
can raise an HTTPException with status 422 for incorrect request payload. Since
GET requests have no request body, this status code is impossible to return from
this endpoint. Remove the entire line mentioning HTTPException with status 422
for incorrect request payload from the Raises section of the docstring, keeping
only the status codes that are actually possible: 401, 403, 404, 500, and 503.

---

Outside diff comments:
In `@docs/openapi.md`:
- Around line 2531-2532: The indentation of the RAGListResponse bullet point
under the Returns section has extra leading spaces that cause Markdown to treat
it as an indented code block instead of a proper list item. Remove the extra
leading spaces before the dash in the RAGListResponse line so it aligns as a
standard list item with minimal indentation beneath the Returns heading.
🪄 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: 66e9a21e-e62f-42ee-9e88-ea7c00f31fd7

📥 Commits

Reviewing files that changed from the base of the PR and between 570a66e and 00e8eef.

📒 Files selected for processing (4)
  • docs/openapi.json
  • docs/openapi.md
  • src/app/endpoints/prompts.py
  • src/app/endpoints/rags.py
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
  • GitHub Check: unit_tests (3.13)
  • GitHub Check: mypy
  • GitHub Check: unit_tests (3.12)
  • GitHub Check: build-pr
  • GitHub Check: Pylinter
  • GitHub Check: E2E: library mode / ci / group 2
  • GitHub Check: E2E: library 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 3
  • GitHub Check: E2E: server mode / ci / group 1
  • GitHub Check: E2E Tests for Lightspeed Evaluation job
  • GitHub Check: Konflux kflux-prd-rh02 / lightspeed-stack-on-pull-request
  • GitHub Check: Konflux kflux-prd-rh02 / lightspeed-stack-0-6-on-pull-request
🧰 Additional context used
📓 Path-based instructions (2)
src/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.py: Use absolute imports for internal modules: from authentication import get_auth_dependency
Llama Stack imports: Use from llama_stack_client import AsyncLlamaStackClient
Check constants.py for shared constants before defining new ones
All modules must start with descriptive docstrings explaining purpose
Use logger = get_logger(__name__) from log.py for 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
Use async def for 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 @abstractmethod decorators
Follow Google Python docstring conventions with required sections: Parameters, Returns, Raises, and Attributes for classes

Files:

  • src/app/endpoints/prompts.py
  • src/app/endpoints/rags.py
src/app/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

src/app/**/*.py: FastAPI dependencies: Import from fastapi module for APIRouter, HTTPException, Request, status, Depends
Use FastAPI HTTPException with appropriate status codes for API endpoints and handle APIConnectionError from Llama Stack

Files:

  • src/app/endpoints/prompts.py
  • src/app/endpoints/rags.py
🧠 Learnings (1)
📚 Learning: 2026-04-06T20:18:07.852Z
Learnt from: major
Repo: lightspeed-core/lightspeed-stack PR: 1463
File: src/app/endpoints/rlsapi_v1.py:266-271
Timestamp: 2026-04-06T20:18:07.852Z
Learning: In the lightspeed-stack codebase, within `src/app/endpoints/` inference/MCP endpoints, treat `tools: Optional[list[Any]]` in MCP tool definitions as an intentional, consistent typing pattern (used across `query`, `responses`, `streaming_query`, `rlsapi_v1`). Do not raise or suggest this as a typing issue during code review; changing it in isolation could break endpoint typing consistency across the codebase.

Applied to files:

  • src/app/endpoints/prompts.py
  • src/app/endpoints/rags.py
🪛 GitHub Actions: OpenAPI (Spectral) / 0_spectral.txt
docs/openapi.json

[error] 1-1: OpenAPI schema is out of date. Pipeline failed because 'diff -u docs/openapi.json /tmp/openapi-generated.json' reported differences. Regenerate with: 'uv run scripts/generate_openapi_schema.py docs/openapi.json'.

🪛 GitHub Actions: OpenAPI (Spectral) / spectral
docs/openapi.json

[error] 1-1: Mismatch detected in OpenAPI schema file 'docs/openapi.json'. The file does not match the newly generated schema at '/tmp/openapi-generated.json'.


[error] 1-1: Command used to validate: 'diff -u docs/openapi.json /tmp/openapi-generated.json' (non-zero exit indicates differences).

🪛 markdownlint-cli2 (0.22.1)
docs/openapi.md

[warning] 2619-2619: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 2624-2624: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 2634-2634: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 5471-5471: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 5474-5474: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 5480-5480: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 5502-5502: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 5505-5505: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 5511-5511: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 5596-5596: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 5599-5599: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 5602-5602: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)

🔇 Additional comments (4)
src/app/endpoints/prompts.py (1)

1-398: LGTM for all other segments!

The imports, type annotations, async patterns, docstring conventions, and error handling across all handlers align with the coding guidelines. The update to update_prompt_handler docstring (lines 293–302) is complete and accurate.

docs/openapi.md (2)

2619-2635: Same 422 mismatch as the source docstring.

This should stay in sync with src/app/endpoints/rags.py; once that source docstring is corrected, regenerate this section so the published spec matches.


5913-5913: LGTM!

Also applies to: 6009-6013, 6182-6185, 6615-6630

src/app/endpoints/rags.py (1)

58-112: LGTM!

Comment thread docs/openapi.json
Comment on lines 2728 to 2732
"prompts"
],
"summary": "Update Prompt Handler",
"description": "Handle requests to the PUT /prompts/{prompt_id} endpoint.\n\nProcess requests to update a stored prompt; Llama Stack increments the\nversion. The body includes the new text, the current version being\nreplaced, and optional fields such as ``set_as_default`` and ``variables``.\nFor example:\n\n curl -X PUT http://localhost:8080/v1/prompts/pmpt_abc123 \\\\\n -H 'Content-Type: application/json' \\\\\n -d '{\"prompt\": \"Hi\", \"version\": 1, \"set_as_default\": true}'\n\n### Parameters:\n- request: The incoming HTTP request (used by middleware).\n- prompt_id: The Llama Stack prompt identifier.\n- auth: Authentication tuple from the auth dependency (used by middleware).\n- body: Prompt update parameters.\n\n### Raises:\n- HTTPException: If configuration is not loaded, if the prompt is not\n found, if unable to connect to Llama Stack, or if the prompts API returns\n an error response.\n\n### Returns:\n- PromptResourceResponse: The updated prompt object returned by Llama Stack.",
"description": "Handle requests to the PUT /prompts/{prompt_id} endpoint.\n\nProcess requests to update a stored prompt; Llama Stack increments the\nversion. The body includes the new text, the current version being\nreplaced, and optional fields such as ``set_as_default`` and ``variables``.\nFor example:\n\n curl -X PUT http://localhost:8080/v1/prompts/pmpt_abc123 \\\\\n -H 'Content-Type: application/json' \\\\\n -d '{\"prompt\": \"Hi\", \"version\": 1, \"set_as_default\": true}'\n\n### Parameters:\n- request: The incoming HTTP request (used by middleware).\n- prompt_id: The Llama Stack prompt identifier.\n- auth: Authentication tuple from the auth dependency (used by middleware).\n- body: Prompt update parameters.\n\n### Raises:\n- HTTPException: with status 400 when request format is not valid.\n- HTTPException: with status 401 for unauthorized access.\n- HTTPException: with status 403 if permission is denied.\n- HTTPException: with status 404 if prompt is not found.\n- HTTPException: with status 422 if request payload is corrupted.\n- HTTPException: with status 500 and a detail object containing `response`\n and `cause` when service configuration is wrong or incomplete.\n- HTTPException: with status 503 and a detail object containing `response`\n and `cause` when unable to connect to Llama Stack.\n\n### Returns:\n- PromptResourceResponse: The updated prompt object returned by Llama Stack.",
"operationId": "update_prompt_handler_v1_prompts__prompt_id__put",

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.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

OpenAPI schema is out of date and fails CI validation.

The pipeline has flagged that docs/openapi.json does not match the schema generated by the build process. The diff command shows a mismatch against /tmp/openapi-generated.json. OpenAPI JSON files should be auto-generated from source docstrings rather than manually edited.

You must regenerate the OpenAPI schema using the provided script before this PR can merge.

Regenerate the OpenAPI schema:

uv run scripts/generate_openapi_schema.py docs/openapi.json

Ensure the Python docstrings in src/app/endpoints/prompts.py and src/app/endpoints/rags.py match the description updates shown in these hunks, then commit the regenerated docs/openapi.json.

Also applies to: 2980-2984, 3211-3214, 3384-3387

🤖 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 `@docs/openapi.json` around lines 2728 - 2732, The docs/openapi.json file is
out of date and must be regenerated from source code rather than manually
edited. First, verify that the Python docstrings in src/app/endpoints/prompts.py
and src/app/endpoints/rags.py contain the description updates matching the hunks
shown (specifically for the update_prompt_handler and any related RAG
endpoints). Then run the provided script to regenerate the OpenAPI schema, which
will update docs/openapi.json to match the current docstrings. Finally, commit
the regenerated openapi.json file.

Source: Pipeline failures

Comment thread docs/openapi.md
Comment on lines +5471 to +5481
### Parameters:
- auth: Authentication tuple from the auth dependency (used by middleware).

### Raises:
- HTTPException: with status 500 and a detail object containing `response`
and `cause` when service configuration is wrong or incomplete.
- HTTPException: with status 503 and a detail object containing `response`
and `cause` when unable to connect to Llama Stack.

### Returns:
- AgentCard: The agent card describing this agent's capabilities.

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add blank lines around these headings.

These blocks hit the markdownlint MD022 warning, and the current layout can render inconsistently in Markdown viewers.

🛠️ Suggested fix
-This endpoint provides the agent card that describes Lightspeed's
-capabilities according to the A2A protocol specification.
-### Parameters:
+This endpoint provides the agent card that describes Lightspeed's
+capabilities according to the A2A protocol specification.
+
+### Parameters:
+
 - auth: Authentication tuple from the auth dependency (used by middleware).

Also applies to: 5502-5512, 5596-5603

🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 5471-5471: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 5474-5474: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 5480-5480: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)

🤖 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 `@docs/openapi.md` around lines 5471 - 5481, The markdown headings (###
Parameters:, ### Raises:, ### Returns:) are missing blank lines before and after
them, which violates the markdownlint MD022 rule and causes rendering
inconsistencies. Add a blank line before each of these headings and after the
final line of each section to properly space them. This should be applied at the
three locations mentioned: around lines 5471-5481 for the first set of headings,
around lines 5502-5512 for the second set, and around lines 5596-5603 for the
third set.

Source: Linters/SAST tools

Comment on lines 360 to +367
### Raises:
- HTTPException: If configuration is not loaded, if unable to connect to
Llama Stack, or if the prompts API returns an error response.
- HTTPException: with status 401 for unauthorized access.
- HTTPException: with status 403 if permission is denied.
- HTTPException: with status 422 if request payload is corrupted.
- HTTPException: with status 500 and a detail object containing `response`
and `cause` when service configuration is wrong or incomplete.
- HTTPException: with status 503 and a detail object containing `response`
and `cause` when unable to connect to Llama Stack.

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Missing HTTP 400 status code in delete_prompt_handler docstring.

The Raises section omits status 400, but the implementation at line 378–381 raises HTTPException with BadRequestResponse (status 400) when check_suid_prompt(prompt_id) fails. Additionally, the response dict prompt_delete_responses (lines 85–94) explicitly includes a 400 response definition, and the decorator @router.delete(..., responses=prompt_delete_responses) at line 336 registers it with FastAPI.

The docstring should document all status codes that the endpoint can return, including 400 for invalid prompt ID format.

📋 Proposed docstring update
     ### Raises:
+    - HTTPException: with status 400 when request format is not valid.
     - HTTPException: with status 401 for unauthorized access.
     - HTTPException: with status 403 if permission is denied.
     - HTTPException: with status 422 if request payload is corrupted.
🤖 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/app/endpoints/prompts.py` around lines 360 - 367, Add HTTPException with
status 400 to the Raises section in the docstring of the delete_prompt_handler
function to document that a 400 response is returned when
check_suid_prompt(prompt_id) fails, indicating an invalid prompt ID format. This
status code is already implemented in the function logic and registered in the
prompt_delete_responses dict, so the docstring must be updated to reflect all
possible HTTP responses the endpoint can return.

Comment thread src/app/endpoints/rags.py
Comment on lines +150 to +166
### Parameters:
- request: The incoming HTTP request (used by middleware).
- rag_id: rag_id or llama-stack vector_store_id
- auth: Authentication tuple from the auth dependency (used by middleware).

### Raises:
- HTTPException: with status 401 for unauthorized access.
- HTTPException: with status 403 if permission is denied.
- HTTPException: with status 404 if rag_id is not found.
- HTTPException: with status 422 for incorrect request payload.
- HTTPException: with status 500 and a detail object containing `response`
and `cause` when service configuration is wrong or incomplete.
- HTTPException: with status 503 and a detail object containing `response`
and `cause` when unable to connect to Llama Stack.

### Returns:
- RAGInfoResponse: A single RAG's details.

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Remove the 422 claim from this GET handler.

This endpoint has no request body, and the code path shown here only maps to 404/503. Keeping 422 here makes the generated contract misleading.

✏️ Suggested fix
-    - HTTPException: with status 422 for incorrect request payload.
📝 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
### Parameters:
- request: The incoming HTTP request (used by middleware).
- rag_id: rag_id or llama-stack vector_store_id
- auth: Authentication tuple from the auth dependency (used by middleware).
### Raises:
- HTTPException: with status 401 for unauthorized access.
- HTTPException: with status 403 if permission is denied.
- HTTPException: with status 404 if rag_id is not found.
- HTTPException: with status 422 for incorrect request payload.
- HTTPException: with status 500 and a detail object containing `response`
and `cause` when service configuration is wrong or incomplete.
- HTTPException: with status 503 and a detail object containing `response`
and `cause` when unable to connect to Llama Stack.
### Returns:
- RAGInfoResponse: A single RAG's details.
### Parameters:
- request: The incoming HTTP request (used by middleware).
- rag_id: rag_id or llama-stack vector_store_id
- auth: Authentication tuple from the auth dependency (used by middleware).
### Raises:
- HTTPException: with status 401 for unauthorized access.
- HTTPException: with status 403 if permission is denied.
- HTTPException: with status 404 if rag_id is not found.
- HTTPException: with status 500 and a detail object containing `response`
and `cause` when service configuration is wrong or incomplete.
- HTTPException: with status 503 and a detail object containing `response`
and `cause` when unable to connect to Llama Stack.
### Returns:
- RAGInfoResponse: A single RAG's details.
🤖 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/app/endpoints/rags.py` around lines 150 - 166, The docstring for this GET
handler incorrectly claims it can raise an HTTPException with status 422 for
incorrect request payload. Since GET requests have no request body, this status
code is impossible to return from this endpoint. Remove the entire line
mentioning HTTPException with status 422 for incorrect request payload from the
Raises section of the docstring, keeping only the status codes that are actually
possible: 401, 403, 404, 500, and 503.

@tisnik tisnik merged commit db05802 into lightspeed-core:main Jun 18, 2026
32 of 33 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.

1 participant