Open
Conversation
Contributor
Author
|
🧪 Testing To try out this version of the SDK: Expires at: Sat, 16 May 2026 19:25:59 GMT |
12de47e to
6a3b605
Compare
| summary: Optional[str] = None | ||
| """Summary of the document content""" | ||
|
|
||
| task_type: Literal["memory", "superrag"] = FieldInfo(alias="taskType") |
There was a problem hiding this comment.
Bug: The new task_type field in DocumentGetResponse is required but lacks a default value. API responses for older documents may not include this field, causing validation to fail.
Severity: HIGH
Suggested Fix
To ensure backward compatibility, the task_type field should be made optional. Add a default value, such as default="memory", or change the type to Optional[Literal["memory", "superrag"]] with default=None.
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/supermemory/types/document_get_response.py#L72
Potential issue: The `DocumentGetResponse` model adds a new field `task_type` (aliased
to `taskType`) which is required and has no default value. If the API retrieves a
document that was created before this field was introduced, the API response will not
contain the `taskType` key. This will cause Pydantic to raise a `ValidationError` when
parsing the response, breaking the document retrieval functionality for any older
documents.
Did we get this right? 👍 / 👎 to inform future reviews.
6a3b605 to
4530115
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.
Automated Release PR
3.34.0 (2026-04-17)
Full Changelog: v3.33.1...v3.34.0
Features
This pull request is managed by Stainless's GitHub App.
The semver version number is based on included commit messages. Alternatively, you can manually set the version number in the title of this pull request.
For a better experience, it is recommended to use either rebase-merge or squash-merge when merging this pull request.
🔗 Stainless website
📚 Read the docs
🙋 Reach out for help or questions