Skip to content

Commit 1a329ba

Browse files
authored
fix: issue from structuredClone addition by using unwrap (#14359)
1 parent 8d781b0 commit 1a329ba

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/opencode/src/cli/cmd/tui/component/prompt/history.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import path from "path"
22
import { Global } from "@/global"
33
import { Filesystem } from "@/util/filesystem"
44
import { onMount } from "solid-js"
5-
import { createStore, produce } from "solid-js/store"
5+
import { createStore, produce, unwrap } from "solid-js/store"
66
import { createSimpleContext } from "../../context/helper"
77
import { appendFile, writeFile } from "fs/promises"
88
import type { AgentPart, FilePart, TextPart } from "@opencode-ai/sdk/v2"
@@ -82,7 +82,7 @@ export const { use: usePromptHistory, provider: PromptHistoryProvider } = create
8282
return store.history.at(store.index)
8383
},
8484
append(item: PromptInfo) {
85-
const entry = structuredClone(item)
85+
const entry = structuredClone(unwrap(item))
8686
let trimmed = false
8787
setStore(
8888
produce((draft) => {

packages/opencode/src/cli/cmd/tui/component/prompt/stash.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import path from "path"
22
import { Global } from "@/global"
33
import { Filesystem } from "@/util/filesystem"
44
import { onMount } from "solid-js"
5-
import { createStore, produce } from "solid-js/store"
5+
import { createStore, produce, unwrap } from "solid-js/store"
66
import { createSimpleContext } from "../../context/helper"
77
import { appendFile, writeFile } from "fs/promises"
88
import type { PromptInfo } from "./history"
@@ -52,7 +52,7 @@ export const { use: usePromptStash, provider: PromptStashProvider } = createSimp
5252
return store.entries
5353
},
5454
push(entry: Omit<StashEntry, "timestamp">) {
55-
const stash = structuredClone({ ...entry, timestamp: Date.now() })
55+
const stash = structuredClone(unwrap({ ...entry, timestamp: Date.now() }))
5656
let trimmed = false
5757
setStore(
5858
produce((draft) => {

0 commit comments

Comments
 (0)