Repository navigation
fix(always_on): an infra-failed turn is redone from its env deploy instead of scoring 0 - #933
Open
sarah-chitty-1 wants to merge 8 commits into
Open
sarah-chitty-1 wants to merge 8 commits into
sarah-chitty-1 wants to merge 8 commits into
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>
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.
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 (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. It's kept in seeded runs. A task's ownretry_configreplaces it. The default isn't written into the stored task (RetryConfig.implied), so stored tasks and bundle hashes don't change. Every always_on task on the hub (48 PSI tasks, 2 others) has noretry_configtoday.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
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 failures in
always_onare recorded, then fail the step so it can retry without receiving a grade.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Agent turn ends] --> B{Infrastructure failure?} B -- No --> C[Keep existing grading behavior] B -- Yes --> D[Save run evidence] D --> E[Raise AgentTurnInfraError] E --> F{Retry configured and available?} F -- Yes --> G[Roll back and redeploy] G --> A F -- No --> H[Fail run without grading]Reviews (8) · Last reviewed commit: "fix(always_on): imply the default retry ..." · Reviewed by Greptile