Support Anthropic conversation logging and retries
Tests / Test apps.device-host-agent.tests.test_mcp_token.test_load_or_create_concurrent_calls_do_not_corrupt failed

This commit is contained in:
showtan001
2026-08-30 22:29:19 +08:00
parent 44e1a6651a
commit 5458f3b8a4
4 changed files with 113 additions and 14 deletions
+6
View File
@@ -43,6 +43,12 @@ class AIPlanner(Planner):
history_summary=_history_summary(world),
device_platform=context.device_platform,
)
if context.step_results and not context.step_results[-1].success:
user_prompt += (
"\n\nThe previous tool call failed. Diagnose the failure and choose a "
"corrected action or finish the task if it cannot proceed.\n"
f"Previous failure: {context.step_results[-1].error or 'unknown error'}"
)
decision = self.client.decide(
system_prompt=PLANNER_SYSTEM_PROMPT,
user_prompt=user_prompt,