Commit 06d309fc599b
Changed files (1)
dots
pi
agent
extensions
subagent
dots/pi/agent/extensions/subagent/index.ts
@@ -420,7 +420,13 @@ export default function (pi: ExtensionAPI) {
].join(" "),
parameters: SubagentParams,
- async execute(_toolCallId, params, onUpdate, ctx, signal) {
+ async execute(_toolCallId, params, signal, onUpdate, ctx) {
+ if (!ctx.cwd) {
+ return {
+ content: [{ type: "text", text: `Error: ctx.cwd is undefined. This should not happen.` }],
+ details: { mode: "single", agentScope: "user", projectAgentsDir: null, results: [] },
+ };
+ }
const agentScope: AgentScope = params.agentScope ?? "user";
const discovery = discoverAgents(ctx.cwd, agentScope);
const agents = discovery.agents;