diff --git a/apps/lib/app/app.dart b/apps/lib/app/app.dart index 03dc486..7cc1156 100644 --- a/apps/lib/app/app.dart +++ b/apps/lib/app/app.dart @@ -300,7 +300,11 @@ class _EryaoAppState extends State { if (!mounted) { return; } + final serverLanguage = profile.preferences.interfaceLanguage; + final serverLocale = localeFromLanguageTag(serverLanguage); + await _sessionStore.saveLocaleTag(serverLanguage); setState(() { + _locale = serverLocale; _profileSettings = profile; _loadedProfileUserEmail = userEmail; }); diff --git a/backend/src/core/agentscope/runtime/runner.py b/backend/src/core/agentscope/runtime/runner.py index af65c96..a39e960 100644 --- a/backend/src/core/agentscope/runtime/runner.py +++ b/backend/src/core/agentscope/runtime/runner.py @@ -324,8 +324,7 @@ class AgentScopeRunner: if derived_divination is not None: user_text = build_divination_user_prompt(derived=derived_divination) else: - _, latest_user_text = extract_latest_user_payload(run_input) - user_text = latest_user_text + user_text, _ = extract_latest_user_payload(run_input) if derived_divination is not None and context_messages: last = context_messages[-1] @@ -342,17 +341,7 @@ class AgentScopeRunner: if last.role == "user": return context_messages - user_blocks = [{"type": "text", "text": user_text}] - if ( - user_blocks - and isinstance(user_blocks[0], dict) - and user_blocks[0].get("type") == "text" - ): - content: Any = user_text - else: - content = user_blocks - - user_msg = Msg(name="user", role="user", content=content) + user_msg = Msg(name="user", role="user", content=user_text) return [*context_messages, user_msg] @staticmethod diff --git a/backend/src/v1/users/repository.py b/backend/src/v1/users/repository.py index 61a1a36..0ab7df1 100644 --- a/backend/src/v1/users/repository.py +++ b/backend/src/v1/users/repository.py @@ -41,7 +41,7 @@ class SQLAlchemyUserRepository: async def delete_invite_codes_by_owner_id(self, *, user_id: UUID) -> int: stmt = delete(InviteCode).where(InviteCode.owner_id == user_id) result = await self.session.execute(stmt) - return int(result.rowcount or 0) + return result.rowcount # pyright: ignore[reportAttributeAccessIssue] async def delete_points_audit_snapshots( self, @@ -61,4 +61,4 @@ class SQLAlchemyUserRepository: PointsAuditLedger.user_id_snapshot == user_id ) result = await self.session.execute(stmt) - return int(result.rowcount or 0) + return result.rowcount # pyright: ignore[reportAttributeAccessIssue]