edbeeching's picture
edbeeching HF Staff
Port 270 AgentEscapeBench tasks to Harbor with OpenEnv integration (part 2)
49aa045 verified
Raw History Blame Contribute Delete
425 Bytes
"""Harbor invokes this inside the puzzle service after stopping the agent."""
import json
import pathlib
import urllib.request
with urllib.request.urlopen("http://127.0.0.1:8000/state", timeout=10) as response:
state = json.load(response)
state["collected_from_live_service"] = True
target = pathlib.Path("/evidence/final.json")
temp = target.with_suffix(".tmp")
temp.write_text(json.dumps(state))
temp.replace(target)