Repository navigation
test(remote): measure what one lazy shell fetch costs against what it saves - #860
Merged
Merged
Conversation
… saves The lean history page drops a shell call's `arguments` whole and the phone asks the command back when the row is opened. This measures the way back in real sealed bytes, so "lazy" is verified rather than assumed. The scripted agent answers `get_tool_call_args` from the same recorded entries `get_session_entries` serves, scoped by run as well as id, which also gives the declared-state fetch its first coverage through real E2EE (it was unit-tested only). Measured over three real sessions on both brokers: the commands dropped are 2.2-7.0% of the undeclared page, and one fetch costs 441-466 B of overhead (request + reply minus the command it returns, essentially all envelope), so opening more than ~a quarter to a half of a page's shell rows costs more than carrying them. Typical use still saves. Note the share is smaller than an earlier figure quoted for this work: 25% was the commands' share of the *already-trimmed* remainder, not of the page.
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.
What
The lean history page drops a shell call's
argumentswhole (the largest unread payload left after the trim) and the phone asks the command back when the row is opened. This measures the way back: what one fetch costs in real sealed bytes, against the command bytes the page dropped — so "lazy" is verified rather than assumed.Why it is worth a test
--broker both, so fake and realnats-server).get_tool_call_argsarm answering from the same recorded entriesget_session_entriesserves, scoped by run as well as id — so the mock cannot answer an identity the real agent would refuse.Measured (three heaviest real sessions, real broker v2.15.0)
--samples 3 --broker bothstill reportsliveEqual: true, historyEqual: true, so this adds no new broker asymmetry.Two honest findings.
The lane's savings still come overwhelmingly from the trim itself (66–71% of page bytes); the command drop is a small extra bought with a tap.
Checks
cargo test --manifest-path desktop/src-tauri/Cargo.toml --lib— 1315 passedcargo fmt --check/cargo clippy --all-targets -D warnings— clean--samples 1 --broker fake), needing only the live agent's db + socket, like the other measurements inscripts/measure/.verify_e2e.rsgainsshell_calls_in+fetch_tool_call_argsand theVERIFY_E2E_LAZY_FETCHline; the script reports it beside the existing lanes.