refactor(api): migrate console conversation variables response model to BaseModel#35193
Merged
asukaminato0721 merged 2 commits intolanggenius:mainfrom Apr 14, 2026
Conversation
Contributor
Pyrefly DiffNo changes detected. |
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the console conversation variables GET endpoint to replace Flask-RESTX response marshalling/models with Pydantic ResponseModel classes registered via register_schema_models().
Changes:
- Introduces
ConversationVariableResponseandPaginatedConversationVariableResponsePydantic models and registers them for Swagger. - Removes
@marshal_withand inlineconsole_ns.model(...)assembly, returningmodel_dump(mode="json")instead. - Adds unit tests for the conversation variables API response shape and query validation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
api/controllers/console/app/conversation_variables.py |
Migrates response modeling/marshalling to Pydantic ResponseModel + schema registration and returns JSON via model_dump. |
api/tests/unit_tests/controllers/console/app/test_conversation_variables_api.py |
Adds unit tests covering paginated response structure and missing conversation_id validation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
api/tests/unit_tests/controllers/console/app/test_conversation_variables_api.py
Show resolved
Hide resolved
auto-merge was automatically disabled
April 14, 2026 18:15
Head branch was pushed to by a user without write access
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-04-14 18:16:41.177957338 +0000
+++ /tmp/pyrefly_pr.txt 2026-04-14 18:16:30.954838437 +0000
@@ -1,5 +1,7 @@
ERROR Object of class `App` has no attribute `access_mode` [missing-attribute]
--> controllers/console/app/app.py:561:13
+ERROR Object of class `object` has no attribute `value` [missing-attribute]
+ --> controllers/console/app/conversation_variables.py:48:24
ERROR Argument `str | None` is not assignable to parameter `language` with type `str` in function `services.account_service.AccountService.send_email_register_email` [bad-argument-type]
--> controllers/console/auth/email_register.py:75:108
ERROR Object of class `MissingRouter` has no attribute `get` [missing-attribute]
|
asukaminato0721
approved these changes
Apr 14, 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.
Part of #28015
Summary
Extract Flask-RESTX response model usage in
api/controllers/console/app/conversation_variables.pyinto PydanticResponseModelclasses and register them withregister_schema_models(). Remove@marshal_withand inlineconsole_ns.model(...)response model assembly for conversation variable pagination responses.Checklist
make lintandmake type-check(backend) andcd web && pnpm exec vp staged(frontend) to appease the lint gods