mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-05-23 00:16:48 +00:00
fix(frontend): stop artifact panel from auto-opening on rehydrated write_file (#2278)
After a page refresh, the artifact panel's autoOpen/autoSelect state is reset to true. Submitting a new question flips thread.isLoading to true, which message-list passes to every MessageGroup — including historical ones. The previous response's last write_file step then satisfies the auto-open condition and re-pops the stale artifact. Gate the auto-open on the tool call having no result yet, so only a write_file that is still streaming in the current response can trigger it; rehydrated tool calls always carry a result and are now skipped. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -336,7 +336,7 @@ function ToolCall({
|
|||||||
description = t.toolCalls.writeFile;
|
description = t.toolCalls.writeFile;
|
||||||
}
|
}
|
||||||
const path: string | undefined = (args as { path: string })?.path;
|
const path: string | undefined = (args as { path: string })?.path;
|
||||||
if (isLoading && isLast && autoOpen && autoSelect && path) {
|
if (isLoading && isLast && autoOpen && autoSelect && path && !result) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const url = new URL(
|
const url = new URL(
|
||||||
`write-file:${path}?message_id=${messageId}&tool_call_id=${id}`,
|
`write-file:${path}?message_id=${messageId}&tool_call_id=${id}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user