From c16491473810a7978ab7ee0f17494af17e057bfa Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 7 May 2026 17:09:13 +0800 Subject: [PATCH] fix: correct sor.R() call pattern - ns dict contains filters+sort - sor.R signature: R(tablename, ns, filters=None) - ns (2nd arg) is a combined dict: filter conditions + sort options - _get_config: user_id filter + sort in single ns dict - _find_relevant_skills: user_id filter + $or/$like in ns dict - list_reasoning_sessions: user_id filter + sort in ns dict - All queries include user_id for multi-user isolation --- harnessed_reasoning/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/harnessed_reasoning/core.py b/harnessed_reasoning/core.py index 7093feb..40df9e7 100644 --- a/harnessed_reasoning/core.py +++ b/harnessed_reasoning/core.py @@ -130,7 +130,7 @@ class HermesReasoningEngine: where = {} if user_id: where['user_id'] = user_id - rows = await sor.R('harnessed_reasoning_config', where if where else None, ns={'sort': 'updated_at desc'}) + rows = await sor.R('harnessed_reasoning_config', {'user_id': user_id, 'sort': 'updated_at desc'} if user_id else {'sort': 'updated_at desc'}) if rows: return rows[0] except Exception as e: @@ -690,7 +690,7 @@ class HermesReasoningEngine: try: async with self.db.sqlorContext('default') as sor: - rows = await sor.R('harnessed_reasoning_sessions', {'user_id': user_id}, ns={'sort': 'created_at desc'}) + rows = await sor.R('harnessed_reasoning_sessions', {'user_id': user_id, 'sort': 'created_at desc'}) rows = rows or [] rows = rows[offset:offset + limit]