From b1a9300c8baeaa02fdf4c3db4dcff17ada11d7d4 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 21 Apr 2025 13:30:07 -0700 Subject: [PATCH] Ignore the current active agent from the agent completion results --- shell/AIShell.Kernel/Utility/ReadLineHelper.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/shell/AIShell.Kernel/Utility/ReadLineHelper.cs b/shell/AIShell.Kernel/Utility/ReadLineHelper.cs index cffda3d4..ce5bec94 100644 --- a/shell/AIShell.Kernel/Utility/ReadLineHelper.cs +++ b/shell/AIShell.Kernel/Utility/ReadLineHelper.cs @@ -201,6 +201,12 @@ private CommandCompletion CompleteForAgent(string input, int cursorIndex) foreach (var a in _shell.Agents) { + if (ReferenceEquals(a, _shell.ActiveAgent)) + { + // Skip the current active agent. + continue; + } + string agentName = a.Impl.Name; if (agentName.StartsWith(targetName, StringComparison.OrdinalIgnoreCase)) {