fix(proxy+agent-challenge): unblock miner env routes and engage env gate - #61
Conversation
Prod enables agent_challenge_attested_routes_enabled, which blocked GET|PUT /env, POST /env/confirm-empty, and POST /launch with local 404. Treat env/launch as signed routes flag-independently via the existing _is_agent_challenge_env_route SSOT so the enabled-mode allowlist admits them and miner X-Hotkey/X-Signature/X-Nonce/X-Timestamp headers are preserved (otherwise signed PUT residual 401 after allowlisting).
_persist_submission hardcoded env_confirmed_empty=True, so analysis allow always auto-enqueued credential-less evaluation and waiting_miner_env was dead. New rows start unconfirmed; miners must PUT /env or POST /env/confirm-empty before evaluation. Legacy backfill paths untouched.
_validate_evaluation_enqueue_status previously fell through for unknown statuses (including accidental enqueue from non-ready states). Explicitly allow in-flight TB statuses, waiting_miner_env when confirmed, legacy analysis_allowed, and terminal re-eval labels; raise ValueError otherwise.
|
Warning Review limit reached
Next review available in: 32 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
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. Comment |
Summary
agent_challenge_attested_routes_enabled=true(prod), the master proxy no longer 404s minerGET|PUT /submissions/{id}/env,POST .../env/confirm-empty, orPOST .../launch, and preserves miner signature headers on those shapes.waiting_miner_envuntil the miner supplies env or confirm-empty (instead of auto-enqueuing credential-less eval → 0/30)._validate_evaluation_enqueue_statusis fail-closed with an explicit allowlist (including terminal re-eval).Why these must ship together
E must never reach prod without G. After E, unconfirmed submissions park in
waiting_miner_env. Escape hatches arePUT /envandPOST /env/confirm-empty. With G unfixed, the public edge returns404 Proxy path not foundfor both, so submissions would be permanently stuck.Root cause chain (prod scores every miner 0/30):
OPENROUTER_API_KEYvia env API.env_confirmed_empty=True→ never waited for the key.Changes
G —
src/base/master/app_proxy.py_is_agent_challenge_signed_routealways includes_is_agent_challenge_env_route(flag-independent), matching review/eval signed rows.preserve_miner_signature_headers.agent_challenge_attested_routes_enabledor widen capability/assignment/evidence/key-release/results.E —
packages/challenges/agent-challenge/.../api/routes.py_persist_submission:env_confirmed_empty=False,env_confirmed_empty_at=None._legacy_confirmed_empty/_backfill_legacy_submission_env_metadata.POST /submissions/{id}/env/confirm-emptyexists (confirm_empty_submission_env) and is covered bytest_submission_env_routes.py.F —
.../evaluation/runner.pywaiting_miner_env, legacyanalysis_allowed, terminal re-eval (tb_completed/tb_failed_final+ public terminals used by owner revalidate).else: raise ValueError(... cannot enqueue evaluation).Test plan
uv run pytest tests/unit/test_agent_challenge_attested_proxy.py tests/unit/test_admin_registry_proxy.py(314 passed)uv run --package agent-challenge pyteston analyzer lifecycle, env routes, frontend contract, evaluation, owner controls, admin escalation, lifecycle e2e, no_phala (126+ passed)ruff check+ruff format --checkon all touched filesCI
Notes