Files
oh-my-pi/packages/coding-agent/src/task
can1357 5c35759526 fix(coding-agent): inherit AGENTS.md search and workspace tree from parent in subagents
Subagents previously re-ran buildAgentsMdSearch and buildWorkspaceTree on
every spawn, repeating the slowest part of system-prompt construction for
each task tool invocation. On large/pathological repos those scans
exceeded the 5s preparation deadline and tripped the per-subagent
'system prompt preparation timed out' warning.

Forward the parent's already-resolved AgentsMdSearch and WorkspaceTree
through createAgentSession (alongside the existing contextFiles, skills,
and promptTemplates inheritance):

- Add agentsMdSearch and workspaceTree to CreateAgentSessionOptions;
  createAgentSession short-circuits the parallel scan promises when
  these are provided.
- Resolve them with contextFiles before constructing ToolSession; expose
  on ToolSession so the task tool can read the parent's values.
- Thread them through ExecutorOptions (task/executor.ts) into the
  subagent's createAgentSession call, and pass them from the task tool
  (task/index.ts) on both the worktree-isolated and non-isolated paths.
2026-05-07 23:33:07 +02:00
..