From e2de80fd84629715445cccd011a994c96f3c6443 Mon Sep 17 00:00:00 2001 From: Dennis Geurts Date: Sat, 12 Jul 2025 12:45:02 +0200 Subject: [PATCH] feat: Removes prompt argument from completion state This commit removes the prompt argument from the completion state. The argument is deleted from the context after the completion is handled. This prevents unexpected behavior and ensures a cleaner state. --- client/src/components/PromptsTab.tsx | 1 + client/src/lib/hooks/useCompletionState.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/client/src/components/PromptsTab.tsx b/client/src/components/PromptsTab.tsx index c0e188c0..fa590558 100644 --- a/client/src/components/PromptsTab.tsx +++ b/client/src/components/PromptsTab.tsx @@ -74,6 +74,7 @@ const PromptsTab = ({ }, argName, value, + promptArgs, ); } }; diff --git a/client/src/lib/hooks/useCompletionState.ts b/client/src/lib/hooks/useCompletionState.ts index a63968ae..26b69a27 100644 --- a/client/src/lib/hooks/useCompletionState.ts +++ b/client/src/lib/hooks/useCompletionState.ts @@ -84,7 +84,9 @@ export function useCompletionState( })); try { - console.log(state); + if (context !== undefined) { + delete context[argName]; + } const values = await handleCompletion( ref,