From 8ad60b1ec2002e8d9f841ba256c3eed1953a7ec6 Mon Sep 17 00:00:00 2001 From: Michael Hart Date: Fri, 20 Feb 2026 11:23:35 +1100 Subject: [PATCH] Use structuredClone instead of remeda's clone (#14351) Co-authored-by: Dax Raad Co-authored-by: Dax --- packages/opencode/src/cli/cmd/tui/component/prompt/history.tsx | 3 +-- packages/opencode/src/cli/cmd/tui/component/prompt/stash.tsx | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/opencode/src/cli/cmd/tui/component/prompt/history.tsx b/packages/opencode/src/cli/cmd/tui/component/prompt/history.tsx index c40534e7e..c1198039d 100644 --- a/packages/opencode/src/cli/cmd/tui/component/prompt/history.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/prompt/history.tsx @@ -3,7 +3,6 @@ import { Global } from "@/global" import { Filesystem } from "@/util/filesystem" import { onMount } from "solid-js" import { createStore, produce } from "solid-js/store" -import { clone } from "remeda" import { createSimpleContext } from "../../context/helper" import { appendFile, writeFile } from "fs/promises" import type { AgentPart, FilePart, TextPart } from "@opencode-ai/sdk/v2" @@ -83,7 +82,7 @@ export const { use: usePromptHistory, provider: PromptHistoryProvider } = create return store.history.at(store.index) }, append(item: PromptInfo) { - const entry = clone(item) + const entry = structuredClone(item) let trimmed = false setStore( produce((draft) => { diff --git a/packages/opencode/src/cli/cmd/tui/component/prompt/stash.tsx b/packages/opencode/src/cli/cmd/tui/component/prompt/stash.tsx index d4dc138d8..4a831b273 100644 --- a/packages/opencode/src/cli/cmd/tui/component/prompt/stash.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/prompt/stash.tsx @@ -3,7 +3,6 @@ import { Global } from "@/global" import { Filesystem } from "@/util/filesystem" import { onMount } from "solid-js" import { createStore, produce } from "solid-js/store" -import { clone } from "remeda" import { createSimpleContext } from "../../context/helper" import { appendFile, writeFile } from "fs/promises" import type { PromptInfo } from "./history" @@ -53,7 +52,7 @@ export const { use: usePromptStash, provider: PromptStashProvider } = createSimp return store.entries }, push(entry: Omit) { - const stash = clone({ ...entry, timestamp: Date.now() }) + const stash = structuredClone({ ...entry, timestamp: Date.now() }) let trimmed = false setStore( produce((draft) => {