search challenge: triangle marker on a crate's back face (rendered in vision, in digest), report tool with distance verification, smooth turn(duration), --free/--search autonomous modes, look_at crates; verified with gpt-5.6-luna
This commit is contained in:
@@ -247,3 +247,53 @@ async def test_move_accepts_duration_zero_default(bridge):
|
||||
res = (await client.call_tool("move", {"forward": 1.0})).output
|
||||
assert res["moved"] == pytest.approx(1.0)
|
||||
assert res["duration"] == 0.0
|
||||
|
||||
|
||||
async def test_report_verifies_near_marker(bridge):
|
||||
t = InProcessTransport.start(bridge)
|
||||
async with t:
|
||||
client = AICCClient(t)
|
||||
async with client:
|
||||
await client.handshake()
|
||||
out = (await client.call_tool("report", {"discovery": "triangle"})).output
|
||||
assert out["success"] is True
|
||||
assert out["verified"] is False # far away from spawn
|
||||
pos = bridge.world.marker_world_pos()
|
||||
bridge.world.capsule.x = pos[0]
|
||||
bridge.world.capsule.z = pos[2]
|
||||
out2 = (await client.call_tool("report", {})).output
|
||||
assert out2["verified"] is True
|
||||
assert "verified" in out2["message"]
|
||||
|
||||
|
||||
async def test_turn_with_duration_is_smooth(bridge):
|
||||
t1 = InProcessTransport.start(bridge)
|
||||
t2 = InProcessTransport.start(bridge)
|
||||
async with t1, t2:
|
||||
mover = AICCClient(t1)
|
||||
viewer = AICCClient(t2)
|
||||
async with mover, viewer:
|
||||
await mover.handshake()
|
||||
await viewer.handshake()
|
||||
task = asyncio.create_task(
|
||||
mover.call_tool("turn", {"yaw_deg": 90.0, "duration": 0.8})
|
||||
)
|
||||
await asyncio.sleep(0.3)
|
||||
mid = (await viewer.call_tool("proprioception", {})).output["rotation"]["yaw_deg"]
|
||||
assert 0.0 < mid < 90.0, f"expected intermediate rotation, got {mid}"
|
||||
res = (await task).output
|
||||
assert res["rotation"]["yaw_deg"] == pytest.approx(135.0, abs=0.5)
|
||||
|
||||
|
||||
async def test_look_at_crate(bridge):
|
||||
t = InProcessTransport.start(bridge)
|
||||
async with t:
|
||||
client = AICCClient(t)
|
||||
async with client:
|
||||
await client.handshake()
|
||||
out = (await client.call_tool("look_at", {"target": "crate_red"})).output
|
||||
dx = bridge.world.boxes[0].cx - bridge.world.capsule.x
|
||||
dz = bridge.world.boxes[0].cz - bridge.world.capsule.z
|
||||
assert out["rotation"]["yaw_deg"] == pytest.approx(
|
||||
math.degrees(math.atan2(dx, dz)) % 360.0, abs=0.5
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user