fix(artifact): enhance artifact content loading to include URL for non-write files (#1678)

This commit is contained in:
JeffJiang
2026-04-01 11:38:55 +08:00
committed by GitHub
parent 6ff60f2af1
commit cf43584d24
3 changed files with 15 additions and 4 deletions
+6 -1
View File
@@ -34,5 +34,10 @@ export function useArtifactContent({
// Cache artifact content for 5 minutes to avoid repeated fetches (especially for .skill ZIP extraction)
staleTime: 5 * 60 * 1000,
});
return { content: isWriteFile ? content : data, isLoading, error };
return {
content: isWriteFile ? content : data?.content,
url: isWriteFile ? undefined : data?.url,
isLoading,
error,
};
}
+1 -1
View File
@@ -20,7 +20,7 @@ export async function loadArtifactContent({
const url = urlOfArtifact({ filepath: enhancedFilepath, threadId, isMock });
const response = await fetch(url);
const text = await response.text();
return text;
return { content: text, url };
}
export function loadArtifactContentFromToolCall({