cachedId property

String? get cachedId

The session id when the storage caches the header synchronously (SessionHeaderCache — the full JsonlSessionStorage and the windowed WindowedSessionStorage always do); null otherwise. Used as the prompt-cache affinity key, where a synchronous read lets provider stream functions resolve it per call without an async hop.

Implementation

String? get cachedId {
  final storage = _storage;
  if (storage case final SessionHeaderCache cached) {
    return cached.cachedMetadata.id;
  }
  return null;
}