Skip to main content

make_stub_idempotent

Function make_stub_idempotent 

Source
pub(super) fn make_stub_idempotent(
    mstore: &Store,
    def_id: &str,
    name: &str,
    now: i64,
) -> Result<(String, bool), String>
Expand description

Returns (agent_row_id, newly_inserted). In the consolidated model the definition row IS the agent, so the “stub instance” that makes a defined agent visible in My Agents is that same row carrying an instance_name; instance_create folds into it. newly_inserted = false when the row already carries a name (the stub already existed); callers use this to avoid broadcasting agents:changed on no-op calls. The returned id is the row’s id, which is what instance_create reports back.