Repository navigation
Conversation
A trace (s1-trace/1) records what an agent sent, one record per attempt, with episode, step, timing and image hashes. record_s1a.py records System1-Agents' decisions from outside its source. metrics.py measures repeated work as the Open-Jev or Cua-S1 worker tokenizes it: sharing within a request, a cache of earlier prompts in 64-token chunks, and repeated states and images. replay.py replays a trace one client per episode with its think time, together or one episode after another. Two small traces and the first results come with it.
This was referenced Oct 26, 2026
This branch has not been deployed
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.
Required human contributor answers
What outcome are you trying to achieve?
Measure how much computation repeats in real agent interactions, and decide which kind of reuse to build.
What is the highest-leverage variable for that outcome?
The share of prefill tokens that each kind of reuse could skip, which depends on how often the same state is asked about again, how long the prompt prefix stays the same between steps, how soon the same screenshot comes back, and how many questions share one state.
How will this work move that variable rather than create busywork?
Each kind of reuse works differently and costs memory and complexity. Measuring first shows which one would cut the most prefill work and latency, so we build that one and skip the ones that would not pay off.
Who is the customer or user, and what do they actually need?
Users whose decision requests repeat computation in different ways, such as agents asking several questions about one page or screenshot, guardrails applying one rubric to many messages, or voice agents asking again as a transcript grows. They need faster answers.
After answering the four questions: is a PR needed at all to achieve this outcome?
Yes. The traces now cover browser, form and tool fronts and two prompt layouts, and their results answer #150's open question, so the tools and results are worth sharing.
For a bug fix: link actual observed failure evidence.
N/A, not a bug fix.
Purpose
For #150's first section: find the repeated work in real agent interactions. Its first step is a trace format and a replay script under
benchmarks/; this adds those, a recorder for System1-Agents, a metrics script, two small traces and the first results.tracefile.py: thes1-trace/1format. One record per attempt, with episode, step, retries, send and receive times, the think time since the previous response, the deadline, the response and image hashes (no image bytes, no token ids).id,groupandrequestmatch the manifest rows proposed in [Feat] Replay changed-image decision requests with retained evidence ThinkFlowLab/system1-agents#72.record_s1a.py: runs with System1-Agents' Python and wraps its HTTP decision client and tool loop from outside its source.metrics.py: renders each request as the native Open-Jev or Cua-S1 worker does and tokenizes it with the worker's export, leaving out requests the worker would refuse. It reports what sharing within a request (the rule of Decider'sprefix.rs) and a cache of earlier prompts (64-token chunks, per episode or as the server sees them) would skip, and repeated states and images.replay.py: one client per episode, in recorded order with its think time, episodes concurrently or one after another; per-request latency, deadline misses andprefix_cache, withbench.py's evidence files and percentiles. It is a separate script because test: add weekly local GPU accuracy and latency checks #141 and Add a Public231 fast-screen before full C1 #181 are changingbench.py.samples/: 20 blackjack hands and one ticket-router run.results-2026-10-25.md: the first results and how they were recorded.For #150's open question, branch batching or the cross-request cache first: in these traces a cache pays only where each question's goal comes before the state (Cua-S1). Where the state comes first (Open-Jev), sharing within a request is nearly all of the reuse.
Test Plan
System1-Omni Version / Commit:
c18e9e7onmain05075d0.CPU: the CI steps (format, Clippy, frontend tests, workspace tests, release build, Python checks) and
mkdocs build --strict. The new tests cover the format checks, the planner againstprefix.rs's rules, the cache rule, refused and failed requests, both workers' prompts (Open-Jev againsttests/open_jev/data/contract.json, Cua-S1 through itscontract.py), the recorder against a stand-in System1-Agents package, paced replay against a local HTTP server (order, think time, deadlines, offsets, retries), and the samples. With the 9B export's tokenizer, the Open-Jev token ids also matchtests/open_jev/data/tokenization.json.Recordings, on one RTX 6000 Ada: System1-Agents
9b20b98fronts (Google Flights live, its local form fixtures, 2048, millionaire, blackjack, ticket router), with Open-Jev-9B deciding (native worker with #179's change, no prefix switch) and Qwen3-8B planning through vLLM 0.32 with thinking off. Each trace was measured in both layouts.Test Result
CPU. All pass on macOS.
Shares of prefill tokens that could be skipped, each layout on its own tokens:
zurich-london(System1-Agents' Jev 1.13 recording)No state came back exactly. Five Flights results pages were over the 9B export's 4,096-token limit and are not measured. The Cua-S1 worker runs no planner, so its "within a request" column is hypothetical. Blackjack's 77% needs a cache that ignores episode boundaries: each hand is its own short episode (84 of 100 take one decision). Agents sent one request at a time; without a chat model, the next request followed the last response within milliseconds.
Replaying the Flights and form traces against #179 is in that PR's comment.
Trajectories depend on the deciding model: Open-Jev-9B ends 22 of the 28 Flights episodes at the second decision.
Demo / evidence
The Flights traces copy third-party pages, and the form and 2048 traces carry prompt text adapted from browser-use (MIT), so they stay outside the repository; the results file says how they were recorded. The two samples are System1-Agents' content (Apache-2.0), and the ticket-router row can be recomputed from its sample.
Self-review