feat(planner): persist reusable action semantics
Tests / Test passed: 879

This commit is contained in:
2026-07-15 18:14:28 +08:00
parent 361dada276
commit d69be48f96
41 changed files with 733 additions and 116 deletions
+11 -1
View File
@@ -57,8 +57,15 @@ class AIPlanner(Planner):
return [
PlannedStep(
action=decision.tool_name,
description=f"AI planner: {decision.tool_name}({decision.arguments})",
description=(
f"AI planner: {decision.purpose}"
if decision.purpose
else f"AI planner: {decision.tool_name}({decision.arguments})"
),
args=dict(decision.arguments),
expected_text=decision.expected_outcome,
purpose=decision.purpose,
expected_outcome=decision.expected_outcome,
prompt=decision.user_prompt or user_prompt,
rationale=decision.text_output,
thinking=decision.thinking,
@@ -78,7 +85,10 @@ def _history_summary(world: "WorldState | None") -> list[dict[str, Any]]:
{
"page": event.page,
"action": event.action,
"arguments": dict(event.arguments),
"rationale": event.rationale,
"purpose": event.purpose,
"expected_outcome": event.expected_outcome,
"success": event.success,
}
for event in world.history