Skip to content

docs: fix 'should be pass' -> 'should be passed' across endpoints + openapi#1576

Merged
tisnik merged 1 commit into
lightspeed-core:mainfrom
MukundaKatta:docs/fix-should-be-pass
Apr 23, 2026
Merged

docs: fix 'should be pass' -> 'should be passed' across endpoints + openapi#1576
tisnik merged 1 commit into
lightspeed-core:mainfrom
MukundaKatta:docs/fix-should-be-pass

Conversation

@MukundaKatta
Copy link
Copy Markdown
Contributor

@MukundaKatta MukundaKatta commented Apr 22, 2026

Fixes #1492.

The mcp_headers / body docstring 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 — docstring
  • src/app/endpoints/mcp_servers.py — docstring
  • docs/openapi.json — generated schema copy
  • docs/openapi.md — generated docs copy
- Headers that should be pass to MCP servers.
+ Headers that should be passed to MCP servers.

Applied all three remaining occurrences in the source docstrings plus the 4 in the generated docs/openapi.md and 3 in docs/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

  • Documentation
    • Improved grammar and consistency in API endpoint documentation by correcting parameter descriptions across multiple endpoints, enhancing clarity of usage guidance for developers.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 22, 2026

Walkthrough

This 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

Cohort / File(s) Summary
OpenAPI Documentation
docs/openapi.json, docs/openapi.md
Grammar correction in parameter descriptions for three endpoints (/v1/mcp-auth/client-options, /v1/mcp-servers, /v1/query, /v1/streaming_query): changed "should be pass" to "should be passed" in mcp_headers and body parameter documentation.
Endpoint Docstrings
src/app/endpoints/mcp_auth.py, src/app/endpoints/mcp_servers.py, src/app/endpoints/query.py
Grammar corrections in function docstrings: updated parameter descriptions from "should be pass" to "should be passed" for consistency with OpenAPI documentation.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: fixing a grammar error ('should be pass' to 'should be passed') across documentation and endpoints.
Linked Issues check ✅ Passed The PR fully addresses issue #1492 by correcting the grammar error across all specified files and endpoints (openapi.json, openapi.md, and three source docstrings).
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the documented grammar error; no unrelated modifications were introduced.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ 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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4b84964 and 38b7303.

📒 Files selected for processing (5)
  • docs/openapi.json
  • docs/openapi.md
  • src/app/endpoints/mcp_auth.py
  • src/app/endpoints/mcp_servers.py
  • src/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
Check constants.py for shared constants before defining new ones
All modules start with descriptive docstrings explaining purpose
Use logger = get_logger(__name__) from log.py for 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
Use typing_extensions.Self for model validators in Pydantic models
Use modern union type syntax str | int instead of Union[str, int]
Use Optional[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
Use async def for I/O operations and external API calls
Handle APIConnectionError from 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 @abstractmethod decorators
Use @model_validator and @field_validator for Pydantic model validation
Complete type annotations for all class attributes; use specific types, not Any
Follow Google Python docstring conventions with Parameters, Returns, Raises, and Attributes sections

Files:

  • src/app/endpoints/mcp_auth.py
  • src/app/endpoints/mcp_servers.py
  • src/app/endpoints/query.py
src/app/endpoints/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Use FastAPI HTTPException with appropriate status codes for API endpoints

Files:

  • src/app/endpoints/mcp_auth.py
  • src/app/endpoints/mcp_servers.py
  • src/app/endpoints/query.py
src/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Pydantic models extend ConfigurationBase for config, BaseModel for data models

Files:

  • src/app/endpoints/mcp_auth.py
  • src/app/endpoints/mcp_servers.py
  • src/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.py
  • src/app/endpoints/mcp_servers.py
  • src/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 from src/app/endpoints/mcp_auth.py docstring 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_headers phrasing aligned across endpoints and generated OpenAPI text.

Comment on lines 56 to 60
### 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.

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

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.

Suggested change
### 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.

Copy link
Copy Markdown
Contributor

@tisnik tisnik left a comment

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 1cee13d into lightspeed-core:main Apr 23, 2026
25 of 28 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.

Docs: fix grammar 'should be pass' -> 'should be passed' in docs/openapi.json (mcp_headers bullets)

2 participants