@standardagents/builder 0.11.10 → 0.11.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2694,7 +2694,9 @@ var init_ToolExecutor = __esm({
2694
2694
  agentConfig: promptAgent,
2695
2695
  storage: state.storage,
2696
2696
  env: state.env,
2697
- threadId: `${state.threadId}-prompt-${call.id}`,
2697
+ // Use root thread ID - sub-prompts share the parent's thread
2698
+ // Messages are namespaced by depth and prompt, not by threadId
2699
+ threadId: state.rootState?.threadId || state.threadId,
2698
2700
  thread: state.thread,
2699
2701
  // Pass through parent thread instance and metadata
2700
2702
  context: {
@@ -2908,7 +2910,8 @@ ${errorLines.join("\n")}`);
2908
2910
  const toolConfig = parentToolConfigs.find(
2909
2911
  (t) => typeof t === "string" ? t === agentName : t.name === agentName
2910
2912
  );
2911
- state.pendingHandoff = {
2913
+ const targetState = state.rootState || state;
2914
+ targetState.pendingHandoff = {
2912
2915
  agentId: agentName,
2913
2916
  args: args2,
2914
2917
  toolConfig: typeof toolConfig === "object" ? {