Conversation
Contributor
Pyrefly Type Coverage
|
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-08-09 06:55:20.349641290 +0000
+++ /tmp/pyrefly_pr.txt 2026-08-09 06:55:06.872549054 +0000
@@ -1847,81 +1847,81 @@
ERROR No attribute `MethodView` in module `builtins` [missing-attribute]
--> tests/unit_tests/controllers/common/test_fields.py:8:5
ERROR `in` is not supported between `Literal['Incorrect API key provided']` and `None` [not-iterable]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1625:12
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1489:12
ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `controllers.console.app.completion._create_build_chat_finalization_message` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1698:26
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1562:26
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.completion._create_build_chat_finalization_message` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1699:23
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1563:23
ERROR Argument `test_drain_streaming_generate_response_returns_on_message_end.ClosableResponse` is not assignable to parameter `response` with type `Generator[str] | RateLimitGenerator` in function `controllers.console.app.completion._drain_streaming_generate_response` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1747:69
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1611:69
ERROR Argument `Iterator[Any]` is not assignable to parameter `response` with type `Generator[str] | RateLimitGenerator` in function `controllers.console.app.completion._drain_streaming_generate_response` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1754:66
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1618:66
ERROR Argument `Iterator[Any]` is not assignable to parameter `response` with type `Generator[str] | RateLimitGenerator` in function `controllers.console.app.completion._drain_streaming_generate_response` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1760:66
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1624:66
ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `controllers.console.app.completion._create_chat_message` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1820:26
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1684:26
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.completion._create_chat_message` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1820:50
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1684:50
ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `controllers.console.app.completion._create_chat_message` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1868:26
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1732:26
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.completion._create_chat_message` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1869:23
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1733:23
ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `controllers.console.app.completion._create_chat_message` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1917:30
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1781:30
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.completion._create_chat_message` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1918:27
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1782:27
ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `controllers.console.app.completion._resolve_current_user_agent_debug_conversation_id` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1959:22
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1823:22
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.completion._resolve_current_user_agent_debug_conversation_id` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1960:19
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1824:19
ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `controllers.console.app.completion._resolve_current_user_agent_debug_conversation_id` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1968:22
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1832:22
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.completion._resolve_current_user_agent_debug_conversation_id` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1969:19
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1833:19
ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `controllers.console.app.completion._resolve_current_user_agent_debug_conversation_id` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1976:22
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1840:22
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.completion._resolve_current_user_agent_debug_conversation_id` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1977:19
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1841:19
ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `controllers.console.app.completion._resolve_current_user_agent_debug_conversation_id` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1985:22
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1849:22
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.completion._resolve_current_user_agent_debug_conversation_id` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1986:19
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1850:19
ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `controllers.console.app.completion._create_chat_message` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2064:30
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1928:30
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.completion._create_chat_message` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2064:73
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1928:73
ERROR Object of class `object` has no attribute `data` [missing-attribute]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2172:50
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2036:50
ERROR Object of class `object` has no attribute `limit` [missing-attribute]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2173:30
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2037:30
ERROR Object of class `object` has no attribute `has_more` [missing-attribute]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2174:33
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2038:33
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.message._list_chat_messages` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2184:47
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2048:47
ERROR Object of class `object` has no attribute `data` [missing-attribute]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2211:50
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2075:50
ERROR Object of class `object` has no attribute `limit` [missing-attribute]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2212:30
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2076:30
ERROR Object of class `object` has no attribute `has_more` [missing-attribute]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2213:33
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2077:33
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.message._list_chat_messages` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2226:47
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2090:47
ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account | None` in function `controllers.console.app.message._list_chat_messages` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2226:71
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2090:71
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.message._list_chat_messages` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2246:27
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2110:27
ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account | None` in function `controllers.console.app.message._list_chat_messages` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2247:30
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2111:30
ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `controllers.console.app.message._update_message_feedback` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2267:30
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2131:30
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.message._update_message_feedback` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2268:27
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2132:27
ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `controllers.console.app.message._get_message_suggested_questions` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2308:26
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2172:26
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.message._get_message_suggested_questions` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2309:23
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2173:23
ERROR Argument `Literal['00000000-0000-0000-0000-000000000002']` is not assignable to parameter `message_id` with type `UUID` in function `controllers.console.app.message._get_message_suggested_questions` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2310:24
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:2174:24
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.agent_config_inspector._resolve_agent_id` [bad-argument-type]
--> tests/unit_tests/controllers/console/app/test_agent_config_inspector.py:54:51
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.agent_drive_inspector._resolve_agent_id` [bad-argument-type]
@@ -1979,39 +1979,39 @@
ERROR Argument `Connection | Engine` is not assignable to parameter `engine` with type `Engine` in function `_Database.__init__` [bad-argument-type]
--> tests/unit_tests/controllers/console/app/test_workflow_pause_details_api.py:180:26
ERROR Missing argument `app_model` in function `handler` [missing-argument]
- --> tests/unit_tests/controllers/console/app/test_wraps.py:44:19
+ --> tests/unit_tests/controllers/console/app/test_wraps.py:45:19
ERROR Unexpected keyword argument `app_id` in function `handler` [unexpected-keyword]
- --> tests/unit_tests/controllers/console/app/test_wraps.py:44:20
+ --> tests/unit_tests/controllers/console/app/test_wraps.py:45:20
ERROR Missing argument `app_model` in function `handler` [missing-argument]
- --> tests/unit_tests/controllers/console/app/test_wraps.py:57:16
+ --> tests/unit_tests/controllers/console/app/test_wraps.py:58:16
ERROR Unexpected keyword argument `app_id` in function `handler` [unexpected-keyword]
- --> tests/unit_tests/controllers/console/app/test_wraps.py:57:17
+ --> tests/unit_tests/controllers/console/app/test_wraps.py:58:17
ERROR Missing argument `app_model` in function `Handler.get` [missing-argument]
- --> tests/unit_tests/controllers/console/app/test_wraps.py:73:22
+ --> tests/unit_tests/controllers/console/app/test_wraps.py:126:22
ERROR Unexpected keyword argument `app_id` in function `Handler.get` [unexpected-keyword]
- --> tests/unit_tests/controllers/console/app/test_wraps.py:73:39
+ --> tests/unit_tests/controllers/console/app/test_wraps.py:126:39
ERROR Missing argument `app_model` in function `Handler.get` [missing-argument]
- --> tests/unit_tests/controllers/console/app/test_wraps.py:92:25
+ --> tests/unit_tests/controllers/console/app/test_wraps.py:145:25
ERROR Unexpected keyword argument `app_id` in function `Handler.get` [unexpected-keyword]
- --> tests/unit_tests/controllers/console/app/test_wraps.py:92:43
+ --> tests/unit_tests/controllers/console/app/test_wraps.py:145:43
ERROR Missing argument `app_model` in function `Handler.get` [missing-argument]
- --> tests/unit_tests/controllers/console/app/test_wraps.py:111:25
+ --> tests/unit_tests/controllers/console/app/test_wraps.py:164:25
ERROR Unexpected keyword argument `app_id` in function `Handler.get` [unexpected-keyword]
- --> tests/unit_tests/controllers/console/app/test_wraps.py:111:43
+ --> tests/unit_tests/controllers/console/app/test_wraps.py:164:43
ERROR Missing argument `app_model` in function `handler` [missing-argument]
- --> tests/unit_tests/controllers/console/app/test_wraps.py:122:16
+ --> tests/unit_tests/controllers/console/app/test_wraps.py:175:16
ERROR Missing argument `app_model` in function `Handler.get` [missing-argument]
- --> tests/unit_tests/controllers/console/app/test_wraps.py:145:29
+ --> tests/unit_tests/controllers/console/app/test_wraps.py:198:29
ERROR Unexpected keyword argument `app_id` in function `Handler.get` [unexpected-keyword]
- --> tests/unit_tests/controllers/console/app/test_wraps.py:145:46
+ --> tests/unit_tests/controllers/console/app/test_wraps.py:198:46
ERROR Missing argument `app_model` in function `Handler.get` [missing-argument]
- --> tests/unit_tests/controllers/console/app/test_wraps.py:168:25
+ --> tests/unit_tests/controllers/console/app/test_wraps.py:221:25
ERROR Unexpected keyword argument `app_id` in function `Handler.get` [unexpected-keyword]
- --> tests/unit_tests/controllers/console/app/test_wraps.py:168:26
+ --> tests/unit_tests/controllers/console/app/test_wraps.py:221:26
ERROR Missing argument `app_model` in function `handler` [missing-argument]
- --> tests/unit_tests/controllers/console/app/test_wraps.py:177:16
+ --> tests/unit_tests/controllers/console/app/test_wraps.py:230:16
ERROR Unexpected keyword argument `app_id` in function `handler` [unexpected-keyword]
- --> tests/unit_tests/controllers/console/app/test_wraps.py:177:17
+ --> tests/unit_tests/controllers/console/app/test_wraps.py:230:17
ERROR Cannot set item in `OrderedDict[str, bool | list[str] | str]` [unsupported-operation]
--> tests/unit_tests/controllers/console/app/workflow_draft_variables_test.py:137:47
ERROR Argument `() -> Session` is not assignable to parameter `session_factory` with type `sessionmaker[@_]` in function `sqlalchemy.orm.scoping.scoped_session.__init__` [bad-argument-type]
@@ -2075,7 +2075,7 @@
ERROR Argument `Literal['account']` is not assignable to parameter `created_by_role` with type `CreatorUserRole` in function `models.model.UploadFile.__init__` [bad-argument-type]
--> tests/unit_tests/controllers/console/datasets/test_datasets_segments.py:1102:29
ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
- --> tests/unit_tests/controllers/console/explore/test_trial.py:215:5
+ --> tests/unit_tests/controllers/console/explore/test_trial.py:226:5
ERROR Argument `str` is not assignable to parameter `view` with type `(InstalledApp) -> str` in function `controllers.console.explore.wraps.decorator` [bad-argument-type]
--> tests/unit_tests/controllers/console/explore/test_wraps.py:73:18
ERROR Argument `str` is not assignable to parameter `view` with type `(InstalledApp) -> str` in function `controllers.console.explore.wraps.decorator` [bad-argument-type]
|
hjlarry
marked this pull request as ready for review
August 9, 2026 06:55
hjlarry
requested review from
GareArc,
QuantumGhost and
laipz8200
as code owners
August 9, 2026 06:55
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## p486 #40257 +/- ##
=======================================
Coverage ? 86.42%
=======================================
Files ? 5111
Lines ? 290921
Branches ? 57935
=======================================
Hits ? 251422
Misses ? 34552
Partials ? 4947
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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 #39993.
This is PR 3 of the recommended-app controller stack. Its Git base is #40208.
Decouple the remaining recommended-app runtime admission path from the legacy
RecommendedAppService:Appthrough the existing session-awareAppServicegetter while preserving the controller's requestSessionand identity map;RecommendedAppServiceafter its persistence behavior has been migrated;FeatureService.Why this layer
After #40207 extracted recommended-app reads and #40208 extracted trial usage writes,
RecommendedAppServiceonly retained runtime catalog admission and a deployment feature predicate. This PR routes catalog membership through the existing query port and compatibility adapter, then deletes the now-empty legacy service.Catalog membership intentionally preserves the old admission rule: any non-null detail returned by the configured builtin, remote, or database retrieval counts as recommended. The detail payload is not mapped on this path, so malformed but non-null legacy results do not introduce a new admission failure.
Intentional boundaries
This remains a narrow migration rather than the final trial-admission architecture:
get_app_model_with_trialremains a Console controller decorator. Trial-App precedence, mode validation, HTTP error mapping, and ORM injection are unchanged.AppService.get_normal_app_by_id. The getter receives the existing requestSession, preserves the database-sidestatus = 'normal'predicate, and does not return a detached ORM model. A dedicated request-scoped repository belongs with the broader admission/UoW migration.Appload uses the request session. The two reads therefore no longer guarantee the same transaction snapshot. Preserving a strict shared snapshot requires a broader request-scoped admission/UoW refactor.LegacyRecommendedAppCatalogGateway; their provider-specific shapes and fallback behavior are unchanged.current_user,RequestContext, setup admission, routes, response contracts, and trial quota behavior are unchanged.A future admission-focused layer can move the remaining SQL predicates behind a request-scoped query adapter and introduce a focused
TrialAppAdmissionServicewhen there is enough behavior to justify it.Verification
check_no_new_controller_sqlalchemy.pypassed against the p486 base revision.git diff --checkpassed, and noRecommendedAppServicereferences remain.From Codex