pub(crate) async fn open_agent_into_block(
state: &AppState,
agent_id: &str,
tab_id: &str,
block_id: &str,
) -> Result<AgentOpenResult, String>Expand description
agent.open, but launching into an existing, empty agent pane
({view:"agent"}, the picker) instead of creating a new one and
inserting it into the layout. Used by Layouts → Open layout…
(SPEC_LAYOUT_FILES_2026_09_25.md §3.5), which rebuilds the saved split
tree first and then launches each agent into its placeholder — so every
check agent.open makes (admission, one live instance, provider, CLI,
resume, config files) applies unchanged. If the agent is already open in
this tab, that pane is returned and the placeholder is left as a picker.