Repository navigation
local task run: keep going through a network blip; retry teardown and name what's left up - #997
Open
sarah-chitty-1 wants to merge 4 commits into
Open
sarah-chitty-1 wants to merge 4 commits into
sarah-chitty-1 wants to merge 4 commits into
Conversation
…rdown and name what's left up A single failed read of the run index (a laptop losing DNS for a moment) made the CLI stop following, which stopped the LocalRunner and cancelled runs that were still working; their teardown then failed on the same outage and left every sandbox up until its TTL. - submitted_runs: a failed poll is retried for up to OUTAGE_SECONDS (10 min) before giving up. - LocalRunner: a sandbox the teardown couldn't terminate is tried again with backoff, and what is still up is logged with the agent-env task teardown command that removes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sarah-chitty-1
marked this pull request as ready for review
December 3, 2026 01:09
…mments Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment on lines
+102
to
+103
| await asyncio.sleep(POLL_SECONDS) | ||
| continue |
There was a problem hiding this comment.
Step details disappear after recovery
If the network drops while _step_context reads a completed step's journal, this retry resumes polling but never prints that step's details. _poll_run adds the step to run.steps before _echo_step finishes, so later polls skip it. The command can report success without showing a deployed endpoint or verifier result.
Add the step to run.steps only after its output succeeds.
Knowledge Base Used: Command-line workflows
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/agent_env/cli/submitted_runs.py
Line: 102-103
Comment:
**Step details disappear after recovery**
If the network drops while `_step_context` reads a completed step's journal, this retry resumes polling but never prints that step's details. `_poll_run` adds the step to `run.steps` before `_echo_step` finishes, so later polls skip it. The command can report success without showing a deployed endpoint or verifier result.
Add the step to `run.steps` only after its output succeeds.
**Knowledge Base Used:** [Command-line workflows](https://app.greptile.com/-/switch-tenant?tenant=scale-ai&next=%2Fcustom-context%2Fknowledge-base%2Fscaleapi%2Fagentenv-framework%2F-%2Fdocs%2Fcommand-line-workflows.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptom: a local
agent-env task rundies when the laptop loses DNS mid-run (pymongo ServerSelectionTimeoutError / httpx ConnectError "nodename nor servname provided"). The runner logs "interrupted by shutdown", and teardown fails too, so every sandbox the run started (env VM, browser, agent, user sim, judge) stays up until its 6-hour TTL. It happened twice on one PSI task in a day, and 10 sandboxes had to be stopped by hand each time.Fix:
Hub runs aren't affected.
Tests: new unit tests fake the network errors.
tst/unit/runner/local_runner_test.pyandtst/unit/cli/submit_runs_test.pypass (47). The wider unit suite is still running locally; CI will run it too.🤖 Generated with Claude Code
Confidence Score: 5/5

The PR appears safe to merge, with a non-blocking gap in step output after network recovery.Findings
Fix with agent prompt
Summary
This PR keeps polling through brief network outages and retries sandbox cleanup with backoff.
Reviews (2) · Last reviewed commit: "local run: retry sandboxes concurrently ..." · Reviewed by Greptile