19 Commits

Author SHA1 Message Date
c7b14f17dd fix: update WebSocket connection logic for better session handling
- Modified connect() function to pass session as URL parameter
- Fallback to cookie-based auth if session not available
- Improves compatibility with httponly cookie settings
2026-05-17 00:07:04 +08:00
e21d2c7973 fix: 修复前端状态更新延迟和重试机制
1. 延迟 connect() 500ms 执行,等待 bricks 框架完全初始化
2. updateStatus 增加 200ms 重试逻辑,直到找到对应 widget
3. 解决 WSS 已连接但界面显示'等待连接...'的问题
2026-05-13 16:20:54 +08:00
eda50f8140 fix: 修复WebSocket连接 - 移除错误的cookie参数传递 2026-05-13 14:58:11 +08:00
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
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
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
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
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
cca0434d7c bugfix 2026-04-16 15:42:41 +08:00