You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pi: loading a snapshot of an empty workspace fails with FileNotFoundError #285
Loading a pi snapshot whose workspace was empty fails with HTTP 500. PiAgent.load_snapshot restores the workspace with _unpack (src/agent_env/agents/agents/pi/pi_agent.py, line 333), which extracts the archive into a staging directory and then iterates it. An empty workspace's archive has no members, so tarfile.extractall never creates the staging directory, and staging.iterdir() raises FileNotFoundError. The workspace is left as it was, and the conversation is not installed for the target context.
The A2A validator's snapshot step saves the workspace of an agent that has not written to it, so it hits this path.
Suggested fix: create the staging directory before extracting (staging.mkdir() at the top of the try), so an empty archive restores as an empty workspace; a regression test can save and load a snapshot of an empty workspace. The OpenHands agent proposed in #281 had the same code and the same bug, fixed there this way.
Output and errors
FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/.../ws/.pi-a2a-restore-cb277f41ab7b4b20aaad1d5f17f53dec'
Output of agent-env plugin list
agent-env 0.9.1341 · uv project at .../agentenv-framework
config: (none)
PACKAGE VERSION PROVIDES STATUS
agentenv-framework 0.9.1341 bundle agents, bundle echo-mcp, bundle hello ok
Operating system
macOS 26.5 (arm64). The bug does not depend on the platform.
Activity