Skip to content
This repository was archived by the owner on Apr 4, 2026. It is now read-only.

fix: install ipython in /opt/venv-a0 so code_execution_tool can find it#2

Merged
Nafania merged 2 commits intomainfrom
fix/ipython-not-found-in-container
Mar 16, 2026
Merged

fix: install ipython in /opt/venv-a0 so code_execution_tool can find it#2
Nafania merged 2 commits intomainfrom
fix/ipython-not-found-in-container

Conversation

@Nafania
Copy link
Copy Markdown
Owner

@Nafania Nafania commented Mar 16, 2026

Summary

  • Bug: bash: ipython: command not found when agent executes Python code
  • Root cause: ipython was installed in /opt/venv (Python 3.13) but the runtime uses /opt/venv-a0 (Python 3.12.4), so ipython was not in PATH
  • Fix: Add ipython to both requirements.txt and install_python.sh for defense in depth

Root Cause Trace

Layer What happens ipython available?
install_python.sh line 22 pip install ipython in /opt/venv (3.13) Yes, wrong venv
install_python.sh line 58 pip install pip in /opt/venv-a0 (3.12) No
setup_venv.sh source /opt/venv-a0/bin/activate PATH = venv-a0 only
code_execution_tool.py line 165 ipython -c {code} command not found

Changes

  1. requirements.txt — added ipython>=8.0.0
  2. docker/base/fs/ins/install_python.sh — added ipython to pip install in /opt/venv-a0

Test plan

  • Rebuild Docker image, verify ipython in /opt/venv-a0/bin/
  • Run agent, execute Python code, confirm no "command not found"
  • Existing tests pass (2171 passed, no regressions)

Made with Cursor

Nafania added 2 commits March 16, 2026 16:41
ipython was installed in /opt/venv (Python 3.13) but the runtime uses
/opt/venv-a0 (Python 3.12.4). code_execution_tool.py runs `ipython -c`
which fails with "command not found" because ipython is not in PATH.

Root cause: install_python.sh line 22 installs ipython in /opt/venv,
but line 58 only upgrades pip in /opt/venv-a0. The comment in
install_A0.sh ("moved to base image") refers to the wrong venv.

Fix in two places for defense in depth:
- requirements.txt: add ipython>=8.0.0 (installed in venv-a0 via uv)
- install_python.sh: also pip install ipython in venv-a0 during build

Made-with: Cursor
@Nafania Nafania force-pushed the fix/ipython-not-found-in-container branch from 7067ab0 to 347f846 Compare March 16, 2026 13:42
@Nafania Nafania merged commit 249170a into main Mar 16, 2026
2 checks passed
Nafania added a commit that referenced this pull request Mar 31, 2026
- #3: duplicate response loop breaker (breaks after 3 identical responses)
- #4: dynamic output truncation threshold based on context window size
- #2: resolve §§secret() / $$secret() placeholders in MCP server env/args/url/headers
- #19: scheduler update_task tool method + prompt documentation

Already applied (verified, skipping): #22 parallel MCP init, agent0ai#62 context window optimization

Upstream: PR agent0ai#1265, PR agent0ai#857, PR agent0ai#1150, PR agent0ai#1105
Made-with: Cursor
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant