Skip to main content

create_agent_block

Function create_agent_block 

Source
pub(super) async fn create_agent_block(
    state: &AppState,
    tab_id: &str,
    meta_val: Value,
    headless: bool,
    cmd: &CommandAgentOpenData,
) -> Result<String, String>
Expand description

Step 7 for a new pane: create the block through the reducer, then place it in the layout (or park it for a start).

Through the reducer (#1681), not wcore-direct: a store-only block is invisible to the reducer-canonical state.blocks (only hydrated from SQLite at bootstrap), so tearing this agent pane off later was rejected “block not found”. BlockCreated carries meta, and apply_block_created writes the mstore Block, which the controller resync reloads by id.