fix(app): clear original prompt after retarget (#34863)

This commit is contained in:
Brendan Allan 2026-07-02 14:24:53 +08:00 committed by GitHub
commit 40233595b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 0 deletions

View file

@ -7,6 +7,7 @@ export function createPromptSubmissionState(input: {
prompt: Prompt
context: (ContextItem & { key: string })[]
}) {
const initial = input.target
let target = input.target
let cleared: Prompt | undefined
@ -15,6 +16,7 @@ export function createPromptSubmissionState(input: {
context: input.context,
target: () => target,
clear() {
if (initial !== target) initial.reset()
target.reset()
cleared = target.current()
},