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
+12 -1
View File
@@ -193,7 +193,12 @@ def test_multi_step_timeline_records_actual_per_step_prompts(tmp_path) -> None:
"""When AIPlanner is used, each timeline step's prompt is the real
per-step user prompt (containing scene JSON), not the bare task goal."""
decisions = [
ToolCallDecision(tool_name="tap", arguments={"x": 1, "y": 2}),
ToolCallDecision(
tool_name="tap",
arguments={"x": 1, "y": 2},
purpose="Open the send control.",
expected_outcome="The message composer is focused.",
),
ToolCallDecision(tool_name="finish_task", arguments={"success": True}),
]
client = ScriptedToolCallingClient(decisions)
@@ -228,6 +233,12 @@ def test_multi_step_timeline_records_actual_per_step_prompts(tmp_path) -> None:
assert "Current Scene (JSON)" in prompt
assert "Call exactly one tool" in prompt
assert "tap the button" in prompt
assert records[0]["tool_call"]["args"] == {"x": 1, "y": 2}
assert records[0]["tool_call"]["purpose"] == "Open the send control."
assert (
records[0]["tool_call"]["expected_outcome"]
== "The message composer is focused."
)
def test_non_ai_planner_falls_back_to_task_goal_for_prompt(tmp_path) -> None: