|
@@ -7,7 +7,7 @@ import { Config } from "@/config/config"
|
|
|
import { Permission } from "@/permission"
|
|
import { Permission } from "@/permission"
|
|
|
import { Plugin } from "@/plugin"
|
|
import { Plugin } from "@/plugin"
|
|
|
import { Snapshot } from "@/snapshot"
|
|
import { Snapshot } from "@/snapshot"
|
|
|
-import * as Session from "./session"
|
|
|
|
|
|
|
+import { Session } from "./session"
|
|
|
import { LLM } from "./llm"
|
|
import { LLM } from "./llm"
|
|
|
import { MessageV2 } from "./message-v2"
|
|
import { MessageV2 } from "./message-v2"
|
|
|
import { isOverflow } from "./overflow"
|
|
import { isOverflow } from "./overflow"
|
|
@@ -19,7 +19,7 @@ import { SessionSummary } from "./summary"
|
|
|
import type { Provider } from "@/provider/provider"
|
|
import type { Provider } from "@/provider/provider"
|
|
|
import { Question } from "@/question"
|
|
import { Question } from "@/question"
|
|
|
import { errorMessage } from "@/util/error"
|
|
import { errorMessage } from "@/util/error"
|
|
|
-import * as Log from "@opencode-ai/core/util/log"
|
|
|
|
|
|
|
+import { Log } from "@opencode-ai/core/util/log"
|
|
|
import { isRecord } from "@/util/record"
|
|
import { isRecord } from "@/util/record"
|
|
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
|
|
import { Database } from "@opencode-ai/core/database/database"
|
|
import { Database } from "@opencode-ai/core/database/database"
|
|
@@ -301,8 +301,6 @@ export const layer = Layer.effect(
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const toolInput = (value: unknown): Record<string, any> => (isRecord(value) ? value : { value })
|
|
|
|
|
-
|
|
|
|
|
const handleEvent = Effect.fnUntraced(function* (value: StreamEvent) {
|
|
const handleEvent = Effect.fnUntraced(function* (value: StreamEvent) {
|
|
|
switch (value.type) {
|
|
switch (value.type) {
|
|
|
case "reasoning-start":
|
|
case "reasoning-start":
|
|
@@ -380,7 +378,7 @@ export const layer = Layer.effect(
|
|
|
throw new Error(`Tool call not allowed while generating summary: ${value.name}`)
|
|
throw new Error(`Tool call not allowed while generating summary: ${value.name}`)
|
|
|
}
|
|
}
|
|
|
const toolCall = yield* ensureToolCall(value)
|
|
const toolCall = yield* ensureToolCall(value)
|
|
|
- const input = toolInput(value.input)
|
|
|
|
|
|
|
+ const input = isRecord(value.input) ? value.input : { value: value.input }
|
|
|
if (!toolCall.call.inputEnded) {
|
|
if (!toolCall.call.inputEnded) {
|
|
|
// TODO(v2): Temporary dual-write while migrating session messages to v2 events.
|
|
// TODO(v2): Temporary dual-write while migrating session messages to v2 events.
|
|
|
if (flags.experimentalEventSystem) {
|
|
if (flags.experimentalEventSystem) {
|