fix session routing and subagent visibility
This commit is contained in:
@@ -282,6 +282,7 @@ class LocalCodingAgent:
|
||||
managed_group_id: str | None = None
|
||||
managed_child_index: int | None = None
|
||||
managed_label: str | None = None
|
||||
session_metadata: dict[str, object] = field(default_factory=dict)
|
||||
plugin_runtime: PluginRuntime | None = None
|
||||
hook_policy_runtime: HookPolicyRuntime | None = None
|
||||
mcp_runtime: MCPRuntime | None = None
|
||||
@@ -3445,6 +3446,15 @@ class LocalCodingAgent:
|
||||
managed_group_id=group_id,
|
||||
managed_child_index=index,
|
||||
managed_label=subtask_label,
|
||||
session_metadata={
|
||||
'visibility': 'child',
|
||||
'parent_session_id': self.active_session_id or '',
|
||||
'subagent_type': agent_def.agent_type,
|
||||
'delegate_label': subtask_label,
|
||||
'delegate_index': index,
|
||||
'delegate_batch_index': batch_index,
|
||||
**({'delegate_group_id': group_id} if group_id is not None else {}),
|
||||
},
|
||||
)
|
||||
if self.tool_context.jupyter_runtime is not None:
|
||||
child_agent.tool_context = replace(
|
||||
@@ -4242,6 +4252,7 @@ class LocalCodingAgent:
|
||||
else {}
|
||||
),
|
||||
scratchpad_directory=result.scratchpad_directory,
|
||||
session_metadata=dict(self.session_metadata),
|
||||
)
|
||||
path = save_agent_session(
|
||||
stored,
|
||||
|
||||
Reference in New Issue
Block a user