Repository navigation
feat(task-steps): always_on and the live follow keep a prescribed run's atif/1 copies, and always_on's judge grades them - #890
Merged
earakely-scale merged 11 commits intoNov 23, 2026
Conversation
…ectory when the run prescribes it, and its judge stages it always_on prescribes the run's formats and reads each wake's and nudge's trajectory through AtifCopies, inline within its one fetch cap: the atif/1 copy when prescribed and offered, else, or when the copy can't be had or lacks media, native. Every turn records what its url holds (target_agent_per_turn_trajectories), and in a prescribed run each turn's end names its index and format in the timeline, since its turns share one url. always_on_agent_verifier stages an atif/1 wake from its own task's events (turn_events.atif_turn_events, the shapes a native Claude Code turn gives), keyed by document and task, and reads no harness settings from a copy. A run that prescribes nothing is unchanged, and the judge-input pin gains an always_on atif/1 case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ve, its media pulled as the pages come The live follow of a prompt step whose copy replaces native reads atif/1: each poll's new closed root steps are a page, the document's header is stored beside the page where it changed (versioned, so the greatest is the latest), each sub-agent's new steps and header go under sub/<id>/, and meta.json names the versions, the document's ids and the folder its media resolve in. Each page's media are pulled between polls into the run's atif folder through the copies' own record of what it holds, so the turn's copy asks for none of them again; nothing is pulled once the turn's drain starts. A turn the agent refuses atif/1 before any page was stored is followed natively; one refused after ends with end.json naming why, so a turn's pages never mix formats. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
@greptileai review |
…vent, not a sleep The live media test failed on a loaded Linux runner: no poll fell in the 0.5 s pause, so the first screenshot's page came in the drain, which pulls nothing. The agent now holds its turn until the follower has pulled a page's media (the header test: stored a page), at most 30 s, so the mid-turn page is certain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale
marked this pull request as ready for review
November 23, 2026 18:08
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rted, not ending at the first 404 Before any page is stored, an atif/1 cursor read the agent answers 404 is a copy that hasn't started yet, so the follower reads it again until the turn ends rather than treating the task as gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sarah-chitty-1
approved these changes
Nov 23, 2026
sarah-chitty-1
left a comment
Collaborator
There was a problem hiding this comment.
Looks good. It's opt-in, and unprescribed runs are unchanged: the PSI neutral harness doesn't offer atif/1, so its always-on wakes still read native. Two things before always-on runs prescribe atif/1:
- A copy that hits the 120 s cap leaves the wake with no trajectory.
AtifCopies.readrecords itunavailable/timeoutwith no url and no native read in its place, and the media pull counts against the same cap. Wakes with lots of screenshots, which the neutral harness now sends (v8+), or with browser recordings, are the likeliest to hit it, and the judge then grades without that wake. Could it fall back to native on a separate short budget, or finish the read in the background and fill in the url, the way #854 does for prompt steps? atif_turn_eventsonly knows Claude Code-shaped events: text, thinking, tool calls, sub-agents and the final message. There are no compaction summaries (or who wrote them), no harness messages (save request, after summary, failed wake), and no flag for harness-internal tools like memory and history search. That's fine while only Claude Code offers atif/1. A harness that compacts (the neutral harness, or Claude Code with its own compaction) needs these in the profile before it opts in. Otherwise the judge counts memory writes as actions and loses the summaries, and for native traces a missingwritten_byalready makes a run ungradable.
Small: the tests are all Claude Code. One always-on test with a native-only agent that has the trajectory extension, as the neutral harness does, would check the "unchanged" claim directly.
…iveAtif, and the judge's shared atif/1 helpers are public The live follow's fallback format, media pull and media folder were four arguments threaded through four layers, and LiveTurn took eleven positional ones; they're one LiveAtif now, built once by prompt_agent, and LiveTurn takes keywords. The page writer cancels its own media pulls (cancel_pulls). turn_events no longer imports atif_turns' private helpers: content_text, steps_of, calls_with_results and SubAgents are public. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…8-y4-pr3-always-on-live # Conflicts: # src/agent_env/task_step/task_steps/always_on.py
…e's path, and fills it in when the run ends A wake no longer waits for its copy: the copy is read in the background, as prompt steps read theirs, and the run's end fills in each turn's url, record and timeline fields, giving the copies still going one trajectory fetch cap more (none when the step is cancelled). A copy still going then is recorded unavailable, timeout. Native reads stay inline. AtifCopies.join takes that timeout, and its inline read is gone. A run that prescribes atif/1 to an agent offering only native now keeps an unprescribed run's timeline: the turn fields name a turn only when the run's turns share a copy's url. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…compacted between its turns Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ts turns, pinning what its copy lacks The compacted scenario, recorded through the agent's image on the pinned CLI with atif/1 prescribed: a turn of work, a /compact turn, and a turn that reads what the summary kept. The turns around the compaction give a judge the same events from the copy as from native. The /compact turn's copy lacks what native stdout gives as notes (the summary and "Compacted") and a step for the call that wrote the summary, so its token counts leave that call out, though its cost counts it. Both are pinned until the copy has a compaction step (FD-6916). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…its end failed before joining them A run's end that raised before it joined its copies (a failed clock read, say) left them reading and writing after the step had exited; the run's close now cancels any still pending. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Thanks for the review. All three are addressed in this PR:
Re-run on a test host:
|
earakely-scale
deleted the
edgararakelyan/fd-6078-y4-pr3-always-on-live
branch
November 23, 2026 23:30
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.
Y4 PR 3 of 3 for FD-6078. #854 made a prescribed run's prompt-step turns read and store their
atif/1copies. This PR does the same for always_on and the live follow, and teaches always_on's judge to read those copies. A run that prescribes nothing is unchanged. Closes FD-6078.Since the first review
compactedscenario: a turn of work, a/compactturn, then a turn that reads what the summary kept. It found a gap, which is pinned here and is that follow-up's first case (S2b)./compactturn's copy lacks what native gives the judge as two notes, the summary and "Compacted".cut_offfield and this PR's turn fields.LiveAtifrather than four arguments through four layers. The judge's shared atif/1 helpers inatif_turnsare public.What changes
always_on (
task_steps/always_on.py)TRAJECTORY_FETCH_SECONDS, 120 s), or none when the step is being cancelled. A copy still going then is recordedunavailable,timeout, with no url. Native reads stay inline within the same cap as before, sowake_reserve_secondsdoesn't change.target_agent_per_turn_trajectories), on every run, as prompt_agent has since feat(task-steps): prompt steps read each turn's native trajectory by name and record its format #843.agent_turn_endandnudgeevent also names itsturnindex andtrajectory_format. Any other run's timeline is byte-identical to before, a run prescribing atif/1 to an agent that offers only native included.always_on's judge (
verifiers/always_on_agent_verifier.py,judge_utils/turn_events.py)turn_events.atif_turn_events(view)gives an atif/1 turn's events in the shapes a native Claude Code turn's take. That covers:subagentwith the call that started it;<document url>#<task id>. The key is never written into the judge's files.assistant_harnessreads no settings from it. That matches what a native Claude Code turn gives.The live follow (
a2a_agent/trajectory_follower.py,snapshot_utils/live_trajectory.py,prompt_agent.py)<after>-<next>.<n>.header.json(the greatest is the latest), not on every page. Each sub-agent's new steps and changed header go undersub/<id>/, nested ones too.media_base, the folder itsmedia/paths resolve in. The latest header with every page's steps is a prefix of the turn's stored copy.end.jsonnaming why (stopped), so a turn's pages never mix formats.Decided with Edgar (2026-11-23)
harness.*labels offer no atif/1 today, so they stay native. Nothing harness-specific is added.Choices to review
AtifCopies._heldwith the end-of-turn pull. Two pulls racing on one file at worst ask for it twice, and the store check counts it as held either way.Testing
Unit, always_on (
test_always_on_trajectory_formats.py):unavailable,timeout, with no url;format_not_offered, and names no turn;The three new tests fail on the commit before each.
Unit, the judge (
test_always_on_agent_verifier.py,test_claude_code_atif_recorded.py):compacted, recorded for this PR, the same holds but for the compaction turn's two notes and its summary call's tokens, which the tests pin.The judge-input pin gains
always_on_atif_staged. Its existing cases don't change, and the golden diff only adds that case.Unit, the live follow (
test_prompt_agent_live_atif.py, against a live SDK agent in process):The tests for the new behaviour fail on main.
Related unit folders.
task_step,a2a_agent,agentsand the protocol suite pass: 7,937 tests. The four failures are the known Mac-onlycomputer_exec_test.pyones.Live chaos (kept outside the repo).
Real runs with Claude Code on a test host (live follow on, atif/1 prescribed). In each, every live step equals the stored copy's step of that id, and the latest header matches the copy's.
A real always_on run with Claude Code (Sonnet), atif/1 prescribed, on a test host. The task is a support-chat world with a simulated user, end-state and process judges, and a satisfaction rating.
valid, and every judge graded.After Sarah's review, a second round on a test host (1914bd4 plus the recorder, about $4.80):
valid. Each turn's url, record and timeline fields were filled in when the run ended, with none missing.The live tests hold the agent's turn on an event, not a sleep (6bd02f0). The first version's media test failed on CodeBuild's loaded runner: no poll fell inside its 0.5 s pause.
🤖 Generated with Claude Code


Confidence Score: 5/5
The latest changes appear safe to merge, and the previous copy-cleanup issue is fixed.Summary
The PR adds
atif/1copies toalways_on, teaches its judge to read each turn, and follows prescribed copies live.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Agent turn ends] --> B[Read copy in background] A --> C[Continue run] C --> D[Finish run] D --> E[Join copies and fill turn records] E --> F[Store timeline and response] D -->|Finish raises early| G[Outer cleanup] F --> G G --> H[Cancel remaining copies]Reviews (13) · Last reviewed commit: "fix(task-steps): always_on cancels the a..." · Reviewed by Greptile