From 3ebec2435a4c9dd9b5080fbb1d2591a8836305b8 Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Tue, 4 Nov 2025 23:37:09 -0600 Subject: [PATCH] allow @ agents to work even if not first thing in prompt --- .../src/cli/cmd/tui/component/prompt/autocomplete.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx b/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx index 172ae8a0..aea10bca 100644 --- a/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx @@ -164,7 +164,6 @@ export function Autocomplete(props: { ) const agents = createMemo(() => { - if (store.index !== 0) return [] const agents = sync.data.agent return agents .filter((agent) => !agent.builtIn && agent.mode !== "primary") @@ -395,7 +394,9 @@ export function Autocomplete(props: { return } // Check if a space was typed after the trigger character - const currentText = props.input().getTextRange(store.index + 1, props.input().cursorOffset + 1) + const currentText = props + .input() + .getTextRange(store.index + 1, props.input().cursorOffset + 1) if (currentText.includes(" ")) { hide() }