pub struct NamedAgentRecordV1 {
pub instance_id: String,
pub instance_name: String,
pub definition_id: String,
pub identity_id: Option<String>,
pub memory_id: Option<String>,
pub session_id: Option<String>,
pub working_dir: String,
pub source_agents_base: Option<String>,
pub created_at_ms: i64,
pub last_launched_at_ms: i64,
pub created_by_version: String,
pub last_launched_by_version: String,
}Expand description
v1 payload. Add new optional fields here under #[serde(default)]
and bump MAX_SUPPORTED_SCHEMA — old readers will skip the new
version, new readers fill defaults for old files.
Fields§
§instance_id: String§instance_name: String§definition_id: String§identity_id: Option<String>FK to db_identity_bundles.id. None = unbound (= ambient creds).
memory_id: Option<String>FK to db_memory_bundles.id. None = unbound (= vanilla CLI).
session_id: Option<String>Provider CLI session id for --resume (e.g. a Claude Code session
uuid). None = no session wired yet (fresh stub / legacy record).
Added in schema v2 so a global/migrated record can resume the
agent’s conversation across channels without a current-channel
SQLite join. Old (v1) files deserialize this as None.
working_dir: StringPath relative to [source_agents_base] (or, for legacy records
without one, the reader’s current channel agents dir) — never
absolute. Keeps the record portable across machines where the home
dir differs.
source_agents_base: Option<String>Absolute path of the agents dir that [working_dir] is relative to —
i.e. the channel/dev instance the agent actually lives in
(channels/<ch>/agents or <dev-instance>/agents). Added in schema
v3 (cross-channel persistence P0.4): the registry is global, so a row
surfaced in a DIFFERENT channel must reconstruct its absolute
working_directory against the SOURCE base, not the reader’s current
channel. None for legacy (v1/v2) records — the reader then falls
back to its current channel agents dir, matching pre-P0.4 behavior.
Old binaries deserialize this as None.
created_at_ms: i64§last_launched_at_ms: i64§created_by_version: String§last_launched_by_version: StringImplementations§
Source§impl NamedAgentRecordV1
impl NamedAgentRecordV1
Sourcepub fn min_schema_version(&self) -> u32
pub fn min_schema_version(&self) -> u32
Lowest envelope schema that can faithfully represent this payload.
Climbs only when a higher-version-only field is populated, so an
older binary keeps reading records that don’t use any newer feature —
only records that actually need the newer schema are hidden from it.
Writers should stamp the record with this rather than always using
MAX_SUPPORTED_SCHEMA.
- v3 when
source_agents_baseis set (cross-channel reconstruction) - v2 when
session_idis set (cross-channel resume) - v1 otherwise
Trait Implementations§
Source§impl Clone for NamedAgentRecordV1
impl Clone for NamedAgentRecordV1
Source§fn clone(&self) -> NamedAgentRecordV1
fn clone(&self) -> NamedAgentRecordV1
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NamedAgentRecordV1
impl Debug for NamedAgentRecordV1
Source§impl<'de> Deserialize<'de> for NamedAgentRecordV1
impl<'de> Deserialize<'de> for NamedAgentRecordV1
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for NamedAgentRecordV1
impl PartialEq for NamedAgentRecordV1
Source§impl Serialize for NamedAgentRecordV1
impl Serialize for NamedAgentRecordV1
impl Eq for NamedAgentRecordV1
impl StructuralPartialEq for NamedAgentRecordV1
Auto Trait Implementations§
impl Freeze for NamedAgentRecordV1
impl RefUnwindSafe for NamedAgentRecordV1
impl Send for NamedAgentRecordV1
impl Sync for NamedAgentRecordV1
impl Unpin for NamedAgentRecordV1
impl UnwindSafe for NamedAgentRecordV1
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more