31 Commits

Author SHA1 Message Date
fd8930ef43 fix: wss URL添加/wss前缀
- WebSocket widget ws_url: /wss/harnessed_reasoning/reasoning_console.wss
- HTML中硬编码的JS connect() URL同步添加/wss前缀
nginx将/wss前缀路由到.wss处理器,URL必须包含此前缀
2026-05-13 14:45:06 +08:00
89e099ee12 feat: 实现推理过程实时可视化(WebSocket事件推送)
- 新增 per-user WebSocket 回调机制,支持多用户并发推理会话
- 在每个推理阶段推送实时事件:context/plan/safety/execution/tool_call
- reasoning_console.wss 使用 ws_push_callbacks 字典替代共享 ws_push
- 新增 _current_user_id/_current_org_id 追踪用于用户隔离
- _execute_tool 传递 context 参数确保工具执行的用户隔离
- 新增文件技能搜索:扫描用户目录和共享目录的 skills,与DB技能去重
2026-05-13 13:44:09 +08:00
766bd9ecb9 fix: WebSocket连接添加cookie认证,修复ahserver权限校验 2026-05-09 16:16:59 +08:00
3ed94fdf7a fix: wss路径修正,entire_url从../改为./指向模块目录 2026-05-09 16:05:04 +08:00
cf00fce500 refactor: 推理控制台UI改用bricks声明式widgets
- 静态UI改用VBox/HBox/Title2/Text/Input/Button/Scroll原生控件
- Html widget仅保留JS动态渲染逻辑(步骤卡片/状态更新)
- 符合bricks框架声明式UI规范
2026-05-09 15:55:55 +08:00
ea4a9e3bd9 feat: 推理过程可视化 - websocket实时推送推理步骤到前端
- core.py: 注入ws_push回调, 17个推理节点实时推送事件(上下文/规划/工具调用/执行)
- wwwroot/reasoning_console.wss: 新建websocket端点, 支持connect/start_reasoning/ping
- wwwroot/reasoning_console.ui: 重写HTML前端, 时间线式可视化展示推理过程
2026-05-09 15:48:12 +08:00
564084f3c8 fix: ensure user_id is passed in context to harnessed_agent tools 2026-05-08 18:03:44 +08:00
518f174926 fix: replace uuid.uuid4() with getID() from appPublic.uniqueID for all table ID generation 2026-05-08 15:47:22 +08:00
9597cfa7b8 fix: add env.get_module_dbname() for dynamic database lookup 2026-05-08 15:30:32 +08:00
0a270f2c59 fix: DBPools Singleton - manually set db.databases after getting instance 2026-05-08 15:17:19 +08:00
8d233f7dcc fix: DBPools(config.databases) instead of DBPools() for subprocess context 2026-05-08 14:49:18 +08:00
ba59b43268 fix: DBPools() not in __init__, sqlorContext uses module name not default 2026-05-08 11:41:54 +08:00
906c037920 fix: add traceback logging to _store_session for debugging
- Restore datetime objects instead of isoformat strings for db driver handling
- Print full traceback when session storage fails to identify exact error source
2026-05-08 11:26:23 +08:00
dfa350737a fix: parse execute_immediately from frontend boolean/string correctly
- Support 'true', '1', 'yes' for execute_immediately parameter
- Previously 'true' == '1' evaluated to False, blocking execution
- Fix session storage: clean datetime objects before json.dumps
2026-05-08 10:58:54 +08:00
356544853a fix: debug reasoning execution flow and fix JSON serialization
- Add debug log for execute_immediately, violations, steps_count
- Fix JSON serialization in _store_session using default=str
- Plan object might contain non-serializable types (e.g. datetime)
2026-05-07 18:45:25 +08:00
f9dac4ce7f fix: add user_id parameter to reason_and_execute method
- The method signature was missing user_id, causing TypeError when passed from hermes_reason_and_execute
2026-05-07 18:08:14 +08:00
9ac531bdf0 fix: pass user_id from .dspy to reasoning engine, remove hardcoded model
- reasoning_submit.dspy: pass user_id from await get_user() to hermes_reason_and_execute
- hermes_reason_and_execute: accept user_id parameter
- reason_and_execute: accept user_id parameter (removed ServerEnv.get_current_user fallback)
- _llm_call: remove hardcoded model=qwen3-max, let llm_chat use default_model from harnessed_agent_config
2026-05-07 18:02:33 +08:00
c164914738 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
2026-05-07 17:09:13 +08:00
a00465305a chore: remove accidental .swp file 2026-05-07 16:39:36 +08:00
7f60b0a79b fix: multi-user isolation and sqlor-compatible queries
- Replace all sor.sqlExe(ORDER BY/LIMIT) with sor.R(ns={sort:...}) pattern
- _get_config: add user_id parameter and filter
- _find_relevant_skills: use sor.R with $or and $like filters
- list_reasoning_sessions: use sor.R with ns sort and Python slicing
- All queries now include user_id filter for multi-user isolation
2026-05-07 16:39:19 +08:00
bb420a6471 fix: replace invalid sor.R(orderby/limit) calls with sqlExe
- Config lookup uses raw SQL for ordering
- Skill search uses raw SQL for  and limit
- Session listing uses raw SQL for order/limit/offset
2026-05-07 15:32:59 +08:00
c36477c9cb fix: improve LLM call error handling and plan parsing
- Add detailed logging to _llm_call method
- Improve _parse_plan_json to handle more LLM response formats
- Show LLM error messages in reasoning_submit.dspy
- Better error handling and fallback for JSON parsing
2026-05-07 14:51:44 +08:00
8108e86ab5 refactor: replace mock reasoning with real LLM-based engine
- Rewrite core.py: all mock implementations replaced with real calls
  * _generate_plan() uses llm_chat from harnessed_agent for LLM-based planning
  * _execute_tool() calls harnessed_execute_tool for real tool execution
  * _get_memory_context() calls harnessed_get_intelligent_memory_context
  * _safety_check() with configurable strict/moderate/lenient modes
  * _try_recovery() for auto-recovery on common failures
  * All session persistence uses real database operations

- Fix reasoning_console.ui: uitype 'textarea' -> 'text' per bricks spec
- Add .gitignore

The reasoning module now:
1. Calls LLM to analyze user request and generate execution plan
2. Safety-checks the plan before execution
3. Executes tools via harnessed_agent's tool system
4. Recovers from common errors automatically
5. Stores session history in database
2026-05-07 12:15:23 +08:00
e91a5554f6 fix: add length/dec attributes to float/decimal fields in model definitions 2026-05-07 10:39:27 +08:00
3dfd935dfe 添加推理交互和模型配置:创建推理控制台UI和API,扩展config模型添加LLM模型字段(model_name/provider/api_key/temperature等) 2026-05-06 15:05:28 +08:00
4882ba0290 重构前端:添加TabPanel正确语法,创建sessions和config CRUD页面及API 2026-05-06 12:58:21 +08:00
216c21466f feat: add menu.ui with reasoning sessions, config and console menu items 2026-05-05 21:56:12 +08:00
cb89a25b27 feat: add config functions, init module, config model and skill documentation
- Add config_functions.py for reasoning configuration
- Add init.py initialization module
- Add harnessed_reasoning_config model definition
- Add skill documentation (SKILL.md with assets, references, scripts)
- Add ios_design.css frontend styles
2026-05-04 11:56:43 +08:00
eb28ba57b9 add design style 2026-05-04 10:09:44 +08:00
09fff13dd9 bugfix 2026-04-16 16:27:27 +08:00
cca0434d7c bugfix 2026-04-16 15:42:41 +08:00