Repository navigation
feat(task_step): StepContextError, for a step the run's context can't satisfy - #620
Merged
Merged
Conversation
andrewpark-scaleai
enabled auto-merge (squash)
November 11, 2026 17:34
earakely-scale
approved these changes
Nov 11, 2026
…d split strings can't hide one
sarah-chitty-1
added a commit
that referenced
this pull request
Nov 12, 2026
One set_rate and one route: main's PUT /clock/set-rate and its _clock_write path replace this branch's /clock/rate. Rate 0 still freezes the clock (the card says so and sets minimum 0). Clock.set_rate keeps main's version/count/lived bookkeeping and current-time overflow guard. _change_clock wakes the fires waiting out virtual time on every write: clock_advanced already does for set_rate and advance, and clock_changed now does for set_time and clear. The executor read keeps this branch's 30 s of slack past the executor's own timeout, on top of main's FD-5333 fix. always_on raises StepContextError (#620) for an agent or user sim missing from the run's context. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
Some step failures can't be fixed by a retry, and the agent-env worker retries them anyway. A step that finds its input missing from the run's context fails the same way on every attempt, because each attempt starts from that same context. Datadog shows the scale of it over the last 3 days of
run_task_stepfailures:load_artifact: no artifact recorded by step Xdeploy_env: env already deployedrubrics_verifier: PromptResponse not found in contextEach of those spends two more attempts and their backoff before the run fails. The worker can't tell these apart from a transient error, because every one is a plain
RuntimeError.What
agent_env.task_step.StepContextError(aRuntimeError) marks a step the run's context can't satisfy. It covers two cases. Something the step needs from an earlier step is missing, or something it would create is already there.not found in context.deployed_envs/deployed_agents/deployed_sandboxescheck, everyis already deployedcheck, thePromptResponse ... not found in contextchecks, andNo artifact recorded by step. A codemod made the change, and rerunning it changes nothing.test_step_context_error.pyfails if a step raises one of these as a plainRuntimeErroragain.Callers that catch
RuntimeErrorbehave the same. The worker change that reads the new type is scaleapi/scaleapi#174619.Validation
The new guard test fails on the step files before this change and passes after it. Three existing tests now expect
StepContextError. In the full unit suite, 14,520 tests pass and 2 fail.test_mcp_cli_builder.py::test_codegen_loads_sibling_env_filefails on main too, because its subprocess can't importhttpxhere.test_a_repl_left_idle_is_closed_...passed when rerun.

Confidence Score: 5/5
The PR appears safe to merge; no blocking issues remain.Summary
Adds
StepContextError, aRuntimeErrorsubclass, so callers can identify steps that cannot succeed with the run's current context.The previous finding is addressed. No new actionable issues were found in the changes since the last review.
Reviews (2) · Last reviewed commit: "test: the StepContextError guard reads r..." · Reviewed by Greptile