Skip to content

Commit 7d3077b

Browse files
committed
Bugfix, logic refactor
1 parent 66022ea commit 7d3077b

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

src/FunctionInfoUtilities.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4+
//
5+
6+
using System.Linq;
7+
8+
namespace Microsoft.Azure.Functions.PowerShellWorker
9+
{
10+
internal class FunctionInfoUtilities
11+
{
12+
private const string assistantSkillTriggerName = "assistantSkillTrigger";
13+
14+
public static bool hasAssistantSkillTrigger(AzFunctionInfo info)
15+
{
16+
return info.InputBindings.Where(x => x.Value.Type == assistantSkillTriggerName).Any();
17+
}
18+
}
19+
}

src/PowerShell/PowerShellManager.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,7 @@ public Hashtable InvokeFunction(
248248
{
249249
_pwsh.AddCommand(Utils.TracePipelineObjectCmdlet);
250250
}
251-
var isOpenAiSkillTrigger = functionInfo.InputBindings.Where(x => x.Value.Type == "assistantSkillTrigger").Any();
252-
return ExecuteUserCode(isActivityFunction || isOpenAiSkillTrigger, outputBindings);
251+
return ExecuteUserCode(isActivityFunction || FunctionInfoUtilities.hasAssistantSkillTrigger(functionInfo), outputBindings);
253252
}
254253
}
255254
catch (RuntimeException e)

src/RequestProcessor.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ namespace Microsoft.Azure.Functions.PowerShellWorker
2222
using LogLevel = Microsoft.Azure.WebJobs.Script.Grpc.Messages.RpcLog.Types.Level;
2323
using System.Runtime.InteropServices;
2424
using Microsoft.Azure.Functions.PowerShellWorker.OpenTelemetry;
25+
using System.Linq;
2526

2627
internal class RequestProcessor
2728
{
@@ -537,7 +538,7 @@ private static void BindOutputFromResult(InvocationResponse response, AzFunction
537538
}
538539
}
539540

540-
if (functionInfo.DurableFunctionInfo.ProvidesForcedDollarReturnValue)
541+
if (functionInfo.DurableFunctionInfo.ProvidesForcedDollarReturnValue || functionInfo.InputBindings.Where(x => x.Value.Type == "assistantSkillTrigger").Any())
541542
{
542543
response.ReturnValue = results[AzFunctionInfo.DollarReturn].ToTypedData(isDurableData: true);
543544
}

0 commit comments

Comments
 (0)