390
invocation.toolSpecificData.modelName = resolvedModelName;
391
}
393
>
// Return result with toolMetadata containing subAgentInvocationId for trajectory tracking
394
>
return {
395
>
content: [{
396
>
kind: 'text',
397
>
value: resultText
398
>
}],
399
>
toolMetadata: {
400
>
subAgentInvocationId,
401
>
description: args.description,
402
>
agentName: agentRequest.subAgentName,
403
>
modelName: resolvedModelName,
404
>
}
405
>
};
406
>
407
>
} catch (error) {
408
const errorMessage = `Error invoking subagent: ${error instanceof Error ? error.message : 'Unknown error'}`;
409
this.logService.error(errorMessage, error);