sub_session_query: Run a Bounded Child Session

View source: R/sub_session.R

sub_session_queryR Documentation

Run a Bounded Child Session

Description

Creates a scoped child ChatSession for a focused task. The child uses an environment whose parent is the parent session environment, so writes stay in the child scope. Only a compact result summary and trace are written back to the parent context state.

Usage

sub_session_query(
  session,
  task,
  context_handles = NULL,
  max_turns = 3L,
  budget = NULL,
  timeout = NULL
)

Arguments

session

Parent ChatSession or SharedSession.

task

Focused child task.

context_handles

Optional context handle IDs to summarize for the child.

max_turns

Maximum child generation/tool turns.

budget

Optional budget metadata recorded in the result.

timeout

Optional timeout in seconds. Currently recorded as metadata.

Value

A compact sub-session result list.


aisdk documentation built on May 29, 2026, 9:07 a.m.