Propagate workspace roots into subagent sessions

Subagents (task tool) now inherit the parent session's
additionalDirectories via ToolSession → ExecutorOptions →
CreateAgentSessionOptions, so delegated agents see the same
<workspace-roots> block and can read/grep/glob added roots.

Co-authored-by: oh-my-pi <https://omp.sh>
This commit is contained in:
maatheusgois-dd
2026-07-22 02:36:38 -03:00
co-authored by oh-my-pi <https://omp.sh>
parent c24cb606a8
commit ffe50650e1
4 changed files with 9 additions and 0 deletions
@@ -371,6 +371,7 @@ function buildExecutorOptions(
const enableMCP = !policy.planMode && (session.enableMCP ?? true);
return {
cwd: session.cwd,
additionalDirectories: session.additionalDirectories,
agent: policy.effectiveAgent,
task: renderSubagentPrompt(request.assignment),
assignment: request.assignment.trim(),