SESSION HISTORY · COMMITTED CHANGES

Agent history: inspect committed state changes

Two browser tabs change one agent session at once while the agent streams a tentative discount; inspect which revisions the history really committed.

Computed experiment · sixty inspection seconds

Your experiment

I1 adds a lamp with a 5% discount while I2, from another tab, adds a desk; both start from revision r1. I1 also streams a partial event that mentions a 10% discount before settling on 5%. Start with whole-state saves, no version check and partial events committed, then fix each problem and inspect individual revisions.

Play replays the computed run over sixty inspection seconds; Next event steps, Restart rewinds, Speed changes the pace and Inspection time scrubs. Any input change recomputes the run and rewinds it without autoplay.

Event trace

    Computed data

    Final metrics

    Teaching model of an append-only session history in the spirit of ADK sessions and events; it is not the ADK API. Version checks compare the revision an invocation read with the current one; a rejected invocation reloads and retries once. Inspect revision values above the latest show the latest. No session store is used.

    Two tabs, one session

    Session S-8 starts at revision r1 with an empty cart. Invocation I1 from one browser tab adds a lamp with a 5% discount; I2 from another tab adds a desk. Both read r1. With the opening settings each invocation saves its whole state, nothing checks versions, and I1’s partial streaming event is committed. The history becomes r2 partial discount 10%, r3 lamp with 5%, r4 desk only, r5 confirmation: I2 saved the empty cart it read plus the desk, so the lamp and the discount vanished. LOST UPDATE, and the cart at r5 is just the desk.

    Reject stale appends

    Check Reject appends based on an old revision. I2 tries to append on top of r1 while the session is at r3, is rejected, reloads and commits the desk on top of the lamp: the cart is right. Switch How an invocation writes to Append an event with only its change instead and the desk is applied on top of I1’s change even without a version check, because adding an item commutes; a change such as setting the discount would not.

    Partial events are not commitments

    Both repairs still report PARTIAL EVENT COMMITTED: r2 records a 10% discount that was only text streamed while the agent was working. Clear Commit partial streaming events to history and the history holds only final changes; with the version check or delta writes the result is HISTORY CONSISTENT at r4 with lamp and desk. Replays and audits read history, so anything committed there is treated as something that happened.

    Inspect any revision

    Inspect revision shows the state as of one revision. In the opening run r1 is the empty cart and r2 shows the 10% discount the customer was never given; r4 shows the cart without the lamp. Values above the latest revision show the latest. Being able to point at the exact revision where a value changed, and who changed it, is what makes history useful for debugging.

    Reading the run and its limits

    Play, Next event, Restart, Speed and Inspection time step through the reads, every committed revision, the conflict and the inspection across sixty seconds; the table lists each revision with author, change, cart and discount. This follows the spirit of ADK sessions and events but is not the ADK API; a rejected invocation retries exactly once and the store never fails.