Skip to content

feat(task-steps): prompt steps keep each turn's atif/1 copy as its trajectory when the run prescribes it, and judges grade it - #854

Merged
earakely-scale merged 16 commits into
mainfrom
edgararakelyan/fd-6078-y4-atif-copies
Nov 23, 2026
Merged

earakely-scale merged 16 commits into
mainfrom
edgararakelyan/fd-6078-y4-atif-copies

Conversation

@earakely-scale

@earakely-scale earakely-scale commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Y4 PR 2 of 3 for FD-6078. When a run prescribes atif/1 (Y16, #849) to an agent that offers it, each prompt-step turn's atif/1 copy is the turn's trajectory. It fills the trajectory fields readers already use, labelled atif/1, and the run's judges grade it. The requested format is best effort: a turn whose copy can't be had gets its native trajectory read in its place. A run that prescribes nothing is unchanged, byte for byte. Refs FD-6078, which stays open for PR 3 (always_on and the live follow).

What changes

The trajectory (task_step/snapshot_utils/atif_copies.py, prompt_agent.py)

  • Prescribed, offered: no native read.
    • Once a turn ends, a background job reads its atif/1 copy inline ({task_id, format}) and stores it, then the media.
    • The turn's entry in target_agent_per_turn_trajectory_object_urls is the copy's document, and agent_trajectory_object_url is the last turn's.
    • The turn's record in target_agent_per_turn_trajectories is {format: "atif/1", atif: AtifRecord}.
    • The next message never waits for this, and the step joins the jobs before it appends its prompt response.
  • Best effort (Y4-10). A turn whose copy is unavailable gets its native trajectory read at once in the same job, while the agent still holds it, labelled native. If that read fails too, the turn has no url, as a failed native read leaves it today.
  • Missing media (Y4-13). A copy whose media didn't all arrive (media-bytes) would have its judges grade the turn without those files, screenshots among them. Its native trajectory, which holds them, is read in its place the same way. The record keeps the copy's status, rules and url. If native can't be read either, the copy stays the turn's trajectory.
  • An agent whose card doesn't offer atif/1 stays native on each turn's path, as today: every shipped agent but Claude Code, which serves it since feat(agents): Claude Code serves atif/1, built live from its stream-json and session transcript #872. Its records say unavailable, format_not_offered.
  • Not prescribed: exactly today's reads and fields, with atif: None.
  • An invalid or newer copy with all its media is still the turn's trajectory and is graded as stored.

Storage, unchanged from the earlier review rounds

  • One <trajectory_id>.json per conversation in the run's folder ({prefix}atif/instance_id=<id>/<agent>/, recorded in metadata["atif_copies"]), overwritten each turn, so a conversation's turns share one url.
  • The aux log and turn context under turns/<message id>/.
  • The media pulled into media/.
  • Restarts linked by continued_trajectory_ref.
  • The validator's findings in each record.

Per-turn records (task_step/context.py)

Judges read each turn by its label (verifiers/judge_utils/atif_turns.py, rubrics_verifier.py, env_outcome_verifier.py)

  • Picking the turn. An atif/1 turn is read as its own A2A task cut out of the conversation's document (agentenv_protocol.atif.task_document), a document ATIF's models load: steps numbered from 1, the root's sub-agents it reaches kept (and those a kept one reaches, from any depth inside it), final_metrics dropped. A reference resolves as the validator resolves it: by where it sits, in its own trajectory's sub-agents, else the nearest around it, and the judges' walkers follow the same rule. Each document is read once per judge. In a copy without the profile, which is valid ATIF with no task ids, the turn is the task ending at its record's through_step. A copy neither finds it in is graded as stored.
  • Media. Media resolve only in the document's folder, as media/<64 hex>.<ext>, each checked against its name. A missing or mismatched file is logged and skipped.
  • Rubric judges:
    • The agent judge gets a folder per run with turn_NN.json per turn and media/ beside it, plus a note on what the files are.
    • The direct judge gets each turn's view under the same ===== Turn i ===== markers.
    • The DEFAULT filter has an ATIF compaction with compact_otel_trajectory's event shapes. A sub-agent's events name it (subagent), as does the result that started it (starts_subagents), so a judge tells them from the main agent's, as a native Claude Code turn's parent_tool_use_id lets it.
    • The SCREENSHOT filter and per-criterion evidence build a transcript from tool calls and result images, a sub-agent's included, each frame typed by its bytes.
    • grade_up_to_turn cuts the records with the urls, so no later turn leaks.
    • In a mixed response, each turn is read by its own label.
  • Staging hashes each media file as it streams and keeps no bytes.
  • Tool definitions. A view names the tools its agents were offered, as a native turn does, without their descriptions and schemas. An agent with an adapter writes agent.tool_definitions (Claude Code since feat(agents): Claude Code serves atif/1, built live from its stream-json and session transcript #872), and a task with many MCP servers offers hundreds of tools: tens of thousands of tokens in every turn's view.
  • env_outcome. trajectory gives an atif/1 turn's view in the same list as today's native entries. A new opt-in trajectory_formats keyword gives each turn's label.
  • Native unchanged. A response with no atif/1 turn takes today's code, byte for byte.

Also

  • The protocol adds task_document, tasks_document, media_refs, StoredMedia (a third media= form) and validate_media. The validator's reference resolver moves into the reader, where the cut uses it too. The worker's media check uses the protocol's.
  • always_on prescribes native only (formats=()) until PR 3 makes it store and grade atif/1 copies (Y4-11).
  • The snapshot series keeps an atif/1 url out of its native rows.
  • A staged extension call whose answer is lost still collects what the agent wrote, as a direct grant would; a call that never reached the agent collects nothing.
  • extension_error_code reads an agent's error code once and caps it.
  • AGENTS.md, the config template and the protocol README say what prescribing does.

Decided with Edgar

  • Y4-7. A run that prescribes atif/1 to an agent whose card doesn't offer it records unavailable, format_not_offered. atif: None is kept for runs that don't prescribe it.
  • Y4-8. The atif/1 read is inline, because the worker can't name <trajectory_id>.json before it reads the copy.
  • Y4-9. A prescribed run's trajectory is its atif/1 copy, and its judges grade it. Before this, the plan kept native for judges until Y13's A/B regrade.
  • Y4-10. The requested trajectory is best effort: native is the fallback, read at once.
  • Y4-11. This PR switches prompt steps only. always_on and the live follow stay native until PR 3.
  • Y4-13 (2026-11-22, from review). A copy that lacks some of its media falls back to native too.

Choices to review

  • Prescribing changes judge input and can move scores. It's opt-in per run, or machine-wide through [trajectories] formats, so setting it on a shared host changes every run there. The judge-input pin keeps native runs byte-identical and pins 14 new atif/1 cases.
  • Prescribed runs no longer store native. Y11's renormalize, Y14's offline conversion and the explorer's native views have nothing native to read for them. The Linear umbrella is updated to match.
  • One url per conversation. A turn's url names a document its later turns overwrite, and the judges cut each turn by its task. A reader that takes the url alone sees the whole conversation so far.
  • Records name format. The rename follows the field's new meaning: it labels what the url holds, which is no longer always native.
  • Readers outside agent-env. The hub, Snowflake queries and agentenvhub-sdk's Harbor publish read these fields under their legacy names. For prescribed runs they now get ATIF documents with no label beside them. Hub F3 (FD-6039) and FD-4465 are where they learn the label.
  • always_on prescribes nothing. If an earlier prompt step prescribed atif/1 to the same agent, always_on's conversations still build native only. Its judge reads PSI harness labels, which ATIF can't carry yet.

Testing

  • Unit, prompt steps (test_prompt_agent_atif_copies.py, 28 tests): the copy as the trajectory with no native read; an agent that doesn't offer atif/1; a refused prescription falling back per turn; one turn's failed copy falling back while the others keep theirs; both reads failing; plus the storage, media, link, validation and safety cases from earlier rounds.
  • Unit, judges (judge_utils/test_atif_turns.py, test_rubrics_verifier_atif.py): per-label dispatch; cuts by id and by step; a copy graded as stored; media safety; staging that keeps no bytes; frames typed by their bytes; sub-agent screenshots; the direct, agent, compacted, screenshot and per-criterion judges; grade_up_to_turn; mixed responses; env_outcome's entries and labels.
  • The judge-input pin. Its 18 native cases are unchanged, both as recorded and with native-fallback records. It adds 14 atif/1 cases. Against the base, the golden diff only adds cases.
  • Protocol. The protocol tests cover task_document, tasks_document, media_refs, StoredMedia and validate_media. The protocol suite passes: 2,067 tests.
  • Related unit folders. task_step, a2a_agent and the protocol suite pass locally, 6,467 tests. The 4 failures are the known Mac-only computer_exec_test.py ones. ruff check . passes.
  • Integration. test_prompt_agent_live_trajectory_local.py's prescribed test checks that the turn's url is the stored copy and its label atif/1, with the image stored beside it. Results from the test host are below.
  • Chaos (chaos_copies.py).
    • It checks that each turn's url and label match what it holds: the copy, or the native fallback for exactly the turns whose copy was unavailable. It also checks that an unprescribed run, or one with an agent that doesn't offer atif/1, reads native for every turn.
    • Planted bugs are caught, for example a step that still reads native every turn.
    • Locally, 40 s ran 1,002 seeds clean. Test-host results are below.
  • Workflows. A mapping workflow surveyed every reader of these fields, the judges, the turn loop and the Linear umbrella. An implementation-and-review workflow then built the judges' readers and checked them through three lenses (correctness, native byte-identity, safety), with a skeptic trying to refute each finding. It confirmed 8 findings, refuted none, and all 8 are fixed here with tests.
  • On the test host, at b42f02a7a: the integration file plus the verifier and atif-copies unit tests passed on Linux, 1,064 tests (103 s). 15 minutes of chaos ran 36,926 seeds clean: 73,701 steps and 147,321 turns, with 16,387 valid, 16,808 invalid, 3,654 newer and 36,436 unavailable records, 11,026 restarts and 1,295 links checked.
  • Greptile, round 1 on the rework (a5a2fb752). Each fix has a test that fails on b42f02a7a.
    • An invalid copy graded as stored no longer fails the walkers.
    • A sub-agent nested inside another resolves among its parent's children.
    • A GIF or WebP screenshot keeps its type through per-criterion selection.
    • The adhoc id's length is named.
  • Rebased on main after feat(agents): Claude Code serves atif/1, built live from its stream-json and session transcript #872 (Claude Code's adapter), at e0756a7. In the related unit folders (task_step, a2a_agent, agents and the protocol suite), 7,812 tests pass; the four failures are the known Mac-only computer_exec_test.py ones. The chaos ran 10 minutes clean on the rebased branch: 4,987 seeds and 20,173 turns.
  • A real run, Claude Code with its adapter and atif/1 prescribed, on a test host: the turn's record is atif/1, status valid, with 0 validator errors.
    • The copy has 49 agent steps, every one with its time and usage, and 96 tool calls, the same as the native trajectory's 96.
    • Its completion tokens, 68,646, equal what the solver reported.
    • Its 315 tool definitions reach the judges as names only.
  • Judge input from Claude Code's recorded runs (test_claude_code_atif_recorded.py). Each of feat(agents): Claude Code serves atif/1, built live from its stream-json and session transcript #872's six recordings gives the judges every tool call and result, a sub-agent's included, the final answer, and each screenshot as a frame whose bytes match its name. The recorded turns are cut out as the judges cut them.
  • Greptile, round 2 (3/5 on e0756a7). Both findings are fixed in e49bc1e, and each test fails on e0756a7.
    • A turn's cut dropped a root sub-agent that a nested one referenced, and kept one that a nearer sub-agent shadows.
    • The judges' walkers resolved a sub-agent's references in the scope of whoever started it, not where it sits.
  • Greptile, round 3 (4/5 on e49bc1e). The scopes are now built up front, so an id held as a list in an invalid copy, even in a sub-agent nothing references, raised. It now names nothing (6954cdb); the test fails on e49bc1e.
  • Greptile, round 4 (4/5 on 4b04f2c). A sub-agent with no id now raised the same way. Every id goes through one helper, and an id that's missing, null, a list or an object names nothing (79851b0). The test fails on 4b04f2c.
  • Reference fuzz (kept outside the repo).
    • What it builds: random nested sub-agents whose ids repeat across arrays, so they shadow, with each reference drawn from its own trajectory's scope.
    • What it checks:
      • each task's cut has no reference finding;
      • it keeps its sub-agents in order;
      • dropping any sub-agent it keeps breaks a reference;
      • both walkers, on the whole document and on each cut, start sub-agents in the order the protocol's resolver gives.
    • It fails on e0756a7 within 76 seeds. On the fix it ran 248,674 seeds clean locally and 78,136 on the test host.
  • On the test host at e49bc1e:
    • The integration file plus the verifier and atif-copies unit tests: 1,102 passed.
    • 20 minutes of chaos ran 48,311 seeds clean: 96,619 steps and 192,980 turns, with 21,910 valid, 21,576 invalid, 4,838 newer and 47,810 unavailable records, 14,418 restarts and 1,681 links.
  • The missing-media fallback (4dc78ea). The copy tests cover a copy without its media reading native in its place, a newer copy and misdescribed files doing the same, and the copy staying when native can't be read; each assertion on the new behaviour fails on 79851b0. The chaos now expects native exactly for turns whose copy was unavailable or lacks media: it fails on 79851b0 and ran 2,494 seeds clean on the fix.
  • Real runs with paired judges (on the test host, at 4dc78ea and 43b7571). Each run prescribed atif/1, and each judge had a twin that a test-only hook, kept outside the repo, handed the same run's native trajectory, so any difference between a pair is the format's.
    • Runs: Claude Code with its adapter on five tasks:
      • the desktop example's computer-use task (screenshots);
      • an Online-Mind2Web browser task on the chromium computer (a live site, Playwright MCP);
      • the next-env-event inbox week (4 turns woken by triggered emails, MCP tools);
      • a task that has Claude Code delegate to a sub-agent;
      • one that runs two sub-agents in parallel.
    • Judges paired: model judges under DEFAULT (with thinking), SCREENSHOT final frames, and per-criterion frames with an action log and rubric_evidence; grade_up_to_turn; agent judges on the view and on its compaction; and an env_outcome verify that reads trajectory and trajectory_formats.
    • Results: every pair gave the same grade on every row, with two exceptions.
      • The first sub-agent run's model judge, reading the copy, took the sub-agent's Bash call for the main agent's, which the native turn's parent_tool_use_id had kept apart. The compaction now names a sub-agent's events (43b7571). On the fix, both sub-agent tasks' pairs agree on every row.
      • The per-criterion screenshot judge graded the copy but skipped the native turn ("the trajectory holds no screenshots"). The native reader (transcript_from_raw) finds no actions in Claude Code's stream-json, which predates this PR.
    • Copies: every copy was valid. Solver spend for these runs was about $1.50.
  • Locally at e49bc1e: task_step, agents and the protocol suite, 7,553 passed; the four failures are the known Mac-only ones. At 6954cdb, the verifier and protocol suites passed, 3,163 tests; at 79851b0 the verifier suite passed, 1,072 tests, and the reference fuzz ran 25,189 more seeds clean.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no new blocking issue was found.

Summary

Prompt steps can store prescribed atif/1 copies as their trajectories, and judges read each turn by its recorded format.

  • Prompt steps use each prescribed ATIF copy as that turn’s trajectory.
  • Rubric judges grade ATIF turns from the task and media for each turn.
  • Environment outcome checks can receive each turn’s labeled trajectory view.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Prompt turn ends] --> B{Prescribed and offered ATIF?}
  B -- No --> C[Read native trajectory]
  B -- Yes --> D[Collect ATIF copy and media]
  D --> E{Copy available with media?}
  E -- Yes --> F[Store ATIF as turn trajectory]
  E -- No --> C
  C --> G[Record turn format]
  F --> G
  G --> H[Judge reads each turn by format]
  H --> I[Compacted child events name their agent]
Loading

Reviews (27) · Last reviewed commit: "fix(verifiers): a judge's compacted atif..." · Reviewed by Greptile

@earakely-scale
earakely-scale marked this pull request as ready for review November 20, 2026 23:03
@earakely-scale
earakely-scale requested a review from a team as a code owner November 20, 2026 23:03
@earakely-scale
earakely-scale marked this pull request as draft November 21, 2026 05:11
@earakely-scale earakely-scale changed the title feat(task-steps): prompt steps store each turn's atif/1 copy when the run prescribes it feat(task-steps): a prescribed run's trajectory is its atif/1 copy, and its judges grade it Nov 21, 2026
@earakely-scale
earakely-scale marked this pull request as ready for review November 21, 2026 07:01
@earakely-scale
earakely-scale marked this pull request as draft November 22, 2026 00:15
@earakely-scale

Copy link
Copy Markdown
Collaborator Author

On hold until Claude Code serves atif/1 (Y5, FD-6079). No shipped agent has an ATIF adapter yet, so today a run that prescribes atif/1 falls back to native on every turn, and the switch this PR makes can't be exercised end to end. Once Y5 lands, this gets a parity test on tasks whose judges read the agent's trajectory (use_trajectory on), native against atif/1 with the same agent and model, before it's marked ready again.

@earakely-scale earakely-scale changed the title feat(task-steps): a prescribed run's trajectory is its atif/1 copy, and its judges grade it feat(task-steps): prompt steps keep each turn's atif/1 copy as its trajectory when the run prescribes it, and judges grade it Nov 22, 2026
@earakely-scale

Copy link
Copy Markdown
Collaborator Author

A note for when this PR resumes after Y5 (#872), found while reviewing #872.

Judge prompts would carry Claude Code's tool definitions. #872 fills agent.tool_definitions in Claude Code's atif/1 documents: each tool's name, description and JSON Schema, about 60 to 95 KB per document. This PR's judge view, task_document, keeps every top-level key but the steps, sub-agents, final_metrics and continued_trajectory_ref. So each turn's view keeps the agent block with those definitions, and so do the views of embedded sub-agents.

RubricsVerifier._atif_turn_content puts the whole view in the judge's prompt unless the DEFAULT compaction is on. With no filter, or the SCREENSHOT one, every atif/1 turn would add roughly 20,000+ tokens of tool schemas, once per turn. The agent judge gets them in its staged files too. A native Claude Code turn carries only the tool names, in its init event.

Proposed fix in this PR: drop tool_definitions from the agent blocks of judge views, root and sub-agents, or keep only the names. Judges grade what the agent did, which the steps' calls name, so they don't need the schemas.

Until then, this would show up in the planned parity test (Y4-12) as a cost difference and possibly a score difference between the native and atif/1 arms.

earakely-scale and others added 10 commits November 22, 2026 11:31
… run prescribes it

A run that prescribes atif/1 reads each solver turn's copy inline once the turn ends, off the turn's
path, and stores it as <trajectory_id>.json in the run's folder for the agent, with its aux log, turn
context and media; each turn's record says how it checked (valid, invalid, newer, unavailable), and a
restart's next document is linked from the session's earlier one. Refs FD-6078.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… invalid, and media are checked against the profile

The session names a new document only once the earlier one links to it, so a later turn retries a link
that failed. A copy whose shape can't be walked is stored and recorded invalid by the validator's
findings, rather than unavailable. A held media file whose profile sha256 or size disagrees with its name
or the stored file is media-bytes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he store

A staged call whose answer is lost or refused still moves the objects the agent wrote into the store, as
an upload through a grant does, so the atif/1 media pull finds a file the agent has already let go of.
Names the atif/1 record's reason limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…othing

Only a call that may have reached the agent, its answer lost or refused, has staged writes to collect;
one that couldn't connect fails at once rather than after collection's retries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tif/1 records, a shared prompt-step rig

The validator takes files stored beside a document as StoredMedia and the reader exports media_refs, so
the worker no longer re-walks a document's media or re-implements media-bytes. AtifCopies fills each turn's
record itself; the atif_copies metadata and a record's status are typed; an agent's error code is read once
(extension_error_code), so one the SDK wouldn't send isn't kept as a reason; invoke_transfer's send is its
own function; prompt-step tests share prompt_agent_rig and tst/util/images.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
validate stops at a document whose schema ATIF's models reject, as a newer one's; validate_media gives the
media-bytes findings alone for any document media_refs can walk, and the worker checks a copy's media with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ative the fallback

When the run prescribes atif/1 to an agent that offers it, each turn's copy fills the trajectory fields
labelled atif/1 and no native read is made; a turn whose copy can't be had has its native trajectory read
at once in its place (Y4-9, Y4-10). The per-turn record's native_format becomes format, and its atif
record names the turn's task. always_on prescribes native only until it reads atif/1 copies (Y4-11), and
the snapshot series keeps an atif/1 url out of its native rows. agentenv_protocol.atif.task_document
cuts a turn out of a conversation's document as a document of its own. Judges' atif/1 readers come next.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r label

The rubric judges (direct and agent), their DEFAULT compaction, SCREENSHOT frames and per-criterion
evidence, grade_up_to_turn and env_outcome's trajectory read each turn by its label: an atif/1 turn as its
own A2A task cut out of the conversation's document, found by its id or, in a copy without the profile,
by the step it reached, its media read from the document's folder and checked against their names; any
other turn as native, byte for byte. A copy the turn can't be found in is graded as stored. Staging hashes
media as they stream and keeps no bytes; frames are typed by their bytes; a sub-agent's screenshots count.
env_outcome's verify may ask for each turn's label. The judge-input pin adds 14 atif/1 cases, its native
ones unchanged. agentenv_protocol.atif.tasks_document cuts tasks found without ids.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ng, nested sub-agents count, and a screenshot keeps its type

The judges' ATIF walkers skip what isn't a step, a result or a call, so an invalid copy graded as stored
is read rather than failing the verifier, and staging finds no media in a shape it can't walk. A sub-agent
reference resolves among its parent's own children before those around it, so a grandchild's calls and
screenshots reach the judge. A screenshot's type read from its bytes reaches per-criterion frames
(TrajectoryAction.screenshot_media_type), so GIF and WebP aren't sent as PNG. Names the adhoc run id's
length, and tests a pinned image in a run that prescribes atif/1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… their schemas, as a native turn does

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale force-pushed the edgararakelyan/fd-6078-y4-atif-copies branch from a5a2fb7 to e0756a7 Compare November 22, 2026 19:36
…eference where it sits

A reference names a sub-agent embedded in its own trajectory, else the nearest one around where that trajectory sits.
The cut followed references from the root's sub-agents' own steps only, so a reference from deeper in a kept one was
dropped, and it read every reference against the root's array, keeping one a nearer sub-agent shadows. The judges'
walkers resolved a sub-agent's references in the scope of whoever started it. The validator's resolver moves into the
reader, and the cut and the walkers both follow it; a copy whose cut fails is read as stored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ing, so it stops no judge's walk

The walkers now build every trajectory's scope up front, so an invalid copy graded as stored with such an id anywhere,
in a sub-agent nothing references too, raised where the lazy walk never looked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale marked this pull request as ready for review November 22, 2026 21:24
…ith its calls, results, answer and screenshots

Each recorded copy's turns, cut out as the judges cut them, give every tool call and result (a sub-agent's included), the
final answer, and each screenshot as a frame whose bytes match its name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale and others added 3 commits November 22, 2026 13:40
…judge's walk

6954cdb indexed a sub-agent's id once it passed the Hashable check, and a missing one, read as None, passed it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… its native trajectory read in its place

Its judges would grade the turn without those files, screenshots among them, while the native trajectory still holds
them. The record keeps the copy's status, rules and url; the turn's url and label are native's. When native can't be
read either, the copy stays the turn's trajectory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s events, so they aren't read as the main agent's

The compaction placed a sub-agent's events after the result that started it with nothing to tell them apart. Found by
a real run: a model judge read a sub-agent's Bash call as the main agent's, where the native turn's
parent_tool_use_id told the same judge otherwise. Each of a sub-agent's events now names it as `subagent`, and the
result that started it lists it in `starts_subagents`; a turn without sub-agents compacts as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale merged commit cef7ab1 into main Nov 23, 2026
66 of 68 checks passed
@earakely-scale
earakely-scale deleted the edgararakelyan/fd-6078-y4-atif-copies branch November 23, 2026 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant