summaryrefslogtreecommitdiffhomepage
path: root/packages/app/src/context
diff options
context:
space:
mode:
authorBurak Yigit Kaya <[email protected]>2026-03-24 14:01:25 +0000
committerGitHub <[email protected]>2026-03-24 09:01:25 -0500
commit431e0586add85c108ceadc0366a08ee09b862ecc (patch)
tree1533a7b03ab12766eaa3271f1d733e2b70c67a76 /packages/app/src/context
parentfde201c286a83ff32dda9b41d61d734a4449fe70 (diff)
downloadopencode-431e0586add85c108ceadc0366a08ee09b862ecc.tar.gz
opencode-431e0586add85c108ceadc0366a08ee09b862ecc.zip
fix(app): filter non-renderable part types from browser store (#18926)
Diffstat (limited to 'packages/app/src/context')
-rw-r--r--packages/app/src/context/global-sync/event-reducer.ts3
-rw-r--r--packages/app/src/context/sync.tsx5
2 files changed, 7 insertions, 1 deletions
diff --git a/packages/app/src/context/global-sync/event-reducer.ts b/packages/app/src/context/global-sync/event-reducer.ts
index b8eda0573..5d8b7c4e3 100644
--- a/packages/app/src/context/global-sync/event-reducer.ts
+++ b/packages/app/src/context/global-sync/event-reducer.ts
@@ -15,6 +15,8 @@ import type { State, VcsCache } from "./types"
import { trimSessions } from "./session-trim"
import { dropSessionCaches } from "./session-cache"
+const SKIP_PARTS = new Set(["patch", "step-start", "step-finish"])
+
export function applyGlobalEvent(input: {
event: { type: string; properties?: unknown }
project: Project[]
@@ -211,6 +213,7 @@ export function applyDirectoryEvent(input: {
}
case "message.part.updated": {
const part = (event.properties as { part: Part }).part
+ if (SKIP_PARTS.has(part.type)) break
const parts = input.store.part[part.messageID]
if (!parts) {
input.setStore("part", part.messageID, [part])
diff --git a/packages/app/src/context/sync.tsx b/packages/app/src/context/sync.tsx
index 0f2008723..66b889e2a 100644
--- a/packages/app/src/context/sync.tsx
+++ b/packages/app/src/context/sync.tsx
@@ -14,6 +14,8 @@ import { useSDK } from "./sdk"
import type { Message, Part } from "@opencode-ai/sdk/v2/client"
import { SESSION_CACHE_LIMIT, dropSessionCaches, pickSessionCacheEvictions } from "./global-sync/session-cache"
+const SKIP_PARTS = new Set(["patch", "step-start", "step-finish"])
+
function sortParts(parts: Part[]) {
return parts.filter((part) => !!part?.id).sort((a, b) => cmp(a.id, b.id))
}
@@ -336,7 +338,8 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
batch(() => {
input.setStore("message", input.sessionID, reconcile(message, { key: "id" }))
for (const p of next.part) {
- input.setStore("part", p.id, p.part)
+ const filtered = p.part.filter((x) => !SKIP_PARTS.has(x.type))
+ if (filtered.length) input.setStore("part", p.id, filtered)
}
setMeta("limit", key, message.length)
setMeta("cursor", key, next.cursor)