Repository navigation
feat(context): object-store names for run-context trajectory keys - #101
Merged
Merged
Conversation
PromptResponse gains agent_trajectory_object_url, agent_trajectory_object_prefix and target_agent_per_turn_trajectory_object_urls. The S3-named fields stay as mirrors, so every persisted prompt response carries both keys and readers on older versions keep working. The S3-named keywords still work, warning through warn_deprecated; giving both spellings with different values is an error. Stored responses load keyed either way, legacy key first. Verifier metadata (compact/judge trajectory, unit-test stdout/stderr artifacts) and snapshot series rows write the neutral key beside the legacy one, and the run output prints the neutral labels while reading metadata keyed either way. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…the neutral one Co-Authored-By: Claude Opus 5.5 (1M context) <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.
Summary
Neutral twins for the S3-named
PromptResponsefields.PromptResponsegainsagent_trajectory_object_url,agent_trajectory_object_prefixandtarget_agent_per_turn_trajectory_object_urls. They are appended after the existing fields, so positional construction is unchanged.agent_trajectory_s3_uri,agent_trajectory_s3_prefix,target_agent_per_turn_trajectory_s3_uris) stay as real fields, mirrored from the neutral ones at construction.dataclasses.asdict, which persists prompt responses, therefore writes both keys. Readers on older versions keep reading the legacy key, and code reading the S3-named attributes keeps working without a warning.warn_deprecated, which logs a countableagent_env_deprecated_symbolline. Giving both spellings with different values is aValueError. Giving them equal is a copy, sodataclasses.replace(response)and rebuilding fromasdictboth work.from_dictreads either key, the legacy one first, as with the artifact twins: only a raw-doc writer outside core can make the two differ, and those know only the legacy key. A legacy key holdingNonefalls through to the neutral one, and a stored empty per-turn list stays[]. Stored documents are not rewritten, and read compatibility for the legacy keys is permanent.The rest of the run context.
compact_trajectory_object_urlandjudge_trajectory_object_urlbesidecompact_trajectory_s3_uriandjudge_trajectory_s3_uri. The private names inside the verifier move to neutral ones, including the judge call's internal result key.stdout_artifact/stderr_artifactentries carryobject_urlbesides3_url.trajectory_object_urlbesidetrajectory_s3_uri.agent-env task run): prints the neutral labels, and reads verifier metadata keyed either way.context.dual_keyed/context.read_dual_keyedwrite and read a renamed run-context key.Core's own constructors, prompt_agent included, use the neutral keywords. The explorer UI still reads the legacy keys, which stay written; moving it to neutral-or-legacy is a follow-up.
Testing
build_context_update_opscarries both keys.replaceand anasdictround trip don't.PromptResponsein the suite.or, or letting a legacyNonehide the neutral value;dual_keyed, or at any single write site (four snapshot sites, two verifier artifacts, two rubrics metadata keys);main(1739 passed). The one failure is a floor-constant check that reads the test venv's installed metadata, and it fails the same way against both.Labelled
bump-version.🤖 Generated with Claude Code
The PR appears safe to merge based on the changes since the previous review.
What we checked:
None, so the reader keeps the legacy list.Summary
Run-context trajectory links gain neutral object-store names while keeping the older S3-named keys readable and written for compatibility. Verifiers, snapshot rows, and
agent-env task runoutput use the neutral names too.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[Prompt and verifier steps] --> B[Write legacy and neutral keys] B --> C[Stored run context] C --> D[Older readers use legacy keys] C --> E[Current readers accept either key] E --> F[Task output uses neutral labels]Reviews (2) · Last reviewed commit: "fix(context): a legacy run-context key h..." · Reviewed by Greptile