feat(planner): add execution context to prompts
Tests / Test passed: 977

This commit is contained in:
2026-07-16 10:25:20 +08:00
parent 240b7be7b8
commit 358f4623ba
9 changed files with 159 additions and 3 deletions
+16
View File
@@ -146,6 +146,22 @@ def test_ai_planner_forwards_tools_screenshot_and_timeout_to_client() -> None:
assert "send a message" in call["user_prompt"]
def test_ai_planner_includes_device_platform_from_task_context() -> None:
client = FakeToolCallingClient(
ToolCallDecision(tool_name="tap", arguments={"x": 1, "y": 2})
)
planner = AIPlanner(client=client)
context = TaskContext(
task_id="task-1",
goal="send a message",
device_platform="android",
)
planner.plan(goal="send a message", scene=_scene(), context=context)
assert "Device type: android" in client.calls[0]["user_prompt"]
def test_ai_planner_populates_step_prompt_from_user_prompt() -> None:
"""PlannedStep.prompt should carry the actual user prompt sent to the LLM,
not the bare task goal."""