Skip to content

Commit 974bb6b

Browse files
committed
feat: improve error messaging for AI execution failures in agent runners
1 parent 2e410fc commit 974bb6b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

astrbot/core/astr_agent_run_util.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,9 @@ async def run_agent(
245245
err_msg = custom_error_message
246246
else:
247247
err_msg = (
248-
f"\n\nAstrBot 请求失败。\n错误类型: {type(e).__name__}\n错误信息: "
249-
f"{e!s}\n\n请在平台日志查看和分享错误详情。\n"
248+
f"Error occurred during AI execution.\n"
249+
f"Error Type: {type(e).__name__}\n"
250+
f"Error Message: {str(e)}"
250251
)
251252

252253
error_llm_response = LLMResponse(

astrbot/core/pipeline/process_stage/method/agent_sub_stages/third_party.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ async def run_third_party_agent(
6464
err_msg = custom_error_message
6565
if not err_msg:
6666
err_msg = (
67-
f"\nAstrBot 请求失败。\n错误类型: {type(e).__name__}\n"
68-
f"错误信息: {e!s}\n\n请在平台日志查看和分享错误详情。\n"
67+
f"Error occurred during AI execution.\n"
68+
f"Error Type: {type(e).__name__} (3rd party)\n"
69+
f"Error Message: {str(e)}"
6970
)
7071
yield MessageChain().message(err_msg)
7172

0 commit comments

Comments
 (0)