fix:修复一些bug

pull/1294/head
SengokuCola 2025-10-08 19:39:54 +08:00
parent 40fb50249f
commit f88b479afa
3 changed files with 5 additions and 2 deletions

View File

@ -335,6 +335,7 @@ class HeartFChatting:
await global_memory_chest.build_running_content(chat_id=self.stream_id)
cycle_timers, thinking_id = self.start_cycle()
logger.info(f"{self.log_prefix} 开始第{self._cycle_counter}次思考")

View File

@ -501,6 +501,7 @@ class ActionPlanner:
]
# 解析LLM响应
extracted_reasoning = ""
if llm_content:
try:
json_objects, extracted_reasoning = self._extract_json_from_markdown(llm_content)
@ -512,13 +513,16 @@ class ActionPlanner:
else:
# 尝试解析为直接的JSON
logger.warning(f"{self.log_prefix}LLM没有返回可用动作: {llm_content}")
extracted_reasoning = "LLM没有返回可用动作"
actions = self._create_no_reply("LLM没有返回可用动作", available_actions)
except Exception as json_e:
logger.warning(f"{self.log_prefix}解析LLM响应JSON失败 {json_e}. LLM原始输出: '{llm_content}'")
extracted_reasoning = f"解析LLM响应JSON失败: {json_e}"
actions = self._create_no_reply(f"解析LLM响应JSON失败: {json_e}", available_actions)
traceback.print_exc()
else:
extracted_reasoning = "规划器没有获得LLM响应"
actions = self._create_no_reply("规划器没有获得LLM响应", available_actions)
# 添加循环开始时间到所有非no_reply动作

View File

@ -15,7 +15,6 @@ from src.mood.mood_manager import mood_manager
from src.chat.knowledge import lpmm_start_up
from src.memory_system.memory_management_task import MemoryManagementTask
from rich.traceback import install
from src.migrate_helper.migrate import check_and_run_migrations
# from src.api.main import start_api_server
# 导入新的插件管理器
@ -104,7 +103,6 @@ class MainSystem:
self.app.register_message_handler(chat_bot.message_process)
self.app.register_custom_message_handler("message_id_echo", chat_bot.echo_message_process)
await check_and_run_migrations()
# 触发 ON_START 事件
from src.plugin_system.core.events_manager import events_manager