Merged
Conversation
Comment on lines
+63
to
+65
| total = d.pop("total") | ||
| offset = d.pop("offset") | ||
| limit = d.pop("limit") |
There was a problem hiding this comment.
Bug: The from_dict method uses d.pop() for new pagination fields, which will raise a KeyError if the API response is from an older backend version, causing a crash.
Severity: CRITICAL
Suggested Fix
Replace d.pop("key") with d.get("key", default_value) for the total, offset, and limit fields to provide graceful degradation and maintain backwards-compatibility with older API responses that do not include these fields. This prevents KeyError crashes.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: src/everyrow/generated/models/session_list_response.py#L63-L65
Potential issue: The `SessionListResponse.from_dict()` method uses `d.pop()` to extract
the `total`, `offset`, and `limit` fields from the API response. If the SDK is deployed
before the backend API is updated to include these new pagination fields, or if it
receives a response from an older, cached, or partially-deployed backend, the call will
fail with a `KeyError`. This breaks backwards-compatibility and will cause a runtime
crash when calling the `list_sessions()` endpoint.
Did we get this right? 👍 / 👎 to inform future reviews.
40d4e47 to
4c241e3
Compare
Add offset/limit pagination support: - SDK: new SessionListResult with total/offset/limit fields - Generated API: offset/limit query params on list_sessions endpoint - MCP server: ListSessionsInput model, pagination display in output - Tests: updated and new pagination tests for SDK and MCP Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4c241e3 to
d8de3bb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SessionListResultdataclass withtotal/offset/limitfieldsoffset/limitquery params onlist_sessionsendpointListSessionsInputmodel for pagination params, output shows page infooffset: int = 0, limit: int = 25defaultsTest plan
uv run pytest tests/test_session.py)uv run pytest everyrow-mcp/tests/test_server.py)🤖 Generated with Claude Code