pub struct SessionMetadataService;Implementations§
Source§impl SessionMetadataService
impl SessionMetadataService
Sourcepub async fn set_title(
state: &dyn AgentSessionContext,
session_id: &str,
new_title: &str,
if_match: Option<u64>,
) -> Result<MetadataChange<(String, u64)>, MetadataError>
pub async fn set_title( state: &dyn AgentSessionContext, session_id: &str, new_title: &str, if_match: Option<u64>, ) -> Result<MetadataChange<(String, u64)>, MetadataError>
Manual rename via PATCH. Always authoritative; always bumps
title_version and metadata_version. Returns Ok(None) when the
trimmed input equals the existing title (no event emitted).
Sourcepub async fn apply_generated_title(
state: &dyn AgentSessionContext,
session_id: &str,
candidate: &str,
source: TitleSource,
force: bool,
) -> Result<MetadataChange<(String, u64)>, MetadataError>
pub async fn apply_generated_title( state: &dyn AgentSessionContext, session_id: &str, candidate: &str, source: TitleSource, force: bool, ) -> Result<MetadataChange<(String, u64)>, MetadataError>
Auto/fallback rename produced by the title generator. Aborts (returns
Ok(None)) if the on-disk session is no longer untitled and force
is false — this guards against races where the user renames mid-LLM.
On success bumps title_version and metadata_version, emits with
the supplied TitleSource.
Sourcepub async fn set_pinned(
state: &dyn AgentSessionContext,
session_id: &str,
pinned: bool,
if_match: Option<u64>,
) -> Result<MetadataChange<bool>, MetadataError>
pub async fn set_pinned( state: &dyn AgentSessionContext, session_id: &str, pinned: bool, if_match: Option<u64>, ) -> Result<MetadataChange<bool>, MetadataError>
Toggle the pinned flag. Returns Ok(None) if the requested value
matches the current state (no event emitted). Bumps metadata_version.
Sourcepub async fn set_gold_config_json(
state: &dyn AgentSessionContext,
session_id: &str,
gold_config_json: Option<String>,
if_match: Option<u64>,
) -> Result<MetadataChange<Option<String>>, MetadataError>
pub async fn set_gold_config_json( state: &dyn AgentSessionContext, session_id: &str, gold_config_json: Option<String>, if_match: Option<u64>, ) -> Result<MetadataChange<Option<String>>, MetadataError>
Set or clear the session-level Gold configuration JSON.
This is an authoritative session metadata write: it bumps
metadata_version so runtime saves with stale session structs do not
overwrite the user’s current-session Gold settings.