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
@@ -36,7 +36,14 @@ def test_decide_returns_tool_call_decision_on_success() -> None:
seen_requests.append(request)
return httpx.Response(
200,
json={"tool_name": "tap", "arguments": {"x": 1, "y": 2}},
json={
"tool_name": "tap",
"arguments": {"x": 1, "y": 2},
"rationale": "The button is visible. Opening it.",
"thinking": "A tap should navigate to the next page.",
"purpose": "Open the next page.",
"expected_outcome": "The next page is visible.",
},
)
client = _client(handler)
@@ -49,7 +56,14 @@ def test_decide_returns_tool_call_decision_on_success() -> None:
timeout=30.0,
)
assert decision == ToolCallDecision(tool_name="tap", arguments={"x": 1, "y": 2})
assert decision == ToolCallDecision(
tool_name="tap",
arguments={"x": 1, "y": 2},
text_output="The button is visible. Opening it.",
thinking="A tap should navigate to the next page.",
purpose="Open the next page.",
expected_outcome="The next page is visible.",
)
assert len(seen_requests) == 1
request = seen_requests[0]
assert request.url.path == "/internal/v1/hosts/host-a/planner/decide"