Repository navigation
Extract StepTraceSession and port the step-cache tests against it - #425
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KWUdrjfarTEM4dmBbK6GaV
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 step cache logic ran inline in the act, so the tests could only reach it through a whole session and could not check what upstream checks: the host reads in order, the staged recording, and the exact miss reason. It now lives in
StepTraceSession(src/E2E/Agent/StepCache.cs) withStepOutcomeandFailedStepOutcome, and the act calls it as upstream's act does. Thestep-cache.test.tstests are ported against that seam with aMakeHosthelper; the through-the-pipeline versions stay under_through_the_pipelinenames. Behavior does not change, except thatCANCELLEDnow keeps the cache like a model outage, as upstream'sfailedStepOutcomedoes. The built-in agent's start capture now falls back to a second observe when the session's probe of the start screen fails, so a flaky first capture still lets the step run but records nothing..NET-only symbols:
IStepCacheHost.FirstActedOn(the port reads the delta from the screen the first action was resolved against),StepCacheOptionswith the cache context folded in,ClaimedKey, the privateWatchedHost,StepTraceSession.Pending/Start, theREPLAY_STALEcase inFailedStepOutcome, and the test typesStepCacheHarness,StepHost,CacheContext,StubCache.ReplayOptions.LooksBeforeFreeis upstream'slooksBeforeFreeand replaces the host'sOnEndRoute. The port keeps its own gap/strict rules and settles evictions inFlush, not inconclude.Partial tests (renamed): "keys on the params with each unique() value as a placeholder..." (the key claim and slotting are the attempt's and dispatcher's; kept as
Records_nothing_and_says_so_when_a_unique_value_is_spelled_by_another_paramfor the collision half), "looks at the page a navigate opened before free actions" (..._before_a_free_press...: no untargeted typing), "stages the entry it replayed whole to keep" (no recorded verdict), "self-finalizes when the recorded destination arrives after the replayed action" (summary wording), "still runs live a step with no recording and a recording too long to replay" (no truncated half), "leaves an entry the same flow re-recorded untouched" (no summary or end wait to vary; kept as the pipeline test). Not ported, feature missing:recordedVerdictOf(an entry records no verdict), the three pixel-evidence tests, truncated entry, no start anchor, the two end-wait tests, live progressreplaying, "leaves an entry untouched when only the rule differs", "says a confirmed recording ... was not written", and "compares the step as the entry stores it" (the act masks the step before the session).Closes #382
🤖 Generated with Claude Code
https://claude.ai/code/session_01KWUdrjfarTEM4dmBbK6GaV