Repository navigation
refactor(models): remove legacy db.session properties from Conversation - #41847
Merged
asukaminato0721 merged 1 commit intoSep 7, 2026
Conversation
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-09-05 10:30:55.930331003 +0000
+++ /tmp/pyrefly_pr.txt 2026-09-05 10:30:47.398343503 +0000
@@ -8075,7 +8075,7 @@
ERROR Argument `dict[str, bool]` is not assignable to parameter `annotation_reply` with type `AnnotationReplyDisabledConfig | AnnotationReplyEnabledConfig | None` in function `models.model.AppModelConfig.to_dict` [bad-argument-type]
--> tests/unit_tests/models/test_app_models.py:398:54
ERROR Object of class `FromClause` has no attribute `insert` [missing-attribute]
- --> tests/unit_tests/models/test_app_models.py:1132:13
+ --> tests/unit_tests/models/test_app_models.py:1133:13
ERROR `None` is not subscriptable [unsupported-operation]
--> tests/unit_tests/models/test_dataset_models.py:331:16
ERROR `None` is not subscriptable [unsupported-operation]
|
Contributor
Pyrefly Type Coverage
|
asukaminato0721
approved these changes
Sep 7, 2026
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
Part of #40372, following the established model cleanup pattern from #40370, #41569, and #41721.
Removes ten legacy @Property accessors on Conversation in api/models/model.py that implicitly reach for the global db.session():
All production response reads already go through ConversationResponseSource and the existing *_with_session methods. The direct model and container-test reads were updated to pass the caller-owned session explicitly.
This intentionally leaves inputs, model_config, and app untouched because they still have active property consumers or setter behavior and require a separate migration.
Claimed this slice in #40372 (comment).
Tests
Screenshots
N/A (backend-only refactor).
Checklist