mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-07 12:18:44 +02:00
fix: block tools for handoff triage\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -56,7 +56,7 @@ internal sealed class CopilotAgentBundle : IAsyncDisposable
|
||||
Streaming = true,
|
||||
};
|
||||
|
||||
if (isScratchpad)
|
||||
if (ShouldDisableSessionTools(command.Pattern, definition, command.WorkspaceKind))
|
||||
{
|
||||
sessionConfig.AvailableTools = [];
|
||||
}
|
||||
@@ -90,6 +90,25 @@ internal sealed class CopilotAgentBundle : IAsyncDisposable
|
||||
return bundle;
|
||||
}
|
||||
|
||||
internal static bool ShouldDisableSessionTools(
|
||||
PatternDefinitionDto pattern,
|
||||
PatternAgentDefinitionDto definition,
|
||||
string workspaceKind)
|
||||
{
|
||||
if (string.Equals(workspaceKind, "scratchpad", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!string.Equals(pattern.Mode, "handoff", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
PatternHandoffTopology topology = PatternGraphResolver.ResolveHandoff(pattern);
|
||||
return string.Equals(definition.Id, topology.EntryAgentId, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public Workflow BuildWorkflow(PatternDefinitionDto pattern)
|
||||
{
|
||||
return pattern.Mode switch
|
||||
|
||||
Reference in New Issue
Block a user