docs: fix 'should be pass' -> 'should be passed' across endpoints + openapi#1576
Conversation
WalkthroughThis PR corrects a grammar error in API documentation across multiple files, changing "Headers that should be pass to MCP servers" to "Headers that should be passed to MCP servers" in OpenAPI documentation and endpoint docstrings. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/app/endpoints/mcp_auth.py`:
- Around line 56-60: The docstring for get_mcp_client_auth_options incorrectly
lists a non-existent parameter mcp_headers; update the docstring in
get_mcp_client_auth_options to remove the mcp_headers entry (or, if intended,
add mcp_headers to the function signature and handle it) so the listed
Parameters match the actual function signature, ensuring references to request
and auth remain accurate.
🪄 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: 008b1007-5a96-4729-946f-4b56d33b68c1
📒 Files selected for processing (5)
docs/openapi.jsondocs/openapi.mdsrc/app/endpoints/mcp_auth.pysrc/app/endpoints/mcp_servers.pysrc/app/endpoints/query.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). (7)
- GitHub Check: E2E: server mode / ci / group 3
- GitHub Check: E2E: library mode / ci / group 2
- GitHub Check: E2E: server mode / ci / group 1
- GitHub Check: E2E: library mode / ci / group 3
- GitHub Check: E2E: library mode / ci / group 1
- GitHub Check: E2E: server mode / ci / group 2
- GitHub Check: E2E Tests for Lightspeed Evaluation job
🧰 Additional context used
📓 Path-based instructions (3)
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
**/*.py: Use absolute imports for internal modules:from authentication import get_auth_dependency
Import FastAPI dependencies with:from fastapi import APIRouter, HTTPException, Request, status, Depends
Import Llama Stack client with:from llama_stack_client import AsyncLlamaStackClient
Checkconstants.pyfor shared constants before defining new ones
All modules start with descriptive docstrings explaining purpose
Uselogger = get_logger(__name__)fromlog.pyfor module logging
Type aliases defined at module level for clarity
Use Final[type] as type hint for all constants
All functions require docstrings with brief descriptions
Complete type annotations for parameters and return types in functions
Usetyping_extensions.Selffor model validators in Pydantic models
Use modern union type syntaxstr | intinstead ofUnion[str, int]
UseOptional[Type]for optional type hints
Use snake_case with descriptive, action-oriented function names (get_, validate_, check_)
Avoid in-place parameter modification anti-patterns; return new data structures instead
Useasync deffor I/O operations and external API calls
HandleAPIConnectionErrorfrom Llama Stack in error handling
Use standard log levels with clear purposes: debug, info, warning, error
All classes require descriptive docstrings explaining purpose
Use PascalCase for class names with standard suffixes: Configuration, Error/Exception, Resolver, Interface
Use ABC for abstract base classes with@abstractmethoddecorators
Use@model_validatorand@field_validatorfor Pydantic model validation
Complete type annotations for all class attributes; use specific types, notAny
Follow Google Python docstring conventions with Parameters, Returns, Raises, and Attributes sections
Files:
src/app/endpoints/mcp_auth.pysrc/app/endpoints/mcp_servers.pysrc/app/endpoints/query.py
src/app/endpoints/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
Use FastAPI
HTTPExceptionwith appropriate status codes for API endpoints
Files:
src/app/endpoints/mcp_auth.pysrc/app/endpoints/mcp_servers.pysrc/app/endpoints/query.py
src/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
Pydantic models extend
ConfigurationBasefor config,BaseModelfor data models
Files:
src/app/endpoints/mcp_auth.pysrc/app/endpoints/mcp_servers.pysrc/app/endpoints/query.py
🧠 Learnings (3)
📚 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/mcp_auth.pysrc/app/endpoints/mcp_servers.pysrc/app/endpoints/query.py
📚 Learning: 2026-04-16T19:08:38.217Z
Learnt from: Lifto
Repo: lightspeed-core/lightspeed-stack PR: 1524
File: src/app/endpoints/responses.py:523-529
Timestamp: 2026-04-16T19:08:38.217Z
Learning: In lightspeed-stack (`src/app/endpoints/responses.py`), the predicate `server_label in configured_mcp_labels` is the established, intentional pattern for identifying server-deployed MCP tools across `_sanitize_response_dict`, `_is_server_mcp_output_item`, and `_should_filter_mcp_chunk`. Client-supplied tools cannot collide with configured server labels because `server_label` is a server-side field set by lightspeed-stack during tool injection; clients send `function` tools or MCP tools pointing at their own servers with different labels. Do not flag this predicate as a false-positive collision risk in code review.
Applied to files:
src/app/endpoints/mcp_servers.py
📚 Learning: 2026-01-14T09:37:51.612Z
Learnt from: asimurka
Repo: lightspeed-core/lightspeed-stack PR: 988
File: src/app/endpoints/query.py:319-339
Timestamp: 2026-01-14T09:37:51.612Z
Learning: In the lightspeed-stack repository, when provider_id == "azure", the Azure provider with provider_type "remote::azure" is guaranteed to be present in the providers list. Therefore, avoid defensive StopIteration handling for next() when locating the Azure provider in providers within src/app/endpoints/query.py. This change applies specifically to this file (or nearby provider lookup code) and relies on the invariant that the Azure provider exists; if the invariant could be violated, keep the existing StopIteration handling.
Applied to files:
src/app/endpoints/query.py
🔇 Additional comments (7)
docs/openapi.md (2)
452-452: Downstream generated-doc issue; tracked at source docstring.
This mismatch comes fromsrc/app/endpoints/mcp_auth.pydocstring and is already flagged there.
601-601: Grammar corrections are accurate in generated docs.Also applies to: 1976-1976, 2259-2259
src/app/endpoints/mcp_servers.py (1)
66-66: Grammar fix is correct and improves API docs clarity.
No functional concerns in this change.src/app/endpoints/query.py (1)
116-116: Looks good — wording correction is accurate and consistent.docs/openapi.json (3)
725-725: Grammar fix is correct and clear.This description update is accurate and improves readability without changing API behavior.
1072-1072: Approved: wording correction matches intended phrasing.The updated sentence is grammatically correct and consistent with the other endpoint descriptions.
5489-5489: Looks good — consistent grammar fix applied here as well.This keeps
mcp_headersphrasing aligned across endpoints and generated OpenAPI text.
| ### Parameters: | ||
| - request: The incoming HTTP request (used by middleware). | ||
| - auth: Authentication tuple from the auth dependency (used by middleware). | ||
| - mcp_headers: Headers that should be pass to MCP servers. | ||
| - mcp_headers: Headers that should be passed to MCP servers. | ||
|
|
There was a problem hiding this comment.
Docstring lists a parameter that the function does not accept.
get_mcp_client_auth_options has no mcp_headers parameter, so this line makes the generated API docs inaccurate.
✏️ Proposed fix
### Parameters:
- request: The incoming HTTP request (used by middleware).
- auth: Authentication tuple from the auth dependency (used by middleware).
- - mcp_headers: Headers that should be passed to MCP servers.📝 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.
| ### Parameters: | |
| - request: The incoming HTTP request (used by middleware). | |
| - auth: Authentication tuple from the auth dependency (used by middleware). | |
| - mcp_headers: Headers that should be pass to MCP servers. | |
| - mcp_headers: Headers that should be passed to MCP servers. | |
| ### Parameters: | |
| - request: The incoming HTTP request (used by middleware). | |
| - auth: Authentication tuple from the auth dependency (used by middleware). |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/app/endpoints/mcp_auth.py` around lines 56 - 60, The docstring for
get_mcp_client_auth_options incorrectly lists a non-existent parameter
mcp_headers; update the docstring in get_mcp_client_auth_options to remove the
mcp_headers entry (or, if intended, add mcp_headers to the function signature
and handle it) so the listed Parameters match the actual function signature,
ensuring references to request and auth remain accurate.
Fixes #1492.
The
mcp_headers/bodydocstring on multiple MCP endpoints read "Headers that should be pass to MCP servers" (missing 'ed'). Followed the issue's scope:src/app/endpoints/query.py— docstring (source of truth)src/app/endpoints/mcp_auth.py— docstringsrc/app/endpoints/mcp_servers.py— docstringdocs/openapi.json— generated schema copydocs/openapi.md— generated docs copyApplied all three remaining occurrences in the source docstrings plus the 4 in the generated
docs/openapi.mdand 3 indocs/openapi.json. If the generated docs are produced by a regenerator script, regenerating from the fixed source will produce the same result.Summary by CodeRabbit