Skip to content

fix(agents): pi and OpenHands installed into a task container work in its working directory - #321

Merged
earakely-scale merged 1 commit into
mainfrom
fix/pi-installed-workspace
Oct 23, 2026
Merged

earakely-scale merged 1 commit into
mainfrom
fix/pi-installed-workspace

Conversation

@earakely-scale

@earakely-scale earakely-scale commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Why. pi and OpenHands, installed into a task container by install_agent, work in /workspace, not the container's working directory. Each start.sh changes to its install folder, and the agent falls back to its image's /workspace. So a task whose files live in the container's WORKDIR is invisible to them. Claude Code works in the container's working directory.

#314's e2e found this: --agent pi installed pi into a Debian task container whose WORKDIR is /workspace/task_repo, and pi answered "The file /workspace/notes.txt does not exist". A task that names pi in install_agent hits the same thing.

Change

  • Each start.sh (install only) names the directory it was started in as the workspace, unless that's /.
    • docker exec starts it in the container's working directory.
    • It's passed as PI_A2A_WORKSPACE / OPENHANDS_A2A_WORKSPACE. OpenHands' a2a_server.py already read its variable; pi's now reads its own the same way.
  • Image deploys are unchanged: the variable is unset there, so both keep /workspace.
  • The READMEs say where each agent works.
  • Both agent folders change, so the next release builds and publishes one new pi image and one new OpenHands image (ci(release): build an agent's image only when its folder changes #309).
  • Not changed: Codex's install gives its CLI /app as its workspace, which its README documents. The e2e below shows what that means for the same task.

Tests

  • tst/unit/agents/test_installed_workspace.py runs each agent's real start.sh, with a stub server that records the workspace it would get:
    • started in a task directory, it gets that directory;
    • started at /, it gets none, so the image default applies.
  • test_a2a_server_serves_the_workspace_its_environment_names: pi's server takes the variable, and /workspace without it.
  • The unit tier passes, and the plugin API check reports no break.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

Installed pi and OpenHands agents now use the directory where start.sh begins, unless it is /.

  • Installed pi and OpenHands use the task container’s working directory.

Reviews (1) · Last reviewed commit: "fix(agents): pi and OpenHands installed ..." · Reviewed by Greptile

… its working directory

Both started from their install folder and fell back to /workspace, so an install_agent into a task container left
them outside the task's files, where Claude Code works in the container's working directory. start.sh now names the
directory it's started in as the workspace, unless that's the root; the image keeps /workspace.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@earakely-scale
earakely-scale requested a review from a team as a code owner October 23, 2026 17:38
@earakely-scale

Copy link
Copy Markdown
Collaborator Author

End to end at 4717896 on one m5.2xlarge (linux/amd64) admin VM.

  • Setup: a clean venv with this branch's wheels, LiteLLM, each case in its own store.
  • The task: install_agent naming no agent installs --agent <x> into a Debian task container whose WORKDIR is /workspace/task_repo. The prompt says "Read the file notes.txt in your working directory"; the check wants notes-from-the-task.
  • pi and OpenHands ran from images built on the VM from this branch's sources. Codex and Claude Code pulled their published images.
Case Model Result
--agent pi, installed claude-haiku-5-5 passed: notes-from-the-task (before this PR: "The file /workspace/notes.txt does not exist")
--agent openhands, installed claude-haiku-5-5 passed: notes-from-the-task
Claude Code, installed as written claude-haiku-5-5 passed: notes-from-the-task (the behavior the two now match)
--agent pi, from its image (smoke task) claude-haiku-5-5 passed
--agent openhands, from its image (smoke task) claude-haiku-5-5 passed
--agent codex, from its image (smoke task) gpt-5.4-mini passed (23 s). The dry run resolves the alias to @local/agentenv-framework/agents/codex and its published image
--agent codex, installed (unchanged by this PR) gpt-5.4-mini scored 0: "notes.txt is not present in the current working directory (/app)". This is the /app workspace its install gives the CLI

No containers were left behind, and the results contain no secret text. The VM, security group and key pair are deleted.

@earakely-scale
earakely-scale merged commit e63b1ae into main Oct 23, 2026
14 checks passed
@earakely-scale
earakely-scale deleted the fix/pi-installed-workspace branch October 23, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant