Run with Browser AI · Chapter 09

Run Chapter 09: Session Lineage Laboratory

Create a stateful Prompt API session, establish shared history, clone it, diverge two branches, compare usage and destroy both resources explicitly.

← Read A Session Is Not a Stateless Function
Execution Not inspected
Secure contextUnknown
Top-level pageUnknown
Prompt APIUnknown
AvailabilityNot inspected

Chapter experiment

A Session Is Not a Stateless Function

Metrics-only trace

Loading the chapter experiment…

No model output yet.
Inspect the context supplied by this chapter

What this experience knows

This experience is grounded in Chapter 09 and treats a Prompt API session as a measurable resource rather than a stateless completion function.

State boundary

Creation configuration, session identity and prior exchanges affect later calls. Prompt output cannot be interpreted independently of the session that produced it.

Experimental branch

The original establishes shared history before cloning. The clone receives a new identity and records the original as its parent. Different next prompts can then be compared without replaying the shared history.

Measurement boundary

The browser’s reported inputUsage and inputQuota are recorded before and after operations. Missing properties remain missing; character counts are not substituted for runtime usage.

Lifecycle boundary

Cloning and destruction are capabilities, not assumptions. Destroying a session disables future work in that lane and records the final observable snapshot and reason.

Evidence boundary

Metrics-only capture records sizes and timing, not prompt or output text. Automatic fixture checks can test narrow expected terms, while a coherent use of inherited history remains a behavioral observation.

This laboratory exposes a Prompt API session as an owned resource with identity, history, finite context, lineage and an explicit end. Establish one shared fact, clone the resulting session, then apply different interventions to the original and clone.

The reviewed replay proves that one Chrome 152 run created a clone-capable, destroy-capable session with a reported quota of 9,216. It contains no completed prompt, clone or destruction event, so those states remain unobserved until a live run produces them.