Skip to content

Commit e2de80f

Browse files
committed
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.
1 parent de474e5 commit e2de80f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

client/src/components/PromptsTab.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ const PromptsTab = ({
7474
},
7575
argName,
7676
value,
77+
promptArgs,
7778
);
7879
}
7980
};

client/src/lib/hooks/useCompletionState.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ export function useCompletionState(
8484
}));
8585

8686
try {
87-
console.log(state);
87+
if (context !== undefined) {
88+
delete context[argName];
89+
}
8890

8991
const values = await handleCompletion(
9092
ref,

0 commit comments

Comments
 (0)