Skip to main content

Module execution_prep

Module execution_prep 

Source
Expand description

Single authoritative pre-execution session mutation point.

Historically three execution entry points each duplicated — with subtly different logic — the work of (a) placing the authoritative leading System message and (b) setting session.model before handing the session to the agent loop. This module consolidates that into prepare_session_for_execution so there is exactly one place that defines the pre-execution mutation.

The three callers are:

  • the SDK facade (bamboo_sdk::agent::Agent::execute_internal), which owns a configured instruction and model and passes both;
  • the server spawn path (runtime::execution::agent_spawn::spawn_session_execution), whose caller has already placed the system prompt, so it passes None for system_prompt and only the resolved model;
  • the child spawn path (sdk::spawn::run_child_spawn), likewise None for the system prompt and only the child model.

Functions§

prepare_session_for_execution
Apply the authoritative pre-execution mutations to session.