feat: preserve planner context across task steps
Tests / Test apps.device-host-agent.tests.test_mcp_token.test_load_or_create_concurrent_calls_do_not_corrupt failed
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:
@@ -96,6 +96,36 @@ def test_decide_base64_encodes_screenshot() -> None:
|
||||
assert body["screenshot_base64"] == "aGVsbG8="
|
||||
|
||||
|
||||
def test_decide_forwards_planner_history() -> None:
|
||||
seen_requests: list[httpx.Request] = []
|
||||
|
||||
def handler(request: httpx.Request) -> httpx.Response:
|
||||
seen_requests.append(request)
|
||||
return httpx.Response(200, json={"tool_name": "tap", "arguments": {}})
|
||||
|
||||
client = _client(handler)
|
||||
history = [
|
||||
{
|
||||
"user_prompt": "first screen",
|
||||
"tool_name": "tap",
|
||||
"arguments": {"x": 1, "y": 2},
|
||||
"rationale": "Open it.",
|
||||
"tool_result": {"success": True},
|
||||
}
|
||||
]
|
||||
|
||||
client.decide(
|
||||
system_prompt="sp",
|
||||
user_prompt="next screen",
|
||||
screenshot=None,
|
||||
tools=_TOOLS,
|
||||
timeout=10.0,
|
||||
history=history,
|
||||
)
|
||||
|
||||
assert json.loads(seen_requests[0].content)["history"] == history
|
||||
|
||||
|
||||
def test_decide_clamps_legacy_timeout_and_waits_for_cloud_profile_timeout() -> None:
|
||||
seen_requests: list[httpx.Request] = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user