mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
[bug] agent image: stop baking VIRTUAL_ENV=/app/.venv (silences uv run warning)
The agent-base image baked VIRTUAL_ENV=/app/.venv globally (since 8e201901,
conventional venv-baking, no targeted rationale), so every bare uv run in a
workspace clone warned 'VIRTUAL_ENV=/app/.venv does not match project .venv
and will be ignored' on every gate run. uv used the workspace .venv correctly
(the warning was noise), but it flooded every agent transcript.
The load-bearing MCP/SDK pin is UV_PROJECT_ENVIRONMENT=/app/.venv + --no-sync
(added in #179, the actual startup-stall fix), NOT VIRTUAL_ENV — so removing
VIRTUAL_ENV does not regress #179. The gateway tools stay on PATH.
Verified by building the image (roboco-agent-base:venv-verify) and smoke-
testing in a real container: (1) VIRTUAL_ENV is empty, python resolves to
/app/.venv/bin/python via PATH; (2) bare uv run from /app imports a roboco
module with no warning; (3) the MCP-launch path — cwd with its OWN .venv —
UV_PROJECT_ENVIRONMENT=/app/.venv uv run --no-sync resolves to /app/.venv/
bin/python, overriding the cwd .venv (the exact MCP-server invariant), no
warning; (4) grep for 'does not match|will be ignored' across all output is
empty. bash-guard-tests.sh 64/0, ruff clean, test_workspace_uv_resolves_clone_venv 3/3.
Ships on next agent-image rebuild + redeploy.
This commit is contained in:
@@ -95,8 +95,11 @@ RUN echo '{}' > /home/agent/.claude.json
|
||||
# PYTHONUNBUFFERED: flush stdout/stderr immediately so the SDK driver's logs
|
||||
# (e.g. the intake agent's turn-received / streamed lines) reach `docker logs` in
|
||||
# real time instead of block-buffering until the container is reaped.
|
||||
# VIRTUAL_ENV is intentionally NOT baked: it made bare `uv run` in a workspace
|
||||
# clone warn ("VIRTUAL_ENV=/app/.venv does not match project .venv") on every
|
||||
# gate run. MCP/SDK pin to /app/.venv via UV_PROJECT_ENVIRONMENT (set in the
|
||||
# orchestrator + sdk-startup-hook), not VIRTUAL_ENV. PATH keeps gateway tools.
|
||||
ENV PATH="/app/.venv/bin:$PATH" \
|
||||
VIRTUAL_ENV=/app/.venv \
|
||||
PYTHONUNBUFFERED=1
|
||||
|
||||
# Claude Code uses mounted ~/.claude for auth.
|
||||
|
||||
Reference in New Issue
Block a user