Skip to content

fix(agent-challenge): allow PyPI index for agent dependency install - #62

Merged
echobt merged 1 commit into
mainfrom
fix/agent-install-allow-pypi-index
Jul 29, 2026
Merged

fix(agent-challenge): allow PyPI index for agent dependency install#62
echobt merged 1 commit into
mainfrom
fix/agent-install-allow-pypi-index

Conversation

@echobt

@echobt echobt commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remove --no-index / --no-build-isolation from the own_runner agent pip install so miner deps (e.g. litellm>=1.55.0) resolve from PyPI at evaluation time.
  • Use network-sane pip retries/timeouts (--retries 3 --default-timeout 30).
  • Update stale comments in runner.py and the agent-challenge Dockerfile.

Changes

  • Host-local evaluation path has egress; --no-index was the sole blocker (instant empty-index fail, not DNS retries).
  • Broker/Swarm egress-lock networking is untouched.
  • Tests now assert the new install-script contract.

Test plan

  • RED then GREEN on test_own_runner_script_pip_installs_use_pypi_with_sane_retries
  • UV_CACHE_DIR=/var/tmp/uv-cache uv run pytest packages/challenges/agent-challenge/tests/test_evaluation.py -q (59 passed)
  • uv run ruff check src packages/challenges
  • Repo grep: no production --no-index / --no-build-isolation on this install path

CI

  • Waiting for required checks to go green on this head SHA.

Notes

  • Does not touch Phala/attestation, broker network lock, or task-container networking.
  • Pre-existing failures under -k "runner or install or own_runner" for submission status received exist on main (miner env gate) and are out of scope.

Summary by CodeRabbit

  • Bug Fixes
    • Improved challenge setup reliability by allowing dependency installation to use available package sources when needed.
    • Added more resilient retry and timeout behavior to reduce failures during environment preparation.
    • Installation steps now continue gracefully when individual dependency operations cannot complete.

Host-local evaluation has egress to PyPI; --no-index caused instant
empty-index failures for real agent deps (e.g. litellm>=1.55.0).
Drop offline-only pip flags and use network-sane retries/timeouts.
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The own-runner dependency installation changed from offline-only pip behavior to PyPI-capable resolution with three retries and a 30-second timeout. Dockerfile comments and evaluation tests were updated to reflect the new settings and retained best-effort execution.

Changes

Agent dependency installation

Layer / File(s) Summary
Update own-runner installation strategy
packages/challenges/agent-challenge/Dockerfile, packages/challenges/agent-challenge/src/agent_challenge/evaluation/runner.py
The generated runner permits PyPI resolution with updated retry and timeout settings, while documentation describes pre-baked dependencies and remaining PyPI installs.
Align installation assertions
packages/challenges/agent-challenge/tests/test_evaluation.py
Tests verify removal of offline-only flags, the new retry and timeout values, and retained timeout-wrapped best-effort installs.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: enabling agent dependency installs to resolve from PyPI instead of offline-only behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/agent-install-allow-pypi-index

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/challenges/agent-challenge/Dockerfile (1)

137-139: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Align the Docker pre-bake strategy with pip’s isolation mode.

Pip’s normal PEP 517 flow creates a temporary isolated build environment and installs build dependencies there; --no-build-isolation is the mode that relies on preinstalled build dependencies. (pip.pypa.io) Therefore, the globally pre-baked setuptools/hatchling/other backends will not provide the claimed benefit for modern pyproject.toml builds.

  • packages/challenges/agent-challenge/Dockerfile#L137-L139: update the comment/strategy so it does not claim global backend pre-baking accelerates isolated builds.
  • packages/challenges/agent-challenge/src/agent_challenge/evaluation/runner.py#L2016-L2016: document or implement a controlled wheel/cache/index strategy for isolated build requirements if the pre-bake is intended to remain.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/challenges/agent-challenge/Dockerfile` around lines 137 - 139, Align
the pre-bake strategy with pip’s isolated PEP 517 builds: in
packages/challenges/agent-challenge/Dockerfile lines 137-139, revise the
comment/strategy so it no longer claims globally installed backends accelerate
isolated builds; in
packages/challenges/agent-challenge/src/agent_challenge/evaluation/runner.py
line 2016, document or implement a controlled wheel, cache, or index strategy
for isolated build requirements if the pre-bake remains. Use the existing
runner._own_runner_script context and make no unrelated changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/challenges/agent-challenge/Dockerfile`:
- Around line 137-139: Align the pre-bake strategy with pip’s isolated PEP 517
builds: in packages/challenges/agent-challenge/Dockerfile lines 137-139, revise
the comment/strategy so it no longer claims globally installed backends
accelerate isolated builds; in
packages/challenges/agent-challenge/src/agent_challenge/evaluation/runner.py
line 2016, document or implement a controlled wheel, cache, or index strategy
for isolated build requirements if the pre-bake remains. Use the existing
runner._own_runner_script context and make no unrelated changes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 522989df-ee9b-4418-8ee1-549b2c767026

📥 Commits

Reviewing files that changed from the base of the PR and between 619e8a9 and bdef8e1.

📒 Files selected for processing (3)
  • packages/challenges/agent-challenge/Dockerfile
  • packages/challenges/agent-challenge/src/agent_challenge/evaluation/runner.py
  • packages/challenges/agent-challenge/tests/test_evaluation.py

@echobt
echobt merged commit 7e85c91 into main Jul 29, 2026
45 checks passed
@echobt
echobt deleted the fix/agent-install-allow-pypi-index branch July 29, 2026 13:22
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