appendEvent

open suspend override fun appendEvent(session: Session, event: Event): Event

Appends event to session, applying its state delta to the in-memory session and recording the event; temp: keys are applied to the in-memory state (so later agents in the invocation can read them) but removed from event before persistence.

Overriding implementations must run this lifecycle before persisting so the stored event has no temp: keys: call super.appendEvent first then persist the trimmed event, or call State.applyTempDelta and com.google.adk.kt.events.EventActions.removeTempKeys before persisting with super.appendEvent last (needed when a stale-write check must read the pre-update Session.lastUpdateTime).

Overrides must also return early when Event.partial is true, before running this lifecycle: super.appendEvent skips partials without trimming temp: keys, so persisting after super would store an untrimmed partial event.

Return

The appended Event, or the original unchanged if it was partial.

Parameters

session

The Session to update in place.

event

The Event to append; its temp: state-delta keys are removed in place.