Repository navigation
feat(agents): every bundled agent declares its trajectory's native format - #801
Merged
Merged
Conversation
…rmat Each bundled agent passes its existing format id to enable(TRAJECTORY_V1, native=...), so its card lists formats, native and default, the SDK holds its log and returned native trajectories to that format, and every read it serves names it; pi's final read now reports pi-json-events/v1. Each agent's protocol floor rises to 0.1.588, the first with native. Claude Code's own context reads, the records of the CLI's session file, name claude-code-session/1, never the native format; Codex's own context reads, its native events, name codex-exec-json/1. browser-use gets a TRAJECTORY_FORMAT constant. A test holds every bundled agent to its native format. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…f assuming it takes under a second It asserted the CLI got more than 29 of its 30 s after a read that sleeps 0.5 s, which failed under load (28.9 s). It now times the read in its stub and checks the CLI's budget lost at least that, within two seconds of scheduling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… format, its reads name it and refuse another Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <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.
The follow-up to Y2a (#787) for FD-6076: every bundled agent now declares its trajectory's native format. Protocol 0.1.588, which carries #787, is on PyPI, so the agents' images can take it.
What changes
Each bundled agent passes its existing format id to
enable(TRAJECTORY_V1, native=...):claude-code-stream-json/1codex-exec-json/1gemini-stream-json/1hermes-hook-events/1letta-code-events/1opencode-events/1openhands-events/v1pi-json-events/v1pydantic-ai-messages/v1browser-use-messages/1(now aTRAJECTORY_FORMATconstant)agentenv-proxy/v1(its code is the protocol's, which already declares it)So each card lists
formats,nativeanddefault. The SDK holds each agent's log and returned native trajectory to that format, a read naming another format getsformat_not_offered, and every read the SDK serves names its format.pi's final read now reports
pi-json-events/v1. Its returned native trajectory keeps its format at seal, which was the null-label bug.Every agent's protocol floor rises from 0.1.582 to 0.1.588, the first with
native, as build(agents): the bundled agents take the protocol whose extension routes take the control token #784 did for the control token. The proxy is included. Each folder changes, so each image is rebuilt at the next release.The two agents that serve their own context reads now name what they serve:
native. They nameclaude-code-session/1(SESSION_TRAJECTORY_FORMAT).codex-exec-json/1.A flaky test fixed. Codex's
test_the_catalog_read_counts_against_the_turns_time_limitassumed a catalog read takes under a second, and failed under load. It now times the read and checks the CLI's budget lost at least that.Choices to review
claude-code-session/1for Claude Code's session-derived context reads. Y5 decides whether the card lists it. Until then a read naming no format, or namingnative, still gets that shape, now labelled. Readers trust a response'sformatover the card (Decision 3).set_format(TRAJECTORY_FORMAT)calls stay. Withnativedeclared they're no-ops, but some agent unit tests build aTrajectoryLogwithoutnativeand rely on them.Testing
tst/unit/agents/test_trajectory_formats.py: every bundled agent's class declares its native format, and its card params areformats,nativeanddefault. A new agent folder that isn't listed fails the test.The proxy's container install test (integration) now checks the installed proxy's real card offers
agentenv-proxy/v1. It also checks a cursor read naming that format names it back, and a read namingatif/1is refused withformat_not_offered. It's assertions in an existing test, so CI time doesn't change.Claude Code's and Codex's context-read tests expect the named format; their image-contract tests expect the new floor. All 1,027 agent unit tests pass, and
ruff check .passes.e2e on an x86 test host, no model: all 11 agent images, each built from this branch with the release's own
infra_build.py build ENTRY amd64, passed. Each one's real card offered its native format asformats,nativeanddefault, and each refused a read namingatif/1withformat_not_offered.e2e on an arm64 test host, real model, every agent but the proxy (whose turns its caller plays; the integration test above covers it). Two rounds, both from this branch:
infra_build.py build ENTRY arm64, with the smoke tasks' prompt (echo $((6 * 7))). Every turn completed, so no agent's returned native trajectory trips the hold at seal, and every reply said 42. After the turn, the task read, the task read naming the native format, and the context read each named that format. Claude Code's context read namedclaude-code-session/1. The live agents' events reads, during the turn and after, named it too. pi and browser-use aren't live, so they refuse those reads, as they should. Every agent refusedatif/1withformat_not_offered. Each image installed protocol 0.1.594 from PyPI.agent-env run agents --task <agent>-smoke --model <model>: all 10 passed. browser-use's ran on achromiumbrowser composed for arm64. That turn completing is what shows browser-use's native trajectory holds at seal, since its turn in the first round had no browser.The model calls cost well under $2. The images and containers were removed after, and the host stopped.
CI: 33 pass on d68fc5f;
installerskips, as it does when a pull request touches none of its paths. The proxy integration test passed in both its containers, sh-only and with bash. Greptile: 5/5, every thread resolved.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge.Summary
Bundled agents now declare their native trajectory formats, and context reads name the format they return.
The previous scheduling-allowance finding is fixed. No new issues found in the follow-up change.
Reviews (7) · Last reviewed commit: "test(agents): the catalog-read budget te..." · Reviewed by Greptile