Repository navigation
fix(always_on): an infra-failed turn is redone from its env deploy instead of scoring 0 - #933
Merged
Merged
Conversation
…g 0; judges read the harness's failure A PSI always_on run whose wake failed for an infrastructure reason (a gateway 5xx, throttling, a dead sandbox) was recorded as a normal end and then scored 0 by the rubrics judges, so it counted as the model's failure (BELOW_ONE). The A2A protocol already says which failures are the agent's (error_type agent_error) and which aren't (infra_error, "agent-env may retry it"); nothing acted on it. - always_on: a turn whose error_type is infra_error, or whose agent stopped answering (AgentUnreachableError, error_code agent_env.agent_unreachable), ends the run as agent_turn_infra_error (in ERROR_ENDS and END_NOTES). The timeline, record, conversation and prompt response are written as before, and the record now keeps error_code. Then the step raises AgentTurnInfraError, so no verifier grades it and a retry_config can redo it. agent_error turns are graded as before. Docstrings now say what a failed turn gets (a rubrics 0, not a skip). - task/outcome.py: AgentTurnInfraError classifies as TRANSIENT (key budget/auth text still wins). - rubrics_verifier: an infra_error prompt response is a true skip (no score, no rows; the mistakes entry skipped too), so an aggregate leaves it out and a run with every source skipped is UNSCORED. _gated no longer compares a skipped verdict's missing score. - turn_events (native OpenInference): a harness.error span is a failure note (kind, message, HTTP status, retries) instead of being dropped as the harness's own span; a failed_wake message names the kind. gateway, throttled, timeout_call and harness kinds are said to be no doing of the assistant's. - staging: harness_note lines carry failure, the index gets an error line for it, the record lists harness_failures, and the judge's files note explains failure lines only when there is one. - agents/AGENTS.md: what always_on does with each error_type. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ailure's message stays out of its staged line Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e from its env deploy The step type's own default (TaskStep.default_retry_config), applied when a Task is built and never written into the stored task. A task's own retry_config replaces it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ures' into sarahchitty/always-on-infra-failures
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…verifier and aggregate_verifiers as on main The infra-error skip in rubrics_verifier and the all-skipped verifier_ids aggregate changed other tasks' scores, and no always_on run reaches them: the step fails first and its default retry redoes the run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… every step the always_on step depends on Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The scheduler retried any failure a retry_config covered, so always_on's implied retry also redeployed and reran a run that failed on a config error or a broken user sim, which fails the same way again. RetryConfig.retry_on names the failures a retry redoes (raised as or from one of its types); always_on's default sets it to AgentTurnInfraError. A task's own retry_config, with no retry_on, still redoes any failure. Tests run the implied retry through the scheduler: an infra failure redeploys and reruns once, a second fails the task, and any other failure fails it without redeploying. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reverts fe36f38. The hub's run-task workflow decides its own rollbacks and doesn't read RetryConfig.retry_on, so the filter held only in Task.run and local runs and the hub would redo different failures. Until the hub honours it too, always_on's default retry redoes a failed run on both the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sarah-chitty-1
added a commit
that referenced
this pull request
Dec 2, 2026
…itty/always-on-carry-on-after-failed-wake Picks up 91a2a16, bf8e40c, fe36f38 and its revert 1f220a6. In rubrics_verifier, #933's removal of the generic infra_error skip stands and #981's _judges_failed_run and _judges_without_trajectory hooks stay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sarah-chitty-1
added a commit
that referenced
this pull request
Dec 2, 2026
…ded, never scores it 0 With #933's head, an always_on run that ended on an infrastructure failure and reached its verifiers (the task's fail_task_on_error off) was scored 0 with a prompt_error row, against the model. The always_on judge and the response check now skip it (ended_on_infra_failure, read from the run's record). A prompt_agent turn's infra_error still scores 0 unjudged, as on main, so no other task's score moves. rubrics_verifier's gate lets a skip through when fail_task_when_not_passing is on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…own default; test the retry end to end - Task(implied_retries=False) and Task.retry_config_of: an episode's copy runs no step type's default retry, so episode/rules no longer refuses an always_on task for a retry_config its author never wrote. A retry the author wrote is still refused. The default stays on the step, where the hub worker reads it. - _imply_retries works a default out again for each task built from the same step objects, instead of keeping the one an earlier task's graph gave. - Scheduler tests: a failed run is redeployed and run again once, whatever failed it; a second failure fails the task; a task that takes no default fails without redeploying. - Docs say a failed run is redone once, whatever failed it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sarah-chitty-1
added a commit
that referenced
this pull request
Dec 2, 2026
…-failed-wake #933 moves implied retries off the step objects: Task(implied_retries=...) and Task.retry_config_of(step), with an episode's copy taking no default retry. AGENTS.md conflicted. The resolution keeps #981's account of an agent_error turn (it ends only its wake, three in a row end the run, the whole run is judged) and takes #933's sentence on the default retry, which redoes a failed step once from its env deploy whatever failed it. It says "a failed step" because under #981 an agent_error run no longer fails its step. None of #981's code reads step.retry_config, so nothing else needed to move to Task.retry_config_of. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o step it was given Building a second Task from the same step objects rewrote their default retry, so the first task's retry_config_of read the second's policy. A Task now keeps each step's type default in its own dict, read by retry_config_of; it never writes it onto the steps it is given. Task.from_dict, whose steps are its own, also puts the default on them, for a runner that reads a step's retry_config (a hub worker reads them off Task.get). The seed pass no longer copies it over. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sarah-chitty-1
added a commit
that referenced
this pull request
Dec 2, 2026
…-failed-wake #933 now keeps each step's default retry in the Task's own dict, read through Task.retry_config_of, and never writes it onto the steps it's given, except that Task.from_dict puts it on the steps it builds, for the hub worker. The merge was clean. None of #981's code reads step.retry_config. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eeded steps A seed can fill placeholders in step ids, so the task's defaults, keyed by its unseeded ids, missed the seeded steps, and their resume points named unseeded ids too. The scheduler now asks the run: the task's own defaults, or, for a seeded run, those its seeded steps imply, kept per run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AhmedArifK
approved these changes
Dec 2, 2026
williamloo-scale
approved these changes
Dec 2, 2026
sarah-chitty-1
added a commit
that referenced
this pull request
Dec 2, 2026
…lter One conflict, in always_on_staging.py, resolved to keep both sides: - the module docstring: #980's thinking only when the judge's filter asks for it (stages_thinking), with #933's harness note for a failed wake (``failure``); - the imports: #980's trajectory_filter import beside #933's turn_events import with is_infra_failure; - _Stager's fields: #980's thinking, thinking_left_out and as_recorded beside #933's harness_failures; - the staging record: #980's thinking_left_out and thinking_unfiltered_wakes beside #933's harness_failures. Everything else merged cleanly; src/agent_env/task (Task.retry_config_of and the implied retries) is main's as is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sarah-chitty-1
added a commit
that referenced
this pull request
Dec 2, 2026
…-failed-wake main now has #933 squashed (dbbc03f), plus #995 (prompt_agent's context_window) and five other commits. This branch already merged #933's final head, 26ae0f9, and main's #933 files match it. Five files conflicted, because the squash re-applies #933's changes against the old base: AGENTS.md, always_on.py, always_on_staging.py, test_always_on_graded.py and test_always_on_wake_limit.py. Each was resolved by a three-way merge with 26ae0f9 as the base. That keeps this branch's #981 changes and adds only what main changed since #933: #995's context_window lines in always_on.py. Checked: the merged tree differs from main by exactly #981's own changes (26ae0f9..e1747cd's work), and from this branch by exactly main's non-#933 commits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sarah-chitty-1
added a commit
that referenced
this pull request
Dec 3, 2026
…uard Conflicts, each resolved so both sides survive: - always_on_agent_verifier.py: the files note adds #981's _FAILURE_NOTE for a run with harness_failures and this branch's _GUARD_NOTE for one the context guard acted in. - always_on_staging.py: _IDENTITY has both "guard" and #981's "failure" and "failed_turn_notice", with this branch's _IDENTIFYING_PARTS and _KEPT; a harness_note carries guard and failure; the record keeps context_guard_actions, results_shown_not_whole and harness_failures; index.md has the compaction (mid_wake, _index_facts), guard and failure lines; imports guard_words, is_infra_failure and shown_words. - judge_utils/turn_events.py: TurnEvents and the span comment describe both failure and guard; the harness.guard, harness.error and harness.call.resent handling all stay; the guard helpers and #981's failure helpers both stay. 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.
What and why
In an always_on run, a wake can fail for a reason that isn't the model's: a gateway 5xx, throttling, a dead agent sandbox. Today the run ends normally and the rubrics judges score it 0, so the failure counts against the model. The A2A protocol already tells the two apart.
error_type: agent_errormeans the agent failed.infra_errormeans it didn't, and agent-env may retry. Nothing acted on that.With this change:
agent_turn_infra_errorwhen a turn'serror_typeisinfra_error, or when the agent stops answering (AgentUnreachableError,agent_env.agent_unreachable).error_code.AgentTurnInfraError, so no verifier grades it and aretry_configcan redo it.agent_errorturns are graded as before. agent-env's own turn timeout is still graded.retry_configis redone once from the firstdeploy_envit depends on, whatever failed it (TaskStep.default_retry_config, applied when aTaskis built, soTask.geton the hub worker sees it too). It applies only when that rollback redoes everything the step depends on (no ancestor runs beside the deploy); otherwise the task needs its ownretry_config. A task's ownretry_configreplaces it. It isn't written into the stored task (RetryConfig.implied), so stored tasks and bundle hashes don't change, and it's kept in seeded runs. EachTaskkeeps its defaults in its own dict (retry_config_of) and never changes a step it's given, so tasks built from the same step objects don't change each other's retries;Task.from_dict, whose steps are its own, also puts the default on them for the hub worker, which readsstep.retry_configoffTask.get. An episode's copy takes none (Task(implied_retries=False), read throughTask.retry_config_of), so episodes still accept always_on tasks; a retry the author wrote is still refused there. Every always_on task on the hub (53) has noretry_configtoday and gets the default.AgentTurnInfraErroris TRANSIENT, the same cause as other retryable failures. Key, budget and auth text still decides first.harness.errorspan becomes a failure note for the judge (kind, message, HTTP status, retries). Until now it was dropped as the harness's own span.failed_wakemessage names its kind.harness_notelines carry the failure, the index gets an error line for it, and the record listsharness_failures. The failure's message stays in the note's text, which moves to a side file when long, so the line keeps toLINE_CHARS.error_type.Effect on other harnesses
Under always_on, any harness that already sends
infra_errornow fails the step where it used to score 0. That covers Pi'spi.model_error, OpenHands, Pydantic AI HTTP errors and framework exceptions. Their time-limit codes areagent_error, so time limits don't change.Overlap with open PRs
agent_prompt_response_verifier._judged. Its hunks sit near the new early return but not on it.Not in this PR
rubrics_verifierstill scores aninfra_errorprompt response 0, and averifier_idsaggregate whose sources all skipped still scores 0, as doesagent_prompt_response_verifier. Under always_on no verifier sees such a run (the step fails first, and the default retry redoes it), so changing them would only move other tasks' scores; that belongs in its own PR.user_sim_errordoesn't raise the same way.PriorAttemptIncomplete) and the run replays from the deploy step, rather than running the agent again in the world it already changed.How it was tested
from_dictstill runs as an episode). The same tiers: 6,777 passed. Each of five fixes was undone in turn, and a test failed each time.ruff check .is clean, and the plugin API check finds no break.test_always_on_default_retryand 2 new inepisode/spec_test.tst/unit/task_step,tst/unit/task,tst/unit/bundle,tst/unit/runnerandtst/unit/openenv: 6,775 passed, leaving out the 2 files that fail only on macOS (below). Each of the four fixes was undone in turn, and a test failed each time.ruff check .is clean;check_plugin_api.py --base origin/mainfinds no break to the plugin surface.test_always_on_default_retry.tst/unit/task_step,tst/unit/taskandtst/unit/bundle: 6,729 passed and the same 6 local failures as below (the test of the reverted tolerated-run skip is removed).ruff checkis clean.test_always_on_default_retry).tst/unit/task_step,tst/unit/taskandtst/unit/bundle: 6,420 passed and 6 failed, the same 6 local failures as below.ruff checkis clean.tst/unit/task_stepandtst/unit/task: 5,098 passed and 6 failed. 4 are thecomputer_exec_test.pymacOS failures below. 2 aretest_mcp_cli_builder.pycodegen tests whose generated script runs under the system Python, which has noclickhere.ruff checkis clean on the verifiers.outcome_test,test_always_on_agent_verifier,test_always_on_graded,test_always_on_wake_limit,test_turn_events,test_always_on_staging,test_rubrics_verifier_infra_error).ruff checkis clean on the changed files.tst/unit/task_step,tst/unit/taskandtst/unit/bundle: 6,411 passed and 4 failed. The 4 are incomputer_exec_test.py, which this PR doesn't touch; its shell command exits 127 on macOS.🤖 Generated with Claude Code
Confidence Score: 5/5

The PR appears safe to merge; no new blocking issue was found.Summary
Infrastructure-failed
always_onruns are recorded, then fail before grading. Eligible tasks retry once from their environment deployment.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Resolve seeded steps] --> B[Compute this run's retry defaults] B --> C[Run always_on] C --> D{Infrastructure failure?} D -- No --> E[Continue to grading] D -- Yes --> F[Save run evidence and raise] F --> G{Retry available?} G -- Yes --> H[Roll back from environment deployment] H --> C G -- No --> I[Fail run]Reviews (17) · Last reviewed commit: "fix(always_on): a seeded run works its d..." · Reviewed by Greptile