pub(super) async fn tab_or_reuse(
state: &AppState,
agent: &AgentDefinition,
provider: &ProviderConfig,
cmd: &CommandAgentOpenData,
headless: bool,
into_block: Option<&str>,
) -> Result<Result<String, AgentOpenResult>, String>Expand description
The tab agent.open works in, or the agent’s existing pane when it has one (Err: nothing more to
do). A start of a terminal-tier CLI is refused: its term view starts it, and a start
has none. A start needs no tab to run an agent that already has a block, so with no tab left it only
reuses that block; a first block still needs a tab.