* Build dynamic task tool description with runtime-specific workspace visibility * guidance and the currently available sub-agents.
(config: ToolConfiguration)
| 76 | * guidance and the currently available sub-agents. |
| 77 | */ |
| 78 | function buildTaskDescription(config: ToolConfiguration): string { |
| 79 | const runtimeMode = resolveRuntimeMode(config); |
| 80 | const baseDescription = buildTaskToolDescription(runtimeMode); |
| 81 | const subagents = config.availableSubagents?.filter((a) => a.subagentRunnable) ?? []; |
| 82 | |
| 83 | if (subagents.length === 0) { |
| 84 | return baseDescription; |
| 85 | } |
| 86 | |
| 87 | const subagentLines = subagents.map((agent) => { |
| 88 | const desc = agent.description ? `: ${agent.description}` : ""; |
| 89 | return `- ${agent.id}${desc}`; |
| 90 | }); |
| 91 | |
| 92 | return `${baseDescription}\n\nAvailable sub-agents (use \`agentId\` parameter):\n${subagentLines.join("\n")}`; |
| 93 | } |
| 94 | |
| 95 | function buildParentRuntimeAiSettings( |
| 96 | config: ToolConfiguration |
no test coverage detected