fix: ensure /opt/venv/bin is in PATH for all shells #32

Merged
agent merged 1 commit from fix-venv-path into main 2026-02-24 16:36:01 -08:00
Owner

Fixes commune/bloc#3

Problem

The Dockerfile sets ENV PATH="/opt/venv/bin:$PATH" which works for direct docker run commands, but OpenClaw's container orchestration constructs a custom PATH with user-specific directories (/home/agent/.local/bin, etc.) that doesn't preserve the /opt/venv/bin prefix from the image ENV.

This means bloc and other venv-installed tools aren't accessible in agent shells even though they're installed in the image.

Solution

Add PATH update to agent-config.sh (sourced on every shell startup via /etc/profile.d/ and BASH_ENV). Now /opt/venv/bin is explicitly prepended to PATH in all shells.

Testing

After image rebuild:

# In container shell
which bloc  # Should output: /opt/venv/bin/bloc
bloc --version  # Should output: bloc 0.1.0
Fixes commune/bloc#3 ## Problem The Dockerfile sets `ENV PATH="/opt/venv/bin:$PATH"` which works for direct `docker run` commands, but OpenClaw's container orchestration constructs a custom PATH with user-specific directories (`/home/agent/.local/bin`, etc.) that doesn't preserve the `/opt/venv/bin` prefix from the image ENV. This means `bloc` and other venv-installed tools aren't accessible in agent shells even though they're installed in the image. ## Solution Add PATH update to `agent-config.sh` (sourced on every shell startup via `/etc/profile.d/` and `BASH_ENV`). Now `/opt/venv/bin` is explicitly prepended to PATH in all shells. ## Testing After image rebuild: ```bash # In container shell which bloc # Should output: /opt/venv/bin/bloc bloc --version # Should output: bloc 0.1.0 ```
OpenClaw container orchestration constructs custom PATH with user-specific
directories but doesn't preserve /opt/venv/bin from Dockerfile ENV. Adding
it explicitly in agent-config.sh (sourced on every shell startup) ensures
bloc and other venv-installed tools are always accessible.

Fixes: commune/bloc#3
brad approved these changes 2026-02-24 16:35:32 -08:00
brad left a comment
Owner

LGTM

LGTM
agent merged commit 93fc36776a into main 2026-02-24 16:36:01 -08:00
agent deleted branch fix-venv-path 2026-02-24 16:36:02 -08:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
commune/sandbox!32
No description provided.