Repository navigation
fix(always_on): a failed wake ends only that wake; the whole run is judged - #981
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>
… is judged A turn that fails as the agent's own failure (error_type agent_error, or anything but infra_error) no longer ends the multi-day run. It is recorded (a turn_failed timeline event, and the record's failed_turns with its error_type, error_code and message), what it sent the user is taken as any wake's is, and the run goes on to its next wake, check or user message, the prompt response keeping no error_type. - Infra failures keep #933's behaviour: the run ends as agent_turn_infra_error and the step fails with AgentTurnInfraError. - FAILED_TURNS_IN_A_ROW_MAX (3) failed turns in a row end the run as agent_turn_failed, so a dead agent can't spin through every scheduled wake. A completed or cut-off turn starts the count again. - A turn agent-env gave up waiting on (agent_turn_timeout) still ends the run: no terminal state says it stopped, so a next wake would share its session and world with it. - A run that ended on its agent's own failure (AGENT_FAILURE_ENDS) is judged as a whole, not skipped: always_on_agent_verifier (via a rubrics_verifier hook), user_sim_judge, agent_prompt_response_verifier and rate_user_satisfaction. env_outcome never skipped. A run the user sim or the step broke is still scored 0 unjudged. - The record reports early ends per run: failed_turns, counts.failed_turns, counts.failed_turn_kinds (by error_code, else error_type) and reached_scheduled_end. The judge's wake-by-wake text and the staged index say which turn failed and whether the run went on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…th an error After a failed turn the run went on from, the next wake opens with the step's own note (FAILED_TURN_TEXT), as it does after a cut-off (CUT_OFF_TEXT). It is the same for every harness and failure kind and never carries the error's text, which can name the infrastructure. It is recorded as the cut-off note is: failed_turn_notice on the wake event and the staged "woke" line, told_in_wake on the failed turn's entry, and the judge's index says it is the run's note, not the user's words. 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>
…reaches staging, never "No trajectory available" A turn agent-env gave up waiting on returns before its trajectory is read, so a run whose opening wake timed out stored none; with use_trajectory, rubrics_verifier then raised "No trajectory available" (and _compact_trajectory would again) instead of judging the run #981 now judges. The same held for a run its failed turns in a row ended, and for one that went on after failed turns (ended at its wake cap, no error on its response), whenever none stored one. rubrics_verifier gets a hook, _judges_without_trajectory (never in the base): when it says so, a run with no trajectory skips the guard and the single-file compaction and goes to stage_trajectory, refused still if nothing was staged. always_on_agent_verifier says so for a run with any failed turn of its agent's own; each such wake is staged from the run's record with a trajectory_missing line and named in the judge's prompt. A run that failed no turn and stored none is still refused. Staged by position (no timeline kept), the turn agent-env gave up waiting on, sent but with no per-turn trajectory entry, is now staged as a turn whose trajectory is missing instead of left out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🤖 Automated Claude routine — Env Pod PR Context Review. This is a bot, not Edgar Arakelyan; not a human review. Stack context: this branch predates 91a2a16 on its base (#933), which removed the infra-error skip this PR still builds on.
What happens on rebase:
GitHub shows the textual conflict already. The point here is that the conflict is also semantic. Generated by Claude Code |
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>
…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>
…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>
…limit With continue_after_wake_limit on, _limit_reached knew only Claude Code's words for the tool-call limit, so the PSI neutral harness's turn cap (v14: error_code psi.turn_cap, the Agents SDK's "Max turns (N) exceeded") was a failed turn, counted towards FAILED_TURNS_IN_A_ROW_MAX and told with FAILED_TURN_TEXT. Either the code or the words now cut the wake off at the tool-call limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d_turns existed doesn't raise A run recorded before #981 has no failed_turns, so _judges_without_trajectory found none and a use_trajectory judge raised "No trajectory available" for a run that ended on a turn agent-env gave up waiting on, where it used to write a prompt_error row. A run whose end is one of AGENT_FAILURE_ENDS failed a turn whatever its record lists, so it is judged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ges is skipped, not 0 An infra-failed always_on run is left ungraded by its judges, but a verifier_ids aggregate over them pooled no rows and scored 0, so PSI's psi_verdict and rubric_satisfaction still counted the failure against the model. In a run of an always_on step, an aggregate whose every source was skipped is skipped too, naming each source and its reason; one with some skipped pools the rest and lists the others in skipped_sources. A run with no always_on step (prompt_agent) pools as on main. Tests use the PSI task's own verifiers and aggregates (tst/data/psi_always_on_verifiers.json, its criteria cut to placeholder rows). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… failed; one place for how a run ended Review findings on #981: - always_on_agent_verifier._judges_without_trajectory let a run that stored no trajectory at all be judged whenever any turn failed, or whenever the run ended on its agent's own failure. A run with turns that ran and lost their trajectories to a config or extension problem, plus one failed wake, was judged with every wake's tool calls missing instead of refused and redone. It is now judged so only when every turn, each wake's and each nudge's, is a recorded failed turn. A record from before failed_turns existed counts its ending turn as its one failed turn. - ALWAYS_ON_KEY, AGENT_FAILURE_ENDS and ended_on_agent_failure move to a leaf module, always_on_ends, which the verifiers, aggregate_verifiers and rate_user_satisfaction import at module level. This replaces the lazy-import wrappers in agent_prompt_response_verifier and user_sim_judge, user_sim_judge's copy of the key, aggregate_verifiers' lazy import and rate_user_satisfaction's inline check. - The staged index gave a failed wake turn two error lines (turn_end's "its turn ended failed" and turn_failed's). A wake with a turn_failed line now gets only that one. A run without one (by position, or recorded before turn_failed existed) keeps turn_end's. - _stopped_turn's docstring no longer says any other failure ends the run. - _cut_off uses the same error-message cap as a failed turn (TURN_ERROR_CHARS, was FAILED_TURN_ERROR_CHARS), not a literal 300. - _failure is renamed _record_failed_turn. - Golden cases: the always_on judge on runs that ended on agent_turn_timeout and agent_turn_failed, and user_sim_judge on one that ended on agent_turn_failed. 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>
…-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>
…-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>
…-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>
|
Re the Env Pod context review above (written against 1334eac): resolved by design, not by picking a side. The generic path keeps main's (#933's) behaviour: 🤖 Addressed by Claude Code |
…lter Two conflicts, both in module docstrings, resolved to keep both sides: - always_on_agent_verifier.py: #980's paragraph on the strict thinking rule (stages_thinking) stays, followed by #981's paragraph on wakes with no stored trajectory and _judges_without_trajectory. - always_on_staging.py: the wake file list keeps #980's "thinking when ... the judge's trajectory filter asks for it (stages_thinking)" and adds #981's turn_failed line. The code of both merged cleanly: #981's failed-turn judging, its no-trajectory rule and turn_failed lines, beside #980's stages_thinking, the settings warning and the files note. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…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>
… like guard and compaction "failure" (#981) is an identity field, so fit moved none of its parts in its first pass: a failed wake whose failure held a long part (what was running) moved the note's text to a file first, and the long part only went in the last step. _IDENTIFYING_PARTS now names failure's kind as what says what the note is; fit moves its other parts like the line's own fields, longest first, so the text the judge reads stays in the line. The comment saying failure "stays inline" now says how it does. Test: test_a_failure_note_keeps_its_kind_and_its_text_inline_while_a_long_part_of_its_failure_moves_aside (failed before: the note's text had moved). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts, each resolved so #980's thinking filter, #981's failure notes and this branch's guard notes and line-limit guarantee all survive: - always_on_staging.py: the module docstring says a turn's thinking is staged only when the judge's filter asks for it (stages_thinking) and that a harness_note can carry failure or guard; the stager keeps #980's thinking, thinking_left_out and as_recorded beside guard_actions and shown; the record keeps thinking_left_out and thinking_unfiltered_wakes beside context_guard_actions and results_shown_not_whole. - test_always_on_staging.py: imports both TrajectoryFilter (#980) and TurnEvents (this branch). - tst/data/verifier_golden/judge_inputs.json: always_on_staged and always_on_atif_staged re-recorded on the merge. Against main they differ only by this branch's text: the prompt by 198 characters (the files note's preview and line_file sentence, "at most the first 300") and index.md by 163 (its header sentence). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Built on #933, which is now merged into
main. This PR has mergedmainsince (dbbc03f1), so its diff againstmainis its own changes only.Merge order with #980. This PR and #980 (
sarahchitty/always-on-judge-thinking-filter) conflict inalways_on_agent_verifier.pyandalways_on_staging.py. This PR merges first. #980 then mergesmainwith this PR in it, resolves the two files, and must re-run its tests before it merges.What was broken
In the always_on step, one failed wake ended the whole multi-day run. The judges then skipped the run, or scored it 0 without reading it. Hark's audit found 43 of 210 graded runs ended early this way. Those runs averaged 0.11 rubric satisfaction, against 0.65 for runs that finished. In one example, a turn cap in wake 1 of a 10-day task scored 0.
What each failure kind does now
agent_error, a crash, canceled, rejected, a turn cap withcontinue_after_wake_limitoff): only that wake ends. The failure is recorded and the run goes on to its next wake, check or user message. The prompt response keeps noerror_type.infra_error, an agent that stopped answering): as in fix(always_on): an infra-failed turn is redone from its env deploy instead of scoring 0 #933. The run ends asagent_turn_infra_error, the step fails withAgentTurnInfraError, and the run is redone. If the task goes on past the failed step (fail_task_on_erroroff), the always_on judge and the response check now leave the run ungraded (a skip, no score). They no longer score it 0 with aprompt_errorrow. An aggregate over those judges (aggregate_verifierswithverifier_ids, such as PSI'spsi_verdictandrubric_satisfaction) is skipped too, so the headline score isn't 0 either. Aprompt_agentturn'sinfra_errorstill scores 0, as onmain, so no other task's score moves.error_codepsi.turn_cap, the Agents SDK's "Max turns (N) exceeded"): withcontinue_after_wake_limiton, it is a cut-off at the tool-call limit, as Claude Code's wording is. It is not a failed turn.agent_turn_failed. The run is still judged.agent_turn_timeout) still ends the run. It is now judged, not skipped.Since the review
91a2a169,bf8e40c6,fe36f38dand its revert1f220a67. Inrubrics_verifier, fix(always_on): an infra-failed turn is redone from its env deploy instead of scoring 0 #933's removal of the genericinfra_errorskip stands, and the skip for an infra-failed always_on run lives inalways_on_agent_verifier(_not_graded_reason).verifier_idsaggregate whose every source was skipped is now skipped, naming each source and its reason. One with some sources skipped pools the rest and lists the others inskipped_sources. fix(always_on): an infra-failed turn is redone from its env deploy instead of scoring 0 #933 had left this aggregate as onmain, where pooling no rows scores 0. A run with no always_on step, such as aprompt_agentrun, still pools exactly as onmain.agent-env task run --start-stepwith its old context) no longer raises "No trajectory available" when its one turn is the one that failed. Its record has nofailed_turns, so a run that ended asagent_turn_failedoragent_turn_timeoutcounts its ending turn as its one failed turn.Since the second review
A run with no trajectories is judged only when every turn failed. With
use_trajectory,always_on_agent_verifierjudged a run that stored no trajectory at all whenever any turn failed, or whenever the run ended on its agent's own failure. So a 20-wake run that lost every trajectory to a config or extension problem, plus one failed wake, was judged with 20 "trajectory missing" lines and scored low. It should have been refused and redone. Now it is judged so only when every turn, each wake's and each nudge's, is a recorded failed turn. Any other run that stored no trajectory is refused, asrubrics_verifierrefuses one.One place for how a run ended.
ALWAYS_ON_KEY,AGENT_FAILURE_ENDSandended_on_agent_failuremove to a leaf module,always_on_ends. The verifiers,aggregate_verifiersandrate_user_satisfactionimport it at module level. This replaces:agent_prompt_response_verifieranduser_sim_judge;user_sim_judge's own copy of the key;aggregate_verifiers' lazy import of the key;rate_user_satisfaction's inline check.ended_on_infra_failurestays inalways_on, beside fix(always_on): an infra-failed turn is redone from its env deploy instead of scoring 0 #933'sAGENT_TURN_INFRA_ERROR, soagent_prompt_response_verifierstill reaches it through one lazy import.One error line per failed turn in the staged index. A failed wake turn had two:
turn_end's "its turn ended failed" andturn_failed's own. Now a wake with aturn_failedline gets only that one. A run without one, staged by position or recorded beforeturn_failedexisted, keepsturn_end's.Merged fix(always_on): an infra-failed turn is redone from its env deploy instead of scoring 0 #933's new head,
91ae270e. It moves implied retries off the step objects intoTask(implied_retries=...)andTask.retry_config_of(step), so an episode's copy takes no default retry.AGENTS.mdconflicted. The resolution keeps this PR's account of anagent_errorturn and takes fix(always_on): an infra-failed turn is redone from its env deploy instead of scoring 0 #933's sentence on the default retry, worded as "a failed step". Under this PR anagent_errorrun no longer fails its step. None of this PR's code readsstep.retry_config, so nothing else needed to move toretry_config_of.Merged fix(always_on): an infra-failed turn is redone from its env deploy instead of scoring 0 #933's
7098a184, cleanly. A Task now keeps each step's default retry in its own dict, so a task never changes the steps it shares with another.Task.from_dictstill puts the default on the steps it builds, for the hub worker. Still nothing in this PR readsstep.retry_config.Merged fix(always_on): an infra-failed turn is redone from its env deploy instead of scoring 0 #933's final head,
26ae0f92, cleanly. Seeded steps no longer lose their default retries. Still nothing in this PR readsstep.retry_config.Merged
main(dbbc03f1) once fix(always_on): an infra-failed turn is redone from its env deploy instead of scoring 0 #933 landed there, squashed. Five files conflicted because the squash re-applies fix(always_on): an infra-failed turn is redone from its env deploy instead of scoring 0 #933's changes against the old base:AGENTS.md,always_on.py,always_on_staging.py,test_always_on_graded.pyandtest_always_on_wake_limit.py. Main's versions of those files match fix(always_on): an infra-failed turn is redone from its env deploy instead of scoring 0 #933's final head, which this branch had already merged. So each was resolved by a three-way merge with26ae0f92as the base. That kept this PR's changes and added only main's later change: feat(task-step): add prompt_agent's context_window, the auto-compaction window OpenCode and pi honour #995'scontext_windowlines inalways_on.py. The merged tree differs frommainby exactly this PR's own changes.Smaller fixes:
_stopped_turn's docstring no longer says any other failure ends the run._cut_offuses the same error-message cap as a failed turn.FAILED_TURN_ERROR_CHARSis renamedTURN_ERROR_CHARS, and the literal 300 is gone._failureis renamed_record_failed_turn.The cap of 3
One failure is the case a run should survive. The harness can recover: the PSI neutral harness writes the next wake a note and compacts. A second failure in a row can still be the same condition clearing. A third means two chances to recover are gone. Ending there stops a dead agent spinning through every scheduled wake, each of which can cost up to
timeout_secondsof the budget. A completed turn, or one cut off at a limit, starts the count again. The cap is a module constant,FAILED_TURNS_IN_A_ROW_MAX.Why agent-env's own timeout still ends the run
No end state says the turn stopped, so it may still be running. A next wake would share its session and its world. Its tool calls and app changes would land in another wake's record. With
continue_after_wake_limiton, the step still cancels such a turn and goes on once the agent confirms it stopped, as before.Verifiers that now judge these runs
A run that ended on its agent's own failure is judged as a whole, and its failed turns count against the agent.
always_on_agent_verifier, through a newrubrics_verifierhook,_judges_failed_run.user_sim_judge.agent_prompt_response_verifier.rate_user_satisfaction.env_outcomenever skipped.A run that the user sim or the step broke is still scored 0 without being judged. A plain
rubrics_verifieron aprompt_agentturn is unchanged.New record fields and the step note
metadata["always_on"][step_id]gains:failed_turns: each failed turn's wake, turn,error_type,error_code, message,went_onandtold_in_wake.counts.failed_turnsandcounts.failed_turn_kinds, keyed byerror_code, elseerror_type.reached_scheduled_end, true forend_time,user_doneandfinished_nothing_pending.turn_failedevent for each failed turn.failed_turn_noticeon the wake event and on the stagedwokeline.Tests
tst/unit/task_step/test_always_on_failed_turns.py, 25 tests. Every new test fails against the base source.test_user_sim_judge.py,user_sim_judgejudges a run ended by the cap.test_user_sim_satisfaction.py,rate_user_satisfactionrates a run ended by the cap.prompt_errorpath through a user-sim error, and only its message changed. Three cases are new, so judging these runs is still covered: the always_on judge on a run that ended asagent_turn_timeout, the same on one that ended asagent_turn_failed, anduser_sim_judgeon one that ended asagent_turn_failed.fail_task_when_not_passing. Aprompt_agentturn'sinfra_errorstill scores 0. v14's turn cap is a cut-off: by its code and words, by its code alone, and by the SDK's words from an older harness. A run recorded beforefailed_turnsexisted is judged withuse_trajectorywhen its one turn is the one that failed.test_always_on_psi_aggregates.pyruns the PSI task's own judges and aggregates (tst/data/psi_always_on_verifiers.json, criteria cut to placeholder rows) on an infra-failed run:psi_verdictandrubric_satisfactionare skipped, not 0. It also checks a partly skipped aggregate and that a run with no always_on step pools as onmain.tst/unit/task_stepplus the other always_on-touching unit tests (agents/claude_code,bundle,cli,env/gateway/triggers_fires_test.py,task,training), on the merged head: 7801 passed, 6 failed. The 6 also fail on the base branch:computer_exec_test.py(4) andtest_mcp_cli_builder.py(2).test_always_on_failed_turns.py. Each fails against6c7cb2b1:use_trajectoryand no trajectories, a run with a turn that ran plus a failed turn is refused. Three cases: a failed turn the run went on from, a turn agent-env gave up waiting on, and the same re-graded from a record with nofailed_turns.8f6cc28f(after mergingmain),tst/unit/task_step,tst/unit/task(episodes included) and the same other always_on-touching unit tests: 5685 passed, 6 failed. They are the same 6 as above.ruff checkis clean.🤖 Generated with Claude Code
Confidence Score: 5/5

The PR appears safe to merge; no new actionable issues were found.Summary
Failed agent turns now end their wake rather than the whole
always_onrun. Three consecutive failures still end the run, which remains eligible for judging.Review checks were source-based; no tests were run during this review.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Agent turn ends] --> B{How did it end?} B -->|Completed or allowed cut-off| C[Reset failure count] C --> D[Continue run] B -->|Agent failure| E[Record failed turn] E --> F{Three consecutive failures?} F -->|No| D F -->|Yes| G[End run and judge it] B -->|Unconfirmed timeout| G B -->|Infrastructure failure| H[End run and fail step] H --> I[Retry or leave ungraded]Reviews (12) · Last reviewed commit: "Merge origin/main (dbbc03f1) into sarahc..." · Reviewed by Greptile