From 62f1093c6e2a74eb93ace875e7c5a809834765cc Mon Sep 17 00:00:00 2001 From: Josh Lambert Date: Fri, 24 Jul 2026 00:06:51 -0400 Subject: [PATCH] docs(cli): clarify upstream event revert --- packages/opencode/src/cli/cmd/run.ts | 2 +- packages/opencode/src/cli/cmd/run/demo.ts | 2 +- packages/opencode/src/cli/cmd/run/session-data.ts | 2 +- packages/opencode/src/cli/cmd/run/stream.transport.ts | 4 ++-- packages/opencode/src/cli/cmd/run/subagent-data.ts | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/opencode/src/cli/cmd/run.ts b/packages/opencode/src/cli/cmd/run.ts index 4e0456a1972..56241ace1a1 100644 --- a/packages/opencode/src/cli/cmd/run.ts +++ b/packages/opencode/src/cli/cmd/run.ts @@ -727,7 +727,7 @@ export const RunCommand = effectCmd({ let retries = 0 // kilocode_change let error: string | undefined - // kilocode_change start - consume the native event once; sync envelopes are compatibility copies + // kilocode_change start - revert to upstream: consume native events without normalizing sync copies for await (const event of events.stream) { // kilocode_change end diff --git a/packages/opencode/src/cli/cmd/run/demo.ts b/packages/opencode/src/cli/cmd/run/demo.ts index 8102b603bd8..f8ad57efc32 100644 --- a/packages/opencode/src/cli/cmd/run/demo.ts +++ b/packages/opencode/src/cli/cmd/run/demo.ts @@ -15,7 +15,7 @@ // Demo mode also handles permission and question replies locally, completing // or failing the synthetic tool parts as appropriate. import path from "path" -import type { Event, ToolPart } from "@kilocode/sdk/v2" // kilocode_change - use the native event contract +import type { Event, ToolPart } from "@kilocode/sdk/v2" // kilocode_change - revert to upstream native Event type import { createSessionData, reduceSessionData, type SessionData } from "./session-data" import { writeSessionOutput } from "./stream" import type { FooterApi, PermissionReply, QuestionReject, QuestionReply, RunPrompt, StreamCommit } from "./types" diff --git a/packages/opencode/src/cli/cmd/run/session-data.ts b/packages/opencode/src/cli/cmd/run/session-data.ts index cf554604046..97df459e91b 100644 --- a/packages/opencode/src/cli/cmd/run/session-data.ts +++ b/packages/opencode/src/cli/cmd/run/session-data.ts @@ -24,7 +24,7 @@ // `data.questions`. The footer shows whichever is first. When a reply // event arrives, the queue entry is removed and the footer falls back // to the next pending request or to the prompt view. -import type { Event, Part, PermissionRequest, QuestionRequest, ToolPart } from "@kilocode/sdk/v2" // kilocode_change - use the native event contract +import type { Event, Part, PermissionRequest, QuestionRequest, ToolPart } from "@kilocode/sdk/v2" // kilocode_change - revert to upstream native Event type import type { RunInteractiveTerminalSnapshot } from "@/kilocode/cli/cmd/run/types" // kilocode_change import * as Locale from "@/util/locale" import { appendTerminalOutput } from "@/kilocode/interactive-terminal/output" // kilocode_change diff --git a/packages/opencode/src/cli/cmd/run/stream.transport.ts b/packages/opencode/src/cli/cmd/run/stream.transport.ts index ae691574fb1..a2c77f87641 100644 --- a/packages/opencode/src/cli/cmd/run/stream.transport.ts +++ b/packages/opencode/src/cli/cmd/run/stream.transport.ts @@ -15,7 +15,7 @@ // The tick counter prevents stale idle events from resolving the wrong turn. // We also re-check live session status before resolving an idle event so a // delayed idle from an older turn cannot complete a newer busy turn. -import type { Event, GlobalEvent, KiloClient } from "@kilocode/sdk/v2" // kilocode_change - use the native event contract +import type { Event, GlobalEvent, KiloClient } from "@kilocode/sdk/v2" // kilocode_change - revert to upstream native Event type import { Context, Deferred, Effect, Exit, Layer, Scope, Stream } from "effect" import { makeRuntime } from "@/effect/run-service" import { @@ -190,7 +190,7 @@ function globalPayloadEvent(value: unknown): Event | undefined { return undefined } - // kilocode_change start - native and sync copies share an ID; process only the native event + // kilocode_change start - revert to upstream: ignore sync compatibility copies if (value.payload.type === "sync") return undefined return isEvent(value.payload) ? value.payload : undefined // kilocode_change end diff --git a/packages/opencode/src/cli/cmd/run/subagent-data.ts b/packages/opencode/src/cli/cmd/run/subagent-data.ts index 9cea0adc01b..0cc3187b82a 100644 --- a/packages/opencode/src/cli/cmd/run/subagent-data.ts +++ b/packages/opencode/src/cli/cmd/run/subagent-data.ts @@ -1,4 +1,4 @@ -import type { Event, Message, Part, PermissionRequest, QuestionRequest, ToolPart } from "@kilocode/sdk/v2" // kilocode_change - use the native event contract +import type { Event, Message, Part, PermissionRequest, QuestionRequest, ToolPart } from "@kilocode/sdk/v2" // kilocode_change - revert to upstream native Event type import * as Locale from "@/util/locale" import { bootstrapSessionData,